Anyways as the title says, I'm making a simple dodging game where the camera is behind the player, and you have to move left and right to dodge the incoming cubes. I have some of the code already done, but as the title indicated, I need help with the random factor.
Go ahead and test the code to see what it's like.
`Title Screen
set text size 38
set text font "Courier New"
ink rgb (0,255,0),0
set cursor 50,50:print " Zaibatsu Games Presents"
set text size 40
set cursor 190,100:print "Dodging Game"
set text size 25
set cursor 140,425:print "Press Any Key to Continue"
wait key
`Settings
set display mode 800,600,32
hide mouse
`Objects
make object box 1,.7,2,.7:position object 1,-.5,0,0
make object box 2,1.7,.2,.2:position object 2, 5,-.9,-1.5:color object 2, rgb (255,0,0)
`Collision Settings
set object collision on 1:set object collision to boxes 1
set object collision on 2:set object collision to boxes 2
`Camera
position camera -2.7,0,0:point camera 0,0,0
`Main Loop
do
`move obstacle
move object left 2, obsxval# +.0007
`Controls
if leftkey()=1 then move object 1, objectxpos#+.001
if rightkey()=1 then move object 1, objectxpos#-.001
`Collision Affects
if object collision(1,2)=1 then exit
loop
I want those red boxes to come towards the player like that in random positions in 1,5 second time intervals.
can someone please help me with this? keep in mind I don't want someone to just do it and leave, I want them to explain it so I can do stuff like it in later, better, more complicated projects.
Thank you in advance,
Brett Snow.
"I admire its purity, a survivor, unclouded by conscience, remorse, or delusions of morality"