Change player spawn point

24 views
Skip to first unread message

dth...@gmail.com

unread,
Jun 10, 2015, 9:15:23 PM6/10/15
to mel...@googlegroups.com
I am making an RPG with melon and when the player moves, it updates their x, y. If they save game, it stores these updated coordinates in the DB.

I realize that I set the player's spawn point in tiled when I create the entity object layer.

When the player restarts the game, the player's saved coordinates are loaded. I'd like the player to spawn at those coordinates rather than the one specified in Tiled.

How is this done?

Jay Oster

unread,
Jun 10, 2015, 10:54:03 PM6/10/15
to mel...@googlegroups.com, dth...@gmail.com, dth...@gmail.com
Load the position from the DB in the entity constructor, and update the entity position after calling the superconstructor.
Reply all
Reply to author
Forward
0 new messages