Acid Posted August 10, 2015 Share Posted August 10, 2015 Hello, I have created a simple top-down game with a tiled map for a frogger-like game where i can move my character arround. I now want to implement moving platforms for my character to advance, i want to spawn my platforms on a specific group of tiles, (since this is a frogger game, you could guess i want to spawn logs on water tiles) i have done some research and couldn't really find what i was looking for in the examples and the forum. I would like some advice on the way to proceed in my project, as i am kind of lost Is it possible to generate my platforms using the json data to identify the water tiles? Do my platforms have to be Tile objects or can i create them in the game so i can freely use them? I'll gladly take your advice Link to comment Share on other sites More sharing options...
drhayes Posted August 10, 2015 Share Posted August 10, 2015 If you think in terms of "regions within my map where my player sprite moves" I think it becomes an easier problem. Like, don't try and get a sprite to collide with your player and get them "stuck" so they move together until the player jumps and now they're not stuck. Track where the logs should be and both draw the log images there and see if the player is inside the rectangle defined by the log. If the player is there, then move them along with the log. Link to comment Share on other sites More sharing options...
Acid Posted August 10, 2015 Author Share Posted August 10, 2015 Thanks for your answer, i'm going to code towards that purpose Link to comment Share on other sites More sharing options...
drhayes Posted August 10, 2015 Share Posted August 10, 2015 Ah, don't forget to disable physics while a system other than physics is moving the sprite. You can change "sprite.body.moves = false;" while you're moving the sprite. Link to comment Share on other sites More sharing options...
Recommended Posts