okay, i am starting to make a small 3d shoot em up game. I had my ship, my smoke particles flying out the back, my muzzle flash, my bullets, but when i went in to try and add some text saying "HEALTH" the speed of the game dropped dramaticly. why does this happen, and can any one help me fix it please?
code :
REM Project: Boom
REM Created: 6/3/2007 3:54:28 PM
REM
REM ***** Main Source File *****
REM
global s as word
global ft as word
load image "glowdot.bmp",1
load image "interface.bmp",2
load sound "Blaster.wav",1
load sound "jet loop.wav",2
sync on; sync rate 400
hide mouse
make camera 1
position camera 1,200,.5,-2
turn camera left 1,90
roll camera left 1,270
color backdrop 1,rgb(0,0,0)
load object "Fighter.X",1
rotate object 1,0,0,0
scale object 1,10,10,10
position object 1,0,0,-100
plrtrail()
plrmuzzle()
make light 2;color light 2,255,105,0
s=2
loop sound 2;set sound volume 2,80
do
ft=ft+1
color particles 1,255,105,0
set particle life 1,rnd(50)
position particle emissions 2,50000,0,0
position light 1,500000,500000,500000
if ft=<10
position particle emissions 2,object position x(1),object position y(1)-16,object position z(1)-3
position light 1,object position x(1),object position y(1)-19,object position z(1)-3
endif
sprite 1,0,0,2;set sprite alpha 1,100;set sprite diffuse 1,255,255,255`stretch sprite 1,200,90
set text font "Comic Sans MS"
set text size 30
text 50,50,"HEALTH:"+str$(plrh)
if object exist(2);pshot1();endif
if object exist(3);pshot2();endif
if object exist(4);pshot3();endif
if object exist(5);pshot4();endif
if object exist(6);pshot5();endif
if object exist(7);pshot6();endif
if object exist(8);pshot7();endif
if object exist(9);pshot8();endif
if object exist(1)
plredgedetection()
playercontrols()
endif
position particle emissions 1,object position x(1),object position y(1)+26,object position z(1)
position light 2,object position x(1),object position y(1)+40,object position z(1)
sync
loop
function pshot1()
move object down 2,1
if object position y(2)=<-170;delete object 2;endif
endfunction
function pshot2()
move object down 3,1
if object position y(3)=<-170;delete object 3;endif
endfunction
function pshot3()
move object down 4,1
if object position y(4)=<-170;delete object 4;endif
endfunction
function pshot4()
move object down 5,1
if object position y(5)=<-170;delete object 5;endif
endfunction
function pshot5()
move object down 6,1
if object position y(6)=<-170;delete object 6;endif
endfunction
function pshot6()
move object down 7,1
if object position y(7)=<-170;delete object 7;endif
endfunction
function pshot7()
move object down 8,1
if object position y(8)=-1000;delete object 8;endif
endfunction
function pshot8()
move object down 9,1
if object position y(9)=-1000;delete object 9;endif
endfunction
function plrtrail()
make particles 1,1,22345,4
position particle emissions 1,0,0,0
set particle velocity 1,100
set particle life 1,20
set particle floor 1,0
color particles 1,255,155,0
set particle gravity 1,-30
endfunction
function plrmuzzle()
make particles 2,1,2000,5
set particle chaos 2,100
set particle floor 2,0
set particle life 2,2
color particles 2,255,110,60
set particle velocity 2,-35
set particle gravity 2,350
make light 1
color light 1,255,100,60
position light 1,object position x(1),object position y(1)-16,object position z(1)-3
endfunction
function plredgedetection()
if object position y(1)=<-140;position object 1,object position x(1),-140,object position z(1);endif
if object position y(1)=>140;position object 1,object position x(1),140,object position z(1);endif
if object position z(1)=<-115;position object 1,object position x(1),object position y(1),-115;endif
if object position z(1)=>115;position object 1,object position x(1),object position y(1),115;endif
endfunction
function playercontrols
if keystate(17);position object 1,object position x(1),object position y(1),object position z(1)+.3;endif
if keystate(31);position object 1,object position x(1),object position y(1),object position z(1)-.3;endif
if keystate(30);position object 1,object position x(1),object position y(1)+.3,object position z(1);endif
if keystate(32);position object 1,object position x(1),object position y(1)-.3,object position z(1);endif
if ft=>50;if mouseclick()=1;play sound 1;plrfire();ft=0;endif;endif
endfunction
function plrfire()
if s=>8:s=2;endif
position particle emissions 2,object position x(1),object position y(1)-16,object position z(1)-3
make object sphere s,1
scale object s,200,500,200
color object s,rgb(255,155,1)
position object s,object position x(1),object position y(1)-16,object position z(1)-3
s=s+1
endfunction