Jump to content

Search the Community

Showing results for tags 'sprite acceleration'.

  • 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. Hi, I want to have a sprite (laser) decelerate from its original position (cannon) to its destination (current pointer position on click). I tried negative values with accelerateToPointer : game.physics.accelerateToPointer(laser, this.game.input.activePointer, -600, 100, 100);but the behavior isn't the one I expected since the sprite goes immediatly backward. So I tried to play with body.acceleration instead : laser.body.velocity.x = 500;laser.body.velocity.y = 500;laser.body.acceleration.x = -500;laser.body.acceleration.y = -500;The behavior is far more better (the sprite slows down til a certain point, but then goes backward), but I couldn't find how to set the minVelocity for the sprite to decelerate. Whether I use body.maxVelocity or nothing, it finally goes backward (negative speed, I guess). Is there a way to set this minVelocity for negative accelerations or need I just to test by myself the velocity in the update loop ?
×
×
  • Create New...