your code:
rem Spinning Box, this is my first program and hopefully a tutorial for all you noobs out there
rem intiation
sync on : sync rate 100
backdrop off : hide mouse
rem load music
musicsnd=1 : load sound "mediasoundsmusic.wav", musicsnd
loop sound musicsnd : set sound volume musicsnd, 70
rem load models
Boxobj = 2 : load object "mediamodelsBox.3ds", Boxobj
rem setup camera
autocam on
rem setup models
set object boxobj,2,0,0,0,0,0,0
scale object boxobj,5,5,5
do
rem functions
if rightkey ()=2 then YROTATE OBJECT 1,OBJECT ANGLE Y(1) +0.1
if leftkey ()=2 then yrotate object 1, object angle y (1) -0.1
if upkey ()=2 then xROTATE OBJECT 1,OBJECT ANGLE x(1)+0.1
if downkey ()=2 then xROTATE OBJECT 1,OBJECT ANGLE x(1)-0.1
loop
issue 1:
you've loaded the box as object 2 (Boxobj = 2) but when you try to rotate it, you're using the x and y angles of object 1 (there is no object 1). make sure you're rotating Boxobj and basing the rotation on the x/y angles of Boxobj.
issue 2:
up/down/left/right-key() will never = 2.
read the help file for (any of) those commands. the fix is simple (and the help file is only 1 sentence long).
issue 3:
you've set
sync on which means you have to call
sync to refresh the screen. add
sync to the bottom of your do/loop.
issue 4:
you've scaled the object to 5% of normal. as it stands (and with the
set object parameters you've set), you'll have a hard time seeing the box rotate.
summary:
1) proof-read your code & double-check variables. you would have noticed the object 1/2 confusion.
2) take the time (it only takes a second) to review the help files for each command; you're setting yourself up for a lot of frustration otherwise.
3) please don't offer a 'tutorial for noobs' until you have a grasp of the commands yourself. we all appreciate the help we find on the forums, and i know it is your intention to provide just that, but it's "3 steps backward" for anyone reading a tutorial with mis-information. i've done it myself and it's not a good feeling when you've lead someone astray/caused additional confusion.
4) spending 4 hours on 20 lines of code means you've probably racked your brain pretty hard. it's a good habit to step away from your code and get some fresh air regularly; you might have caught some of mistakes with a fresher mind
good luck
ps: the box object and the camera are adequate enough to produce the results you appear to be shooting for.
Virtual Nomad
AMD XP 1800+ (~1.6 Ghz) / 1.5 GB RAM
ATI Radeon 8700LE 128 MB / Windows XP