This project has moved and is read-only. For the latest updates, please go here.

Calc speed you object?

Topics: User Forum
Oct 29, 2006 at 1:29 PM
Im making a game using this engine, and need to move the "map" with the same speed as my "spaceship", så how do i know how fast the spaceship is moving?.. i know there is a LinearVelocity, but thats just gives a very high float value?
Oct 29, 2006 at 1:30 PM
Calc speed OF object?

Oct 29, 2006 at 11:23 PM
Linear velocity is what you want. The demos that came with the first release of my engine are using pixels as units. Probably not the best units to use, but they map well to srites and I didn't want to confuse things by setting up my own unit conversions (10 pixels = a meter for instance)

Anyway, the number being returned in "LinearVelocity" is in pixels per second. You should be able to use this to move your map accordingly as long at you either move your map using pixel amounts, or you convert pixels returned from LinearVelocity to your units.

Another option, and the way I would recoment is you decide on some units (like I mentioned above) and you use those with the physics engine and for moving your map.

The Farseer Physics engine does not specify units. You can use what ever units you want as long as they are consitent accross the simulation.

hope that helps

btw, what kind of game are you making?
Oct 30, 2006 at 6:34 PM
The game im making is called "Motherload", it's a flash game. Its kinda hard to make using your engine, because i have to build up the ground piece for piece as a collision object. Im on something about only having the surrounding objects in the sim. It's really hard to find a good solution. Could i send you my souce code, so you could take a look, for now its pretty simple. Maybe you had a good surgestion :)
Oct 31, 2006 at 1:48 AM
It's a flash game that uses a c# physics engine?

I don't have any flash dev tools so I don't know how much help I'll be with the code. How about posting whatever code snippet is causing problems here and I will take a look.
Nov 2, 2006 at 5:44 PM
No, the ORIGINALE game is flash.. hmm, hard to really pick some code out and says here is the problem :/
Nov 3, 2006 at 4:57 AM
Oh, I see.

Well if have something you can send to me that will show your problem I can take a quick look.

Send it to and put something in the subject so I can find it easily.