Gornova / MarteEngine

MarteEngine is a Java Engine for videogames
http://randomtower.blogspot.com
Other
74 stars 20 forks source link

Entity speed is a Vector2f #91

Closed Stef569 closed 12 years ago

Stef569 commented 12 years ago

The Vector2f class in org.newdawn.slick.geom is a Vector. Meaning it has a speed and a direction. See http://www.physicsclassroom.com/morehelp/vectdirn/practice.cfm

Entity.speed is not a Vector and thus should be changed to... a Point class? or dx, dy

thaaks commented 12 years ago

But a Vector2f is very helpful because you can normalize it (used in some places), scale it, add and subtract other vectors. You're right, basically speed would be just two values, speedx and speedy. But as I mentioned, it does make sense to use a Vector2f for speed. Maybe the name doesn't match it properly because the speed somewhat contains direction and speed.

Stef569 commented 12 years ago

ok, I'm very new to Vectors and the Vector2f class. If you need it it must stay. I only use speed.x and speed.y