Pygame map editor

Pygame map editor

Postby ChristianCareaga » Sun Jul 07, 2013 2:13 pm

im creating a map-editor (recreating) a map editor for an RPG and im recreating it because screen movement needed to be implemented so that we could make bigger maps

Im having trouble drawing hitboxes in the editor so basically in the editor when you push H a rect is drawn from the click point to the next selected click point
it works fine before you move the screen position but after it gets all messed up

so before i move a rect is created from where the mouse is to where the mouse is when i push H again
but when i move the camera say 20 pixels up the rect is blitted 20 pixels down where the mouse should be

the easiest way to understand is to run the code
here is a zip file
mapeditor.zip
map editor
(28.14 KiB) Downloaded 69 times


or you can see the game with the mapeditor here:
https://github.com/linkey11/Necromonster

please please help me out ive been trying to fix it for hours with no success thanks so much!
ChristianCareaga
 
Posts: 52
Joined: Sat Jun 22, 2013 9:54 am

Re: Pygame map editor

Postby Mekire » Sun Jul 07, 2013 11:58 pm

I would like to help but honestly I'm not so sure what the goal is here. You are probably going to want to create a tile map editor, but your hit boxes should probably be masks--and they would probably be better handled with code. You can have a sprite sheet with all the available tiles on it. Then you place the tiles and keep track of their coordinates in a dictionary. You then make it so you can have multiple layers of these tile dicts for one map. You make masks of each layer and if the player is in that particular layer he collides with those masks.

-Mek
User avatar
Mekire
 
Posts: 988
Joined: Thu Feb 07, 2013 11:33 pm
Location: Amakusa, Japan


Return to Game Development

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron