Search the Community
Showing results for tags 'collisiontile'.
-
Hi everybody! I heard of the awesome features in the new Phaser-release through Twitter yesterday, so I really wanted to play around with it a bit. I'm currently experimenting with a simple platformer (click to play). I'm using Phaser version 1.1.3. The ground is made up of multiple blocks: this.floorTiles = this.game.add.group();for (var i = 0; i < worldWidth; i += 64) { var brick = this.floorTiles.create(i, worldHeight - 32, 'brick'); brick.body.immovable = true; brick.body.allowGravity = false;}The player collides with them vertically just fine, but also horizontally if you start moving left. I know that this is a common problem with collision systems and each implementation/engine has its own way of going around this. How can I avoid this unwanted horizontal collision in Phaser? Also: I can't jump if I'm on the ground – jumping in the air works, though (press SPACE). Any idea on how to solve this aswell? if (this.cursors.jump.isDown && true) { this.body.velocity.y = -500;}Full code: game.js / player.js Thank you very much for your help. I'm enjoying Phaser quite a bit already, I just need a little help getting started. Thank you! Max
- 5 replies
-
- collisiontile
- tiles
-
(and 2 more)
Tagged with: