
Robooto
Members-
Posts
8 -
Joined
-
Last visited
Everything posted by Robooto
-
I spent some time with this and was able to figure it out. I created a new jumping method which works just fine on mobile currently adjusting it for variable jumping too. // new jumping method var onTheGround = this.player.body.touching.down; if (onTheGround) this.jumpAmount = 0; if ((this.input.keyboard.justPressed(Phaser.Keyboard.UP) || this.game.input.activePointer.justPressed(65)) && this.jumpAmount < 5) { this.player.body.velocity.y = this.JUMP_SPEED; this.jumpAmount++; console.log(this.jumpAmount); }
-
Hi, I'm a beginner with Phaser and Javascript and have been learning by playing around with the wonderful Game Mechanic Explorer http://gamemechanicexplorer.com/ (by John Watson @yafd) I noticed in the double jump example http://gamemechanicexplorer.com/#platformer-5 that on mobile (iphone) double jumping wasn't working. I'm not going to paste in all the code just the code I think deals with the issue. // Set a variable that is true when the player is touching the ground var onTheGround = this.player.body.touching.down; if (onTheGround) this.canDoubleJump = true; if (this.upInputIsActive(5)) { if (this.canDoubleJump || onTheGround) { // Jump when the player is touching the ground or they can double jump this.player.body.velocity.y = this.JUMP_SPEED; // Disable ability to double jump if the player is jumping in the air if (!onTheGround) this.canDoubleJump = false; } }// This function should return true when the player activates the "jump" control// In this case, either holding the up arrow or tapping or clicking on the center// part of the screen.GameState.prototype.upInputIsActive = function(duration) { var isActive = false; isActive = this.input.keyboard.justPressed(Phaser.Keyboard.UP, duration); isActive |= (this.game.input.activePointer.justPressed(duration + 1000/60) && this.game.input.activePointer.x > this.game.width/4 && this.game.input.activePointer.x < this.game.width/2 + this.game.width/4); return isActive;};From what I gather is that if (this.upInputIsActive(5)) condition is never met on mobile. My question is why doesn't this work on mobile and if someone could point me in the right direction to solve this so it does work on mobile. Thanks!
-
[complete] Rhythm Square (feedback is welcome!)
Robooto replied to MesmerismJS's topic in Game Showcase
Really fun. Very impressive UI. That tutorial is very nice as well. -
I'm sure there is a way to do that. I'm pretty new to development but I will definitely attempt to integrate the scoreboard into the same page or game if possible.
-
Thanks for playing!
-
My first game. Lion Puncher. Protect the helpless candies by punching an endless parade of hungry lions. http://www.samwrussell.com/games/lionpuncher/ I've challenged myself to learn javascript/phaser by creating 12 games/apps this year (started in May). This is game was completed last month but after a friend created some art for me I decided to work another month on it (yeah I already broke my rule). I had a lot of fun learning phaser. Constructive criticism is always welcome.