Epixors Posted July 17, 2014 Share Posted July 17, 2014 Hi there, I've been messing around with Phaser for a few days now and everything has been coming along nicely. I have a problem where I want various things to happen when the player touches specific tiles, so I came to the conclusion that I had to use setTileIndexCallback. All seemed fine and I went along and wrote the code, however nothing is triggering. I tried to structure it like the example on the Phaser site but alas, no luck. Can any of you help me out here? This is the file generating the current game stage: http://pastebin.com/52kZ3Etg This is the "Hunter" file for the player: http://pastebin.com/MJmDtBjF and this is the tilemap JSON file (made with Tiled): http://pastebin.com/ZhbCcxGJ Note that the array of tiles I'm trying to call for are split over both layers. I've made sure to touch all of them but nothing occured. Can anyone help me? Also here is an image of my map: http://i.imgur.com/jq4JflE.png Link to comment Share on other sites More sharing options...
Epixors Posted July 19, 2014 Author Share Posted July 19, 2014 Buuuuuump. Anyone an idea? Link to comment Share on other sites More sharing options...
Heppell08 Posted July 19, 2014 Share Posted July 19, 2014 for me when i used them i did this:var tileFunc1 = { theTileFunctionName: function () { // Do cool stuff here }}// thenmap.setTileIndexCallback([TILE ID HERE], tileFunc1.theTileFunctionName, this); Link to comment Share on other sites More sharing options...
Epixors Posted July 25, 2014 Author Share Posted July 25, 2014 for me when i used them i did this:var tileFunc1 = { theTileFunctionName: function () { // Do cool stuff here }}// thenmap.setTileIndexCallback([TILE ID HERE], tileFunc1.theTileFunctionName, this); Sorry for the late reply, didn't manage to get on a lot, however I tried this and it did not solve it. The function scope should be correct it's just never being fired, maybe I am referring to the wrong layer or in a wrong context? Link to comment Share on other sites More sharing options...
Recommended Posts