Sign in to follow this  
McGrane

My Open Source Opengl Map Editor :D

Recommended Posts

wilsocn    122
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.

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
ekrax    128
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.

Share this post


Link to post
Share on other sites
McGrane    1744
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

;)

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites

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

Sign in to follow this