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.

Newcomers DBPro Corner / Mouse controlled turning with acceleration.

Author
Message
Scarlek
21
Years of Service
User Offline
Joined: 26th Nov 2003
Location:
Posted: 27th May 2004 16:08
I thought I had this cracked with the attached code but alas, for some reason three of the turnspeed variables get set to 0.05 before I've even moved the mouse...

Can anyone see where I've gone wrong? It all looks ok, but I can't be sure..

The result is a minor drifting to the bottom left when ever mousemovex() and mousemovey() are 0.

- Creating Games even I would play -
Scarlek
21
Years of Service
User Offline
Joined: 26th Nov 2003
Location:
Posted: 27th May 2004 16:42
no worrys, I just figured it out myself... I was silly putting in the mousemovex() = 0 code...

It all works smoothly now...

*proud of his little bit of code.*

- Creating Games even I would play -
GameKit
21
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 27th May 2004 16:53 Edited at: 27th May 2004 16:54
The problem is your "mousemovex()=0" and "mousemovey()=0" code...
It tells the program to decrease the turn speed even when its already zero... try instead...

if mousemovex() = 0 and turnspeedydown# > 0
turnspeedydown# = turnspeedydown# - 0.005
endif

and the same for the "mousemovey()=0" code...

well... I hope I helped...

[Edit]
...lol...sorry, i didn't realize you had already figured it out...lol

Previously known as "Game_Creator".
The question is, why am I talking to myself? ...... And more importantly, why am I waiting for a reply?
Scarlek
21
Years of Service
User Offline
Joined: 26th Nov 2003
Location:
Posted: 27th May 2004 18:21
lol! Thanks man, I'm glad I beat ya to it though... means I'm getting better at this coding stuff.

The cool bit is, this is my first piece of code that's actually right! It works just as I intended it to.

- Creating Games even I would play -

Login to post a reply

Server time is: 2024-11-26 18:18:52
Your offset time is: 2024-11-26 18:18:52