Jump to content
  • Advertisement
  • entries
    743
  • comments
    1924
  • views
    582804

Level editor

Sign in to follow this  
Aardvajk

203 views

Just thought, I never posted a screenshot of the finished level editor.



It is non-game-specific, so I can write a config script for a specific game. For example, this is Orc's editor config script:


width 48
height 48

block 00 "Blank" rgb 0 0 0
block 01 "Grey Block" img "C:\Graphics\Block.bmp"
block 99 "Rock" img "C:\Graphics\Rock.bmp"
block 10 "Star" img "C:\Graphics\Star.bmp"
block 22 "Teleport" rgb 64 64 64
block 30 "Switch Base" img "C:\Graphics\Orc\Switchblock.bmp"
block 40 "Telport Base" img "C:\Graphics\Tele.bmp"
block 50 "Static Mine" img "C:\Graphics\orc\mine\mine_front.bmp"

item 01 "Ship" 0 0
Class 01 ID 0 Bank 3 Frame 0 X 0 Y 0 Width 24 Height 24 Dir -1 AnimLeft 0 AnimRight 1 Particle 0 Missile 0 end
img "C:\Graphics\Orc\ship4.bmp"
item 02 "Crate" 0 0
Class 03 ID 0 Bank 1 Frame 1 X 0 Y 0 Width 48 Height 48 Type 8 end
img "C:\Graphics\crate.bmp"
item 03 "Vertical Mine" 0 0
Class 04 ID 0 Bank 6 Frame 0 X 0 Y 0 Width 48 Height 48 Dir 1 Speed 10 Anim 3 end
img "C:\Graphics\orc\mine\mine_front.bmp"
item 04 "Horizontal Mine" 0 0
Class 05 ID 0 Bank 6 Frame 0 X 0 Y 0 Width 48 Height 48 Dir 1 Speed 10 Anim 3 end
img "C:\Graphics\orc\mine\mine_front.bmp"
item 05 "Static Mine" 0 0
Class 06 ID 0 Bank 6 Frame 0 X 0 Y 0 Width 48 Height 48 Type 20 Anim 3 end
img "C:\Graphics\orc\mine\mine_front.bmp"
item 06 "Homing Ship" 0 0
Class 07 ID 0 Bank 7 Frame 0 X 0 Y 0 Width 32 Height 32 Type 12 Anim 4 end
img "C:\Graphics\orc\enemy\ship0.bmp"
item 07 "Switch" 0 16
Class 08 ID 0 Bank 8 Frame 0 X 0 Y 0 Width 48 Height 16 AffectID 0 end
img "C:\Graphics\orc\switch.bmp"
item 08 "Door" 0 0
Class 09 ID 0 Bank 1 Frame 4 X 0 Y 0 Width 48 Height 48 end
img "C:\Graphics\GlassBlock.bmp"




The editor then allows you to fill out the map grid with blocks, then free point and click items onto the map. You can then double click and item either in the map or in the items list to open its property panel and edit any of its properties.

Each item class in the script is required to implement properties called X, Y, Width and Height or the editor reports an error when loading the script, but it doesn't matter in what order.

I've not tried to use it for another game yet, but in theory it should be suitable for any 2D game I write, unless I add features to another game not in Orc, such as scripting for example, in which case the editor will have to be developed.

I love C++ Builder for that kind of application, although I've only got Builder 3 and it feels a bit antiquated now I've got used to Visual Studio. Perhaps I should knuckle down and learn C# and Windows Forms.

PS: I hope Jasc don't sue me for nicking a couple of their tool icons. This project is purely for personal use and not ever being released.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!