Posts | ||
---|---|---|
Loading Map with multiple classes | Locked | |
Thread Options | ||
Mar 2 2013 Anchor | ||
I am having a problem with my game. The problem is mainly centered around loading the map. The way I have things set up is each level resides in it's own class. Each level also contains it's own map. My problem is the maps do not load properly. For example, the map loaded in Level 2 will load in level 1. I hope I can get some answers, and thanks in advance for any solutions. The source is available on my GIT repo: Source Thanks, -DanqueDynasty Edited by: DanqueDynasty |
||
Mar 4 2013 Anchor | ||
The attributes in the class BlockMap are all static:
This means they are only once in the memory for the entire class/application and not bound to one object.
You load the level mazeLevel where you create a BlockMap object and then TestLevel where you "create another" BlockMap object, but because in both parts you are using the same static attributes of BlockMap the class TestLevel overwrites the mazeLevel. The BlockMap-objects in the level-classes are also static. Best regards Edited by: MausGames |
||
Mar 4 2013 Anchor | ||
Did that and it works, but now there is a problem with the collision detection. Thanks^^ |
||
Mar 12 2013 Anchor | ||
Whats the problem with collision detection? |
||
Mar 12 2013 Anchor | ||
Hehe, forgot to mention that I resolved it^^ Basically I had to rewrite my method for collision detection to work abstractly. Everything works now thanks. |
Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.