Logic problem
StoopieSteve
Member Posts: 9
I have a game attribute for an object A with X velocity that is always changing depending on a key board input.
I have a separate object B that I am trying to precisely place on screen between two X points.
I want that object to move to X point a whenever velocity is increasing and X point b whenever velocity is decreasing.
I am trying to figure out the right condition for this event.
Does anyone know how to reference the change in velocity or distinguish between acceleration and deceleration?
This is pseudo code but its sort of what I am after:
If A.Xvelocity = A.Xvelocity++ then ease object B to X point a.
Or if A.Xvelocity = A.Xvelocity-- then ease object B to X point b.
Any thoughts?
I have a separate object B that I am trying to precisely place on screen between two X points.
I want that object to move to X point a whenever velocity is increasing and X point b whenever velocity is decreasing.
I am trying to figure out the right condition for this event.
Does anyone know how to reference the change in velocity or distinguish between acceleration and deceleration?
This is pseudo code but its sort of what I am after:
If A.Xvelocity = A.Xvelocity++ then ease object B to X point a.
Or if A.Xvelocity = A.Xvelocity-- then ease object B to X point b.
Any thoughts?
Comments
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
That makes perfect sense actually, I don't know why I did not think to constrain the position to the velocity...
My brain was sizzling last night and I knew it was something that simple.
Thanks again, your awesome!
So, thanks again, you rock!
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS