Flixel Power Tools FlxVelocity
Back to the Flixel Power Tools
A class to help with setting and using the velocity of FlxSprites. With this you can move one sprite towards another, move a sprite towards the mouse, get distances between sprites / mouse and get angles between sprites and the mouse.
It doesn’t sound very exciting (and it’s not to look at) but they can start to save you real time, and keep your code tidy and clean.
Currently supports the following methods:
- moveTowardsObject
- accelerateTowardsObject
- moveTowardsMouse
- accelerateTowardsMouse
- moveTowardsPoint
- accelerateTowardsPoint
- distanceBetween
- distanceToPoint
- distanceToMouse
- angleBetweenPoint
- angleBetween
- velocityFromAngle
- angleBetweenMouse
Screen Shot
Code Example
// Move the blue ball towards green at a speed of 180 pixels per second
FlxVelocity.moveTowardsObject(blue, green, 180);
Recent Flixel Power Tool Posts
- Flixel Power Tools v1.9 Released
- Flixel Power Tools v1.8 Released - Let's get clicky
- Flixel Power Tools v1.7 - Kaboom!
- Flixel Power Tools v1.6 released including FlxControl
- Flixel Power Tools v1.5 - A monster of an update!
- FlxScreenGrab and FlxScrollZone added to Flixel Power Tools
- Flixel Power Tools v1.3 - Now Flixel 2.5 compatible!
- FlxHealthBar added to Flixel Power Tools
Make yourself heard
FPT Classes
Hire Us
All about Photon Storm and our
HTML5 game development services
Recent Posts
OurGames
Filter our Content
- ActionScript3
- Art
- Cool Links
- Demoscene
- Flash Game Dev Tips
- Game Development
- Gaming
- Geek Shopping
- HTML5
- In the Media
- Phaser
- Phaser 3
- Projects
Brain Food