Search the Community

Showing results for tags 'acceleration'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 9 results

  1. I have a question about mouse/camera acceleration in conjunction with WebVRFreeCamera: If I move the mouse (or the headset) constantly slow, there is a very small movement in the scene. If I begin accelerating (mouse or headset), the camera also begins accelerating and deccelerates after I stop input movements. The end position differs mostly if I move forward and backward the same amount but in different speeds. This is very unhandy using a headset, constant moving should always result in a constant moving of the camera regardless of the speed. So the question: where can I tweak the camera movement/damping or even better, disable accelerating? Thanks in advance. PS: Windows mouse accelerating is disabled. Tweaking camera.angularSensibilityX/Y does'nt fix my problem You can test the effect with the mouse, move from left to right with slow sped and back with a higher speed using this playground the start and end position of the scene differs then.
  2. Hi all. I am trying to make a simple top-down, asteroids-like game, where movement is done through Phaser's arcade physics system. I find quite puzzling how angular movement works for it. I've followed a few tutorials, where I find the same issue. What is happening is, when my ship has an angle, thrusting or reversing is quite inconsistent. The ship appears to be "slipping" a bit in random directions, and does not always follow exactly the direction it's facing. The relevant create code is: player.body.maxVelocity.setTo(MAX_SPEED, MAX_SPEED); player.body.drag.setTo(DRAG, DRAG); whereas the relevant update code is: if (cursors.left.isDown) { player.body.angularVelocity = -ROTATION_SPEED; } else if (cursors.right.isDown) { player.body.angularVelocity = ROTATION_SPEED; } else { player.body.angularVelocity = 0; } if (cursors.up.isDown) { player.body.acceleration.x = Math.cos(player.rotation) * ACCELERATION; player.body.acceleration.y = Math.sin(player.rotation) * ACCELERATION; } else if (cursors.down.isDown) { player.body.acceleration.x = -Math.cos(player.rotation) * ACCELERATION; player.body.acceleration.y = -Math.sin(player.rotation) * ACCELERATION; } else { player.body.acceleration.setTo(0, 0); } I don't understand what could be causing this. Is the code just wrong (although I've seen this happening in all the tutorials)? Is it some rounding error? Am I just being crazy seeing this as wrong behavior? Is there any way to achieve the effect I am looking for (moving diagonally back and forth, on a straight line)? You can play around with this here as well.
  3. We have a character and a slope on which it costs. How to make that it slid on this slope, being accelerated?
  4. Hi everyone, I'm developing a side scrolling mobile game for fun in my spare time. The objective is to direct a flying bee, who moves continuously to the right, between sets of honeycombs. If the player touches the honeycombs, they lose. It's effectively a replica of flappy bird. I'm trying to implement an incremental increase in velocity so the game gets harder the longer you play. - I've created a group (honeycombs) and added physics to the group - Created 20 honeycombs - Got the first dead honeycomb of our group - Set the new position of the honeycomb - Added velocity to the honeycombs to make it move left (creates the illusion of the bee flying): pipe.body.velocity.x = -200; - Kill the honeycombs when they're no longer visible - Picked where the hole will be - Added six honeycombs - Run function to add honeycombs every 1.5 seconds I'm aware I could have two different game states (easy and hard) with different velocities but I'd rather have it increase over time. Any help would be hugely appreciated! Thanks!
  5. AccelerateToXY for a group

    Hello! Can anyone, please, explain how I can apply accelerateToXY method to the whole group of objects? Thank you in advance!
  6. The game involves no movable bodies, only a background sprite sheet. The background is animated. The animation plays at a constant speed if no buttons are down. I would like to have the animation accelerate constantly with the press of one button and decelerate with the press of another button. Once a button is let go, I would like the animation to decelerate or accelerate accordingly back to the initial constant speed. What is the best way to do this? Thanks P.S If this part is possible, I would like to then have the speed of the audio playing accordingly with the speed of the animation.
  7. Acceleration Tween

    (sorry moderators, another one like this has already posted before I'd finished writing!) Hi! I've just been getting into phaser over the last few days, and have come slightly unstuck attempting to make smooth player movement. For the most part phaser has the tools available in the physics system to achieve this (acceleration, drag) but I have been unable to make direction changes smooth. It works correctly if the player sprite travels just in one direction and then moves in the opposite direction, as the drag and acceleration handles the change correctly. However, if travelling diagonally (holding down W and A, applying both x and y acceleration), and then releasing one key, the change in direction happens instantly. What I'd like to achieve is some drag that happens during this change in velocity so that the player slides a little before fully changing direction. (I hope I've explained this correctly). I wanted to try achieving this by tweening the acceleration to 0 when a key is released. However, I cannot seem to be able to get the tween working correctly. I don't think I'm adding acceleration correctly to the tween manager - other tween examples I've seen have just needed to access the parameters of the sprite object, whereas this seems slightly more complex to me. TL;DR - does the below look correct? This is done in the create function //playergame.player = game.add.sprite(game.width/2, game.height/2, "player");game.player.anchor.setTo(0.5, 0.5); //player physicsgame.physics.startSystem(Phaser.Physics.ARCADE);game.physics.enable(game.player, Phaser.Physics.ARCADE);game.player.body.maxVelocity.setTo(playerMaxSpeed, playerMaxSpeed);game.player.body.drag.setTo(playerDrag, playerDrag);game.playerAccelerationTween = game.add.tween(game.player.body.acceleration); And this in the updateif (inputIsActive("W")) {game.player.body.acceleration.y = -playerAcceleration;} if (inputIsActive("S")) {game.player.body.acceleration.y = playerAcceleration;} if (inputIsActive("A")) {game.player.body.acceleration.x = -playerAcceleration;} if (inputIsActive("D")) {game.player.body.acceleration.x = playerAcceleration;} if (!inputIsActive("W") && !inputIsActive("S")) {{y: 0}, 2000, Phaser.Easing.Linear.None);} if (!inputIsActive("A") && !inputIsActive("D")) {{x: 0}, 2000, Phaser.Easing.Linear.None);} Apologies if this has been answered elsewhere or is easily available in the documentation, I'm quite new to coding in general and this stumped me. Thanks in advance!
  8. Hi all, Trying to make a P2 body accelerate (as opposed to using moveLeft) but am having a tough time, tried to use applyForce like this:[100,100], basket.x, basket.y);As well as this..[100,100], [basket.x, basket.y]);with no results. Anyone know what I'm doing wrong? I have tried changing the 100 to a number much larger as well as change gravityScale back to 1 (it is currently at 0). Thanks - Nick
  9. Hi, How can i play right with the acceleration of the velocity? In this tutorial (really well done), but it only change the velocity. How can i accelerate it the way a race game works? I want to accelerate it from 0 to a maximum number, or it's current value to a maximum number. How can i do this? What's the best way to handle it and create a maximum speed? Thank you very much guys