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.

The 20 Line Challenge / Screen Saver - Like Rotating Cube

Author
Message
10JACK7
6
Years of Service
User Offline
Joined: 3rd Aug 2011
Location:
Posted: 4th Aug 2011 00:17 Edited at: 4th Aug 2011 17:58
This is a code, in 16 total lines, to create a rotating cube. As it rotates, the colors change with the rotation. Rotation control keys are the arrow keys and the w and s keys. The d key turns on a "random"
feature - the cube goes to a random position and color. In addition, the background is inverted (I think it is inverted - please confirm if I am right or wrong, and if I am wrong, please give the code and/or equation to do it.)

Here is the code:
29 games
12
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 4th Aug 2011 02:01 Edited at: 4th Aug 2011 02:02
I couldn't get the up, right and s keys to work.

What you have to be cafeful of is that when stacking code you really need to use the "if... endif" method rather than the "if... then" method.

Using the "if... then : if... then" method means that if the first if statment is false, it ignores the whole line, even after the colons.

So this:



Should be done like this:



That way both the upkey and downkey controls work.
10JACK7
6
Years of Service
User Offline
Joined: 3rd Aug 2011
Location:
Posted: 4th Aug 2011 02:07
Thanks. I actually noticed this right after I sent it, after I cooled down my computer, which had been glitching up because of overheating. I will fix this very soon. Thank you!

Login to post a reply

Server time is: 2018-06-25 18:06:11
Your offset time is: 2018-06-25 18:06:11