chon27 Posted September 22, 2014 Share Posted September 22, 2014 I am having problems jumping in my game. 1st. I use key.isDown to determinate the jump of my sprite. But if I hold key of the jump, my character is jumping all the time. I want to push the key once and wait to another key press to do a new jump. 2nd. I draw the map with json using a file made by tiled. This tiles work with sprite.touching, they are not work by sprite.blocked. Then in my game I draw new blocks with sprite.create function and they work with sprite.blocked only. What is the difference? By the way I have some problems with sprite collisions in this new blocks, I can stick to the walls like this while hold left cursor. I have Phaser v2.0.5. ZED 1 Link to comment Share on other sites More sharing options...
lewster32 Posted September 22, 2014 Share Posted September 22, 2014 1: This example shows how to use keyboard events instead of key states: http://examples.phaser.io/_site/view_full.html?d=input&f=keyboard+hotkeys.js&t=keyboard%20hotkeys 2: I believe (but I'm not entirely sure on this) that blocked is set when a sprite collides with an immovable object or the world bounds (when collideWorldBounds is true) whereas touching is set during any collision, but is immediately unset afterwards, and so must be checked inside the collide callback. Link to comment Share on other sites More sharing options...
chon27 Posted September 28, 2014 Author Share Posted September 28, 2014 Thanks. About first issue it's fine, I have done it correctly. I have solved the second one using Tilemap.putTile function, then the new blocks are part of tilemap and they are acting like their own nature. Link to comment Share on other sites More sharing options...
Recommended Posts