AramCP Posted November 26, 2016 Share Posted November 26, 2016 Hi guys i have two maps in my game and i want to do that if my player sprite collides with a specific tile (like a door), he will enter to the other map. I created a diferent state for each map, so states are not the problem, i know how to use them, i've also exported my map, implemented it and all works well. So how can i make a player collide with a specific tile (with his ID i guees) and if he touches it then i pass to another map? Link to comment Share on other sites More sharing options...
nazimboudeffa Posted November 26, 2016 Share Posted November 26, 2016 hi @AramCP i have gone a little bit more in my game so here it is actually, i think i'll do something like you are saying in the future http://asciimulation.link/zeldajs/ anyway, you should just start a state with all the required assets in it but the questions is : how do you load them in the best way ? i mean going further with a loading state then a loading bar then the level or just everithing in this new state Link to comment Share on other sites More sharing options...
AramCP Posted November 26, 2016 Author Share Posted November 26, 2016 4 minutes ago, thefailtheory said: hi @ArmCP i have gone a little bit more in my game so here it is actually, i think i'll do something like you are saying in the future http://asciimulation.link/zeldajs/ anyway, you should just start a state with all the required assets in it but the questions is : how do you load them in the best way ? i mean going further with a loading state then a loading bar then the level or just everithing in this new state I created a state that loads all the assets, and then different states for intro, game options, maps etc... Thats not the problem, but i need to know how to pass to another map when te player colides with a specific tile, something like: if(player collides with the door){ game.state.start('nextmap') } PD: Your game looks nice but it becomes a bit laggy when you walk down Link to comment Share on other sites More sharing options...
nazimboudeffa Posted November 26, 2016 Share Posted November 26, 2016 oh i see, let me a little more time, it's time to sleep actually am sure tomorrow i'll have something interesting to discuss in parralel i don't have the actual line of code to take a collision with a tile in account but an idea should be to create a sprite in the area and collid with it better then to collid with the map Link to comment Share on other sites More sharing options...
AramCP Posted November 26, 2016 Author Share Posted November 26, 2016 3 minutes ago, thefailtheory said: oh i see, let me a little more time, it's time to sleep actually am sure tomorrow i'll have something interesting to discuss in parralel i don't have the actual line of code to take a collision with a tile in account but an idea should be to create a sprite in the area and collid with it better then to collid with the map I think you solved my problem saying that! Im going to try it right now xD thanks! Link to comment Share on other sites More sharing options...
nazimboudeffa Posted November 26, 2016 Share Posted November 26, 2016 yeah cool Link to comment Share on other sites More sharing options...
Recommended Posts