I am soooo happy. I managed to do it. I cant believe it was sooo simple.
Here it just so you know what i wanted. The games gonna be a multiplayer one coz i cant be arsed with AI. Loads of people want to make an elite clone and so i thought why not make a version without a y axis. its a lot simpler. i'm gonna cross it with star control, i hope its gonna work.please post any ideas for my game coz i wanna make it a good on.
gosub startup
gosub makearrays
make object plain 1,25,25
xrotate object 1,90
fix object pivot 1
position object 1,0,0,0
load image "ship.bmp",2
texture object 1,2
set object 1,1,1,1
fade object 1,200
load image "plasma2.bmp",3
make particles 1,3,5,10
set particle gravity 1,0
set particle floor 1,0
set particle life 1,15
set particle velocity 1,0
color particles 1,0,0,250
do
camera()
gosub movement
set cursor 0,0 : print screen fps()
sync
loop
startup:
sync on
sync rate 0
autocam off
set display mode 1024,768,16
`set camera view 50,0,1023,767
color backdrop 0
make matrix 1,1000,1000,10,10
load image "nebula.bmp",1
prepare matrix texture 1,1,1,1
ghost matrix on 1
position matrix 1,0,-10,0
return
makearrays:
return
movement:
px#=object position x(1)
pz#=object position z(1)
if upkey()=1
thrust#=2
x#=curvevalue(x#,sx#,1.01)
z#=curvevalue(z#,sz#,1.01)
else
thrust#=0
if downkey()=1
x#=curvevalue(x#,sx#,1.01)
z#=curvevalue(z#,sz#,1.01)
endif
endif
if leftkey()=1 then yang#=wrapvalue(yang#-2)
if rightkey()=1 then yang#=wrapvalue(yang#+2)
yrotate object 1,yang#
sx#=newxvalue(0,yang#,thrust#)
sz#=newzvalue(0,yang#,thrust#)
position object 1,px#+x#,0,pz#+z#
partx#=newxvalue(x#,wrapvalue(yang#+180),13)
partz#=newzvalue(z#,wrapvalue(yang#+180),13)
position particle emissions 1,partx#/10,0,partz#/10
rem the above /10 on the x and z positions is due to a problem with the positioning of particles
rem to get the right position you have to divide the wanted position by the particle radius.
return
function camera()
x#=object position x(1)
z#=object position z(1)
position camera x#,200,z#
point camera x#,0,z#
endfunction
He who keeps his work in disorder gives home to chaos. Let him be struck with stone and iron to forge away his flaws