gamify Posted March 30, 2017 Share Posted March 30, 2017 how to use getTile() function without pointer event Requirement : onload the gettile() i need Quote Link to comment Share on other sites More sharing options...
obiot Posted March 31, 2017 Share Posted March 31, 2017 pointer event or not does not really matter, just pick up a point in world coordinate (e.g. an entity position or any random point) and give it as parameter to the getTile function : http://melonjs.github.io/melonJS/docs/me.TMXLayer.html#getTile i'm not sure what you mean by Quote "onload the gettile()" though Quote Link to comment Share on other sites More sharing options...
gamify Posted March 31, 2017 Author Share Posted March 31, 2017 var layer = me.game.world.getChildByName("waterLayer")[0]; var tile = layer.getTile(event.gameWorldX, event.gameWorldY); this should not perform on event i need all tiles row and column based on layer on game load so that i can make my car movement on that tile Quote Link to comment Share on other sites More sharing options...
Parasyte Posted April 6, 2017 Share Posted April 6, 2017 You can use any arbitrary integers you want for the getTile arguments. They do not have to come from an event object. Quote Link to comment Share on other sites More sharing options...
gamify Posted April 6, 2017 Author Share Posted April 6, 2017 okay thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.