Hi!
I am trying to make a little stradegy game in which the point is to set up a beach head so that you can stop the advancing enemy. Right now I am trying to get the basics done, which are the positioning of objects, and then the arrival of the first wave of troops, here is the code so far.....
rem Init display
randomize timer()
set display mode 1024,768,32
sync on
sync rate 60
autocam off
Set camera range 1,10000
position mouse screen width()/2, screen height()/2
backdrop on
color backdrop rgb(0,0,0)
dim selection(0)
dim player(0)
dim timeleft(0)
selection(0)=0
player(0)=1
timeleft(0)=600
rem the new mouse object to play with
make object cube 20,10
position object 20,-100,0,-100
set object collision to polygons 20
color object 20,RGB(0,0,150)
ghost object on 20
hide object 20
rem the new mouse object(s) to play with
for t=1 to 5
make object cube t,10
position object t,100+rnd(50),0,100+rnd(50)
set object collision to polygons t
color object t,RGB(0,0,150)
next t
`make enemy
for e=6 to 15
make object cube e, 4
position object e,100+rnd(60),0,-100+rnd(60)
color object e,RGB(255,0,0)
set object collision to boxes e
next e
`make landmines
for k=16 to 25
make object cube k, 2
position object k, 100+rnd(60),0,70+rnd(60)
set object collision to boxes k
color object k, RGB(15,67,10)
next k
position camera -100,100,-100
xrotate camera 90
position camera 100,300,0
do
`Landmine collision with enemy
for e=6 to 15
if object collision (e,0)=1
hide object e
endif
next e
rem print timer
set cursor 0,0
print "Player ",player(0)," Has ",timeleft(0)," Time Left "
if timeleft(0)=>0
gosub selection
endif
selection:
rem the new object selection code
if object screen x(20)=<mousex()
position object 20,object position x(20)+4,object position y(20),object position z(20)
endif
if object screen x(20)=>mousex()
position object 20,object position x(20)-4,object position y(20),object position z(20)
endif
if object screen y(20)=<mousey()
position object 20,object position x(20),object position y(20),object position z(20)-4
endif
if object screen y(20)=>mousey()
position object 20,object position x(20),object position y(20),object position z(20)+4
endif
if player(0)=1
rem the select bit (replace with distance equation) Player 1
if mouseclick()=1
for t=1 to 5
if object position x(20)=<object position x(t)+10
if object position x(20)=>object position x(t)-10
if object position y(20)=<object position y(t)+10
if object position y(20)=>object position y(t)-10
if object position z(20)=<object position z(t)+10
if object position z(20)=>object position z(t)-10
if selection(0)=0
position object t,object position x(20),object position y(20),object position z(20)
selection(0)=1
endif
endif
endif
endif
endif
endif
endif
next t
endif
selection(0)=0
endif
return
timeleft(0)=timeleft(0)-1
if timeleft(0)=<0
if player(0)=1
center text 500,400, "WAVE 1 INBOUND!"
set cursor 10,10
print "press enter to continue"
timeleft(0)=0
sync
endif
endif
gosub wave
sync
loop
wave:
for e=6 to 15
move object e,.1
next e
return
now there are a few bothersome things about the code that I just dont know how to fix, the first being that after the timer is up it just flashes like crazy, I want it to stop flashing utill I press the enter key, then it should dissapear completely along witht the words "wave 1 inbound!".
Next, Is that after the timer reaches 0 you should no longer be able to move the objects around, which you can still do.
and finally, I have made a landmine object (a cube right now), but the point is that, if the enemy object collides with the landmine object it should die (or in this basic setup, just dissapear), I tried some object collision stuff but keep getting an unrecognized paremter, its in my code just look at the landmine collision part.
Well thats all for now, but I will probably post more questions later in this thread as to now clog up the forum

.
Thanks and I look forward to these answers!
P4 3.2Ghz/Alienware area 51/radeon 9800 pro 256mb/sound blaster audigy 2/5.1 surround sound speakers.