Coder#05, on your advice I came up with this, problem is I don't know how to pass a variable from the Shoot function back to the main loop so that I can reset nShoot back to 0 once the right condition is met.
sync rate 50
sync on
make object cube 1,5
position camera 0,0,-100
do
REM text 1,1,STR$(scancode())
select scancode()
case 200
move object up 1,1
endcase
case 203
move object left 1,1
endcase
case 205
move object right 1,1
endcase
case 208
move object down 1,1
endcase
case 57
nShoot = 1
endcase
endselect
if nShoot
gosub Shoot
endif
sync
loop
Shoot:
if object exist(1) = 0
make object cube 2,1
ObjPosX# = object position x(1) + 1
ObjPosY# = object position y(1)
ObjPosZ# = object position z(1) + 1
position object 2, ObjPosX#,ObjPosY#,ObjPosZ#
endif
ObjPosX# = object position x(2) + 1
ObjPosY# = object position y(2)
ObjPosZ# = object position z(2) + 1
position object 2, ObjPosX#,ObjPosY#,ObjPosZ#
if ObjPosX# > 50.0 or ObjPosZ# > 50.0
nShoot = 0
endif
return
All that happens atm is the game crashes when you attempt to shoot and tells me the object does not exist on this line:
ObjPosX# = object position x(2) + 1
It's driving me nuts, especially since my posts are only going out an average of every 6 hours, it's taking me a day just to get one answer to a problem, I know that this is neccesary, but I just wanted to vent my stress
Regards
§çà®Fãçë™