#constant CUBE_NUM 0
up_ang = 0.0;
left_ang = 0.0;
`********************************************************
function startup
`set some basic options
sync on;
sync rate 60;
set text size 16;
set display mode 640, 480, 32;
endfunction;
`********************************************************
function animate(left_pressed as boolean, up_pressed as boolean)
if left_pressed
left_ang = left_ang + 0.1;
text 16,16,"left pressed";
endif
if up_pressed
up_ang = up_ang + 0.1;
text 16,32,"up pressed";
endif
rotate object CUBE_NUM, left_ang, up_ang, 0.0;
endfunction;
`********************************************************
`main
left_key = 0;
up_key = 0;
startup();
make object cube CUBE_NUM, 100;
while not (escapekey())
left_key = LEFTKEY();
up_key = UPKEY();
animate(left_key,up_key);
sync;
endwhile
It compiles cleanly, but when run, it immediately exits. Can anyone point out what I might have done wrong here?
I already verified that my video card is capable of that mode, and the cube example works.