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.

Newcomers DBPro Corner / Game Editors

Author
Message
Fneep
19
Years of Service
User Offline
Joined: 3rd Sep 2005
Location: In my house
Posted: 27th Mar 2006 09:58 Edited at: 27th Mar 2006 10:03
Howdy,
I know that it is easier to make a game editor and then make all your levels or whatever in the editor then to code it all (Not to mention faster), so I was wondering how to go about an editor for a simple breakout game, only very basic of course. I only want to know how to make an editor which can:

1. Start a new Breakout levelly thing
2. Place blocks around the board
3. Save the Breakout levelly thing
4. Be able to load these levels in the actual game

From this basic editor, I think it would be possible for me to extrapolate and make pretty much any kind of editor.

Thank you

roswell
21
Years of Service
User Offline
Joined: 17th Dec 2002
Location: United States
Posted: 27th Mar 2006 21:15
It might be overkill to try and create a level editor to generate the levels for a game like Breakout. You would probably be better off just defining each level in the game code itself. In fact, for Breakout it might be very easy to define a level by using just a few numbers, and then write a "build_level()" function to actually draw the level based on the values. For example, Level 1 of Breakout might contain 4 rows of blocks with 5 blocks per row, yeah? Just write a "build_level()" function that reads these values (perhaps from an array) and draws that configuration. Level 2 might have 5 rows of blocks with 6 blocks per row. Now you can just call "build_level()" again to draw that configuration. "build_level()" might look something like this:



The above code hasn't been tested, and you would have to supply a "draw_block()" function, but it should give you an idea of how to go about this. Someone let me know if my logic is fuzzy.

'Just one game,' they said, and started to play. That was yesterday.

Dual Athlon 2.0/1GB RAM/GeForce Ti4200-128/WinXP Pro
Fneep
19
Years of Service
User Offline
Joined: 3rd Sep 2005
Location: In my house
Posted: 28th Mar 2006 07:52
The thing is, I dont want to create a breakout game that is just a cube made up of smaller blocks . What I want to do is create custom levels which have special blocks that can give you upgrades and the like. If you have played richochet you will know what I mean. Sorry

MadBovine
19
Years of Service
User Offline
Joined: 17th Oct 2005
Location:
Posted: 28th Mar 2006 08:33
What you will want to do is decide upon a format for you levels, and then create the editor and have it write your input into a file (either for the level or for the whole game) using the format you have decided. Then when the game loads have it load the current level from that level file(s). Here is an example of what I mean (It won't compile, just for the general idea)


Format


using the format you would write your editor so it would save that information into a text file, either one file per level, or a master file (where the ; or whatever symbol you want comes in handy so when parsing the text file your editor/game can recognize that it has come to the end of a level's data). As to how your editor would get that data from you is entirely up to you. You could write a simple text based entry system


Or something more elaborate that uses a drag & drop interface (Example NOT supplied, lol)

In your game you would parse the text file and have it read the information for the level you are loading and load the blocks based on the file.

Am I making myself clear, or just confusing you? lol
Fneep
19
Years of Service
User Offline
Joined: 3rd Sep 2005
Location: In my house
Posted: 29th Mar 2006 08:29
No, I get it, thanx!

Login to post a reply

Server time is: 2024-11-27 01:51:22
Your offset time is: 2024-11-27 01:51:22