Well, we all have to start somewhere. I'm making a very basic game, you're a ball, and I'm trying to make it a bigger ball when you roll over this cube. But, obviously, it doesn't work.
Rem Initialize everything.
sync on:sync rate 100
make matrix 1,5000,5000,150,150
update matrix 1
make object sphere 1,0.5
make object cube 2,5
hide mouse
autocam off
position object 1,2500,10,2500
position object 2,2500,10,2600
Do
gosub _move_ball
gosub _enlarge_ball
Print "Object Position: X: "; oldposx#;", Y: ";oldposy#;", Z: ";oldposz#
Loop
_move_ball:
Rem Sets variables so they're easier to use
px1#=object position x(1)
py1#=object position y(1)
pz1#=object position z(1)
ay1#=object angle y(1)
Rem Makes the camera follow the ball
set camera to follow px1#,py1#-3,pz1#,ay1#,5,5,1,1
Rem Move the ball
if upkey()=1 then move object 1,0.5
if downkey()=1 then move object 1,-0.5
if leftkey()=1 then rotate object 1,0,(ay1#)-1,0
if rightkey()=1 then rotate object 1,0,(ay1#)+1,0
sync
return
_enlarge_ball:
Rem Get the ball's co-ordinates
oldposx# = object position x(1)
oldposy# = object position y(1)
oldposz# = object position z(1)
Rem If the ball goes here, a new ball is made
If object position x(1) = object position x(2) and object position y(1) = object position y(2) and object position z(1) = object position z(2)
Delete object 1
make object sphere 1,10
position object 1,oldposx#,oldposy#,oldposz#
Endif
return
Well, that's my "code". If anyone could look over it and give me a tip, if there's an easier way to do it, tell me how to make the existing code actually work, that'd be nice ^_^. If this post isn't clear enough, I'll try to make it better.
Thanks in advance.
P4 3.4ghz, 512mb DDR2 533mhz RAM, GeForce 6800 GTO 256mb Graphics Card, Sound Blaster Audigy 2. Win.