Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Drag and drop level editor

Author
Message
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 9th Jan 2005 23:54 Edited at: 27th Jan 2005 12:13
<edit 26/1/05 - added a snap to grid option to help with alignment>

I'm sure it's been done a hundred times, but here's a very straight forward level editor to help position and scale your objects in your game.





Then, in your game, paste this code before your main program loop to autoload your level:






Attachments

Login to view attachments
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 10th Jan 2005 03:32
Nice one. A lot of beginners will find this useful.

FXTC
20
Years of Service
User Offline
Joined: 3rd Jul 2004
Location: CzechRepublic
Posted: 19th Jan 2005 04:32
make this with buegui2

AMD 2,4 512MB RAM,2x200GB hdd,GforceFX5700GT128MB
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 19th Jan 2005 07:08
??


No budget games
21
Years of Service
User Offline
Joined: 26th Feb 2004
Location:
Posted: 20th Jan 2005 00:42
I think he means use bluegui 2 because it will give it a more windows like appearnce which users like.


Advancement Games
20
Years of Service
User Offline
Joined: 6th Jan 2005
Location:
Posted: 20th Jan 2005 05:29
That would not be a bad thought. How do you add different terrains? If you cannot, then you should try that in another version.

Comming soon: www.mworksstudios.com
Opening in MARCH OF 2005
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 20th Jan 2005 06:15 Edited at: 20th Jan 2005 06:16
There is something like that already which has menus and terrain options: http://forum.thegamecreators.com/?m=forum_view&t=46111&b=5 I think it's a free download.

The only real advantage of my code over others is if people want to see how it works, and fiddle with the code to expand upon it themselves.




Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 26th Jan 2005 10:53 Edited at: 26th Jan 2005 10:54
Two easy ways of making allignment easier, are probably not assigning movement to keys, but:

1. Slow the mouse movement down:

The movement of the objects is done in the two lines near the bottom:



you could change it to, say,



2. Write a 'snap to grid' routine for object placement. Should be just a few lines, of the form :



That would, for example, snap objects to integer values on the x axis.

To snap to 10ths of integer values, you'd say:



Then you'd do the same for y and z values.

Hope that helps. Glad that at least someone is using the editor, though!


Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 27th Jan 2005 12:05
I did have a look at that, but I didn't spot the problem. I'd suggest just ripping the save/load routines out of my code above, as they work.

As for the snapping to grid, I've added it into the code at the top of this thread. Whilst an object is selected by holding the left mouse button, press "a" to align it. I've got it programmed to snap to integer*10 values, but you can easily change that.


Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 30th Jan 2005 05:02
When I get DBP I'm gonna try this thing out. It looks nice.

Have a heart and join my message board.And now my messageboards work again!Woot!
Random 69
20
Years of Service
User Offline
Joined: 24th Aug 2004
Location: Marshmellowland
Posted: 23rd Feb 2005 10:35
Could you please fix the scaling it doesnt work

Either than that this is friggin great Thanks Ric

[ 21.27GB / 74.52GB ] [ 235MB / 511MB ] [ RADEON 9500 PRO / 9700 @ 1280x934 ] [ Windows XP ][ Intel Pentium 4 CPU 2.00GHz @ 1993MHz ]
Sol462
20
Years of Service
User Offline
Joined: 12th Sep 2004
Location: playing with the spazookeedoo
Posted: 24th Feb 2005 10:07
that's awesome, spazuh! great work!

[url=www.spazuh.tk][/url]
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 25th Feb 2005 09:17
Quote: "Could you please fix the scaling it doesnt work"


Seems to work fine here. This was written in DBPro, by the way, not sure if it works in Classic. Also, check you have the left mouse button pressed down before using the left and right arrow keys to adjust the scale. Finally, you could make it scale up and down by larger increments by making these changes:



where the 5 can be changed to any number you want.


Random 69
20
Years of Service
User Offline
Joined: 24th Aug 2004
Location: Marshmellowland
Posted: 25th Feb 2005 10:34
I changed the 5 to 20 works fine now. Thanks alot also is it possible you could add some commands to flip objects like alot of objects are sideways u should have like a flip thing to flip verticle horizintal and any others ;D


If you have time this is a awsome editor though

[ 21.27GB / 74.52GB ] [ 235MB / 511MB ] [ RADEON 9500 PRO / 9700 @ 1280x934 ] [ Windows XP ][ Intel Pentium 4 CPU 2.00GHz @ 1993MHz ]
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 25th Feb 2005 10:44
I'll try to get around to making some improvements, including flip/rotation of objects during the next week.


Random 69
20
Years of Service
User Offline
Joined: 24th Aug 2004
Location: Marshmellowland
Posted: 25th Feb 2005 23:18
Awsome your the best Ric

[ 21.27GB / 74.52GB ] [ 235MB / 511MB ] [ RADEON 9500 PRO / 9700 @ 1280x934 ] [ Windows XP ][ Intel Pentium 4 CPU 2.00GHz @ 1993MHz ]
Freddy 007
20
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 27th Feb 2005 22:08
wow

I like it, man! That's really some great work you've done there!


Check out PanzerGames at: http://www.freewebs.com/panzergames
æ ø å
Digital Dragon
20
Years of Service
User Offline
Joined: 17th Dec 2004
Location: ...
Posted: 4th Apr 2005 05:28
I have my world maker but how would i put save and load in because i have had a go at it but it is just mucked up now!
Here it is

Thx if you can help

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 4th Apr 2005 07:58 Edited at: 4th Apr 2005 07:59
Wrong forum for asking questions, really, but:

1. I'd suggest studying my code a bit longer to see exactly how I did it.
2. Be careful with 'if spacekey()=1 then gosub writedata' - if you hold the spacekey down to long it will repeat the process continually until you lift it back up again - notice I added in 'wait' commands to prevent this.
3. On first glance at your code, it seems that you are reading 4 times more information than you have written. You can only read what you have put there in the first place.

Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 5th Apr 2005 23:39
Too bad the pick object() command doesn't work in DBC...
Digital Dragon
20
Years of Service
User Offline
Joined: 17th Dec 2004
Location: ...
Posted: 6th Apr 2005 02:06
I have read more through your code but I just don't get how you loaded a a filename by doing read string 10,filename$(object)
because when I tryed it, it said parameter for "read string" does not match `filename`,`variable string` at line 12 for me
How is this possible since your code worked?

Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 6th Apr 2005 06:41
If that is the exact code you used, then it didn't work because the array hasn't been created.


"Lets migrate like bricks" - Me
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 6th Apr 2005 10:37
Post your whole code in the DBP forum, and I'll take a look at it for you.

Erick G
Retired Moderator
20
Years of Service
User Offline
Joined: 2nd Oct 2004
Location: Texas, USA
Posted: 6th Apr 2005 15:33
Man ric, you never cease to amaze me !!!

Login to post a reply

Server time is: 2025-05-18 04:49:22
Your offset time is: 2025-05-18 04:49:22