FlixelCommunity / flixel

Community fork of Adam “Atomic” Saltsman's popular game engine Flixel. Distilled from a variety of Flash games he worked on over the last couple years, including Gravity Hook, Fathom and Canabalt, its primary function is to provide some useful base classes that you can extend to make your own game objects.
http://flixelcommunity.org/
Other
84 stars 17 forks source link

Add math vector methods to FlxPoint (or create FlxVector) #188

Open Dovyski opened 10 years ago

Dovyski commented 10 years ago

Currently FlxPoint has one or two methods that can be used in math vector calculations. It's pretty hard to implement vector dependent functionalities using Flixel, such as steering behaviors. Useful methods such as rotate(), normalize(), perp(), dot(), cross(), etc are missing.

It would be great to have them. If they "clutter" the API, the FlxVector class could be created.

Gama11 commented 10 years ago

Feel free to borrow some code from HaxeFlixel's FlxVector. :)

Dovyski commented 10 years ago

Consider it done! :) There are even more methods than I could thing of. Thanks!

IQAndreas commented 10 years ago

I added FlxVector to the FlxMath spreadsheet to make things easier to organize: