Basic movement code for a sokoban game.
reply to How do I get to Level 3 on my Game? Need Help Asap:(
By danpost - about 1 hour ago
You need to see what level world the actor is currently in to determine which world to proceed to. This can be solved by adding a second condition in your 'if' statements in the 'MyWorld', 'Level2' and 'Level3' methods: <Code Omitted> As you currently have it coded, the sum of all your level changing method calls, or this: <Code Omitted>will do the same as the following: <Code Omitted>As you can tell, lines 3 and 4 are bumped by line 5 in that 'next' will never contain a Level2 world at line 7 or 8. When you create and set a new world active, you are not changing the world the current actor is in or what its score value would contain. Only the last world setting will take after the current act method has completed its execution.