My Open Source Opengl Map Editor :D

Started by
5 comments, last by McGrane 19 years, 6 months ago
Hey all, I thought i'd post the source for my map editor to help anybody that wants it ;) I know when i had first started i'd have liked to see something like this :P Just Drag to the toolbar Plz post any comments, or improvements you may have ;)
Advertisement
Your code looks clean and easy to follow. This will help me a lot when I am ready to create something like this.

The editor is pretty cool, man.
one suggestion, you should really use the mouse for placing tiles. it will be very tedius having to use the arrow keys to move the "pointer" around... it would be much nicer to just click on the map and have a tile placed there... just my suggestion... good work!
FTA, my 2D futuristic action MMORPG
works nicely! good job.
just found one bug, if you scroll through all the tiles, then you can't move the cursor anymore and are forced to press reset, you should just make it so when you get to the end to loop over to the first tile again.
Yea i didnt want too add that till i knew how many tiles id be using ... what you do is press 'Delete' i think, that rests the tile to the grass tile - which may be hard to see, so press the 'Shift' key and youll get a water tile ;)

And about the mouse, I didnt think there would have been much of a difference, but more work on myself (so lazy lol)
But i see what your saying i might add it in later ;)

Thanks for all the comments :D

#####################################
To all else:
#####################################
'Delete' Key To Reset back to 'Grass' Tile
-Press Shift to change it to 'Water' if you cant see it

;)
hey mcgrane,

it actually is very easy to use the mouse to place a tile. it will also make making maps faster and easier. it goes something like this:

-find out where the mouse is (should be a single function call, im not familar with the win32 API)

tile_x = (mouse_x + scroll_x_offset) / TILEWIDTH
tile_y = (mouse_y + scroll_y_offset) / TILEHEIGHT

map[tile_y][tile_x] = currently_selected_tile

something like this. however, to make it pixel perfect, it might be a little more work. you can check out the source to my old level editor (its only 2 files like yours) here. download the game and look in the source directory. the level editor is "leveledit.cpp/h". the exe to the editor is in the main program directory (its very similar to yours). maybe that can help... good luck!
FTA, my 2D futuristic action MMORPG
Ok thanks ill give it a look at now ;)

This topic is closed to new replies.

Advertisement