Jump to content

Search the Community

Showing results for tags 'drifting'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. The best example I've found of what I'm trying to achieve is this - http://schteppe.github.io/p2.js/demos/topDownVehicle.html However, instead of a car I have a tank, so the movement should be more... tankish, without this front-wheels-turning effect. But this is not a problem. The problem is that my tank's movement looks more like a boat on a water movement. I press UP for acceleration and when I press LEFT or RIGHT it still moves in the same direction for a while, like drifting. And if I release UP button and press LEFT or RIGHT again it drifts as well, without taking into account, that he has turned 90 degrees already. Looks awful in terms of a tank behaviour. In other words, I want my tank to stay "on track" while turning, without such huge drift (or asteroid in space) effect. I suppose this is something I should do in update section. Here is what I have there for now: if (cursors.left.isDown) {tank.body.angularVelocity = -0.75;} else if (cursors.right.isDown) {tank.body.angularVelocity = 0.75;} else {tank.body.setZeroRotation();} if (cursors.up.isDown) {tank.body.thrust(120);} else if (cursors.down.isDown) {tank.body.reverse(70);} else {tank.body.damping = 0.8;}cursors = game.input.keyboard.createCursorKeys(); And a few more, not related to main topic, questions: What kind of P2 library Phaser is using? Is it the same as in the example I've provided in the beginning? Is it technically possible in Phaser to calculate collision angle between shell and an object, e.g. another tank? Thank you.
×
×
  • Create New...