Working with Angular Velocity

Psycho RomeoPsycho Romeo Member Posts: 1
edited December 2012 in Working with GS (Mac)
New to GS here.

I am trying to make a space ship game that uses some realistic space physics. The problem I'm having is with Angular Velocity. I did some research and there appears to be a bug with Angular Velocity, in that whenever that attribute is called, it returns the degrees per frame instead of the degrees per second.

Here is what I want to happen:
The player presses A, and the ship's rotation speed will begin accelerating in a counter clockwise direction.

The way that I thought I'd do that is to rotate counterclockwise at self.motion.angularVelocity+30 when A is down. If I understand how it works correctly, this should add 30 to the rotation speed every frame until the A key is released, effectively acceleration. I would do the same with the D key, but with clockwise instead. I believe this would simulate turning momentum. There would also be a max rotation speed constraint somewhere.

However, since self.motion.angularVelocity isn't returning correct values, this doesn't work.

What I need is some kind of work around. If there's a way to call the frames per second of the game, maybe that could be used to 'convert' the angular velocity from per frame to per second.

Anyone have any ideas?



One of the things I noticed was that the angular velocity was returning the correct value while the value was changing. You can notice this by using an interpolate behavior while displaying the angular velocity. Would it be feasible to constantly +1 and -1 to its value to pull a correct number?

Answers

  • sparkaniasparkania Member, PRO Posts: 300
    could you re-state your question. I'm confused on what you are trying to make your actor actually do. (forget the fps work around for a second)
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited December 2012
    Yeah you're definatly over thinking this. Just define what you want to happen.
  • SocksSocks London, UK.Member Posts: 12,822
    Got to agree with the others here too, you can over think these things, basically you want something to turn and for that turning to get faster with time ?

    Personally I'd just lock the speed of rotation to the time the button is held.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Plus this is not a bug as a game's speed works based on it's FPS as this has to do with the rate the code can recognize changes in variables. FPS in games is not the same as video frame rates. So if a games FPS was based on processor clock things would go out of sync as the FPS can vary widely.
Sign In or Register to comment.