A game that I've been working on. But time constraints have not allowed me to finish, I just got the jump and room changing codes down. I hope to get back to this.
oh in your world1 prepare method you have:
Player player = new Player();
addObject(player, 50, 415);
which makes this player show up locally, you have a Actor called Player that is not being initialized for some reason (even though it looks like MyWorld constructor makes one, but is is not) Change in prepare on room1 to:
Player = new Player();
addObject(player, 50, 415);
and the Player Object becomes not null.
@lordhershey, you are half right. You got the right location and some of the problem; but not the right correction.
Remove the code in the Room1 class in the 'prepare' method that creates and adds a Player object into the world. Then right-click on your MyWorld icon and select 'new MyWorld()' from the drop-down list. That should fix the problem.
Thanks, I had just tried a quick test, but not sure if that was the way to go. Will this properly call the add they have in the my world base class? Will there be any player spawning issues when they change screen?
You should only have to spawn the one initial player. It gets passed from world to world without any new ones being created.
I am not sure what are you referring to with 'the add they have in the my world base class'. However the line in the world constructor that start 'addObject' can be removed. The player can immediately be added into the 'Room1' world (your 'world.addObject...' line) without being added into the current 'MyWorld' world.
The room transitions seem to work well. If you fall to the bottom , you cannot jump back up, I would make a die routine that put the player back to their start position in the room. If you hit reset you see a different scene is seen.
2014/1/13
2014/1/13
2014/1/13
2014/1/13
2014/1/14
2014/1/14
2014/1/14
2014/1/16
2014/1/16