Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / 2D Sprite Movement Problem

Author
Message
Karna
14
Years of Service
User Offline
Joined: 22nd Jan 2010
Location: American Left Coast
Posted: 4th Apr 2010 03:19
I have been working on a simple game inspired by the old classic "Space War" a 2D top-down battle game where two ships attack each other (multi-player simulated on one keyborad.)

It is coming along well except the movement is not ideal. The goal is this: a ship drifts in the direction and speed in which it was moving unless the player applies acceleration (i.e. Newton's First Law) causing a change in heading and velocity.

I am trying to use vector-type math so(not true "vector data types" but same values anyway) so that if force is applied in direct opposition to the drift, the drift will slow down. I think that my code is annotated clearly:

The results are unpredictable. The ship does not mantain its heading or velocity correctly.

Can someone please tell me why this does not work?
Thanks!

Login to post a reply

Server time is: 2024-10-02 03:30:40
Your offset time is: 2024-10-02 03:30:40