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.

DarkBASIC Professional Discussion / Rotation commands broken?

Author
Message
kino
15
Years of Service
User Offline
Joined: 2nd Feb 2011
Location:
Posted: 2nd Feb 2011 21:04
Usage of the compiler's commands is not producing the expected result, to wit:
(1) I use inkey$() to get a NUMBER KEY keypress and store the value in "aa" to select one of nine objects.
(2) then I use this in a sub to rotate the object about itself:
> if inkey$() = "}" then ROTATE OBJECT aa, 0, object angle y(1) +0.1,0
> if inkey$() = "{" then ROTATE OBJECT aa, 0, object angle y(1) -0.1,0

I see that the rotation is working ONLY for a SINGLE object-value, when aa = 1. Other values (2 to 9) produce a "jump" of a few degrees in the desired direction and then the object freezes.

Why? How can that be fixed so that all 9 objects can rotate?
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 2nd Feb 2011 21:06
You have 'object angle y(1)' in your code - did you mean to type 'object angle y(aa)' instead?

Login to post a reply

Server time is: 2026-07-18 02:39:03
Your offset time is: 2026-07-18 02:39:03