Rem Project: level 1
Rem Created: 7/5/2007 7:04:38 PM
Rem ***** Main Source File *****
autocam off
sync on
sync rate 0
hide mouse
rem building-----------------------------------------
make object plain 1,50,14 : position object 1,25,7,0
make object plain 3,40,14 : position object 3,20,7,10
make object plain 4,10,14 : position object 4,0,7,5 : yrotate object 4,90
make object plain 5,20,14
position object 5,50,7,10
yrotate object 5,90
make object plain 6,10,14
position object 6,40,7,15
yrotate object 6,90
make object plain 7,40,14
position object 7,20,7,20
make object plain 8,50,14
position object 8,0,7,45
yrotate object 8,90
make object plain 9,10,14
position object 9,55,7,20
make object plain 10,50,14
position object 10,60,7,45
yrotate object 10,90
make object plain 11,20,14
position object 11,40,7,80
yrotate object 11,90
make object plain 12,40,14
position object 12,20,7,70
make object box 13,20,14,10
position object 13,60,7,75
make object plain 14,60,14
position object 14,70,7,90
make object plain 15,70,14
position object 15,70,7,35
yrotate object 15,90
make object plain 16,30,14
position object 16,85,7,0
make object plain 17,90,14
position object 17,100,7,45
yrotate object 17,90
make object plain 18,100,100
position object 18,50,14,50
xrotate object 18,90
set camera range 1,100
rem player------------------------------------------------------
make object sphere 1000,5 : color object 1000, rgb(000,255,000) : position object 1000,5,3,5
rem enimy-------------------------------------------------------
make object sphere 2000,5 : position object 2000,25,3,45 : color object 2000, rgb(255,000,000)
make object plain 20000,100,100
xrotate object 20000,-90
position object 20000,50,0,50
rem bullet-----------------------------------------------------
MAKE OBJECT TRIANGLE 9999,0,0,0,0,0,0,0,0,0
make mesh from object 1,9999
delete object 9999
add limb 1000,1,1
offset limb 1000,1,0,0,1000
delete mesh 1
hide limb 1000,1
rem ammobox
MAKE OBJECT BOX 3000,1.5,3,5:COLOR OBJECT 3000,RGB(000,255,255):POSITION OBJECT 3000,85,0,75
make matrix 1,100,100,10,10
set matrix wireframe off 1
EnemyHP#=5000
Ammo#=1000
MaxAmmo#=1000
Clips#=3
MaxClips#=3
rem do do do do do do do-----------------
do
FPS#=SCREEN FPS()
TEXT 0,0,"FPS: "+STR$(FPS#)
rem fps camera
POSITION CAMERA OBJECT POSITION X(1000),OBJECT POSITION Y(1000),OBJECT POSITION Z(1000)
rem player controls
IF KEYSTATE(17)=1 THEN MOVE OBJECT 1000,.5
IF KEYSTATE(31)=1 THEN MOVE OBJECT 1000,-.5
IF KEYSTATE(30)=1 THEN MOVE OBJECT LEFT 1000,.3
IF KEYSTATE(32)=1 THEN MOVE OBJECT RIGHT 1000,.3
rem mouse control
CAMY#=CAMY#+MOUSEMOVEX()*.1
CAMX#=CAMX#+MOUSEMOVEY()*.1
IF CAMX#>90 AND CAMX#<135 THEN CAMX#=90
IF CAMX#>270 AND CAMX#<225 THEN CAMX#=90
YROTATE CAMERA CAMY#
XROTATE CAMERA CAMX#
YROTATE OBJECT 1000,CAMY#
XROTATE OBJECT 1000,CAMX#
rem jump-----------------------
IF SPACEKEY()=1 AND JUMPING#=0 THEN JUMP#=1
IF JUMP#=1
GROUND#=OBJECT POSITION Y(1000)
JUMP_SPEED#=.5
JUMPING#=1
JUMP#=0
ENDIF
iF JUMPING#=1
DEC JUMP_SPEED#,.001
POSITION OBJECT 1000,OBJECT POSITION X(1000),OBJECT POSITION Y(1000)+JUMP_SPEED#, OBJECT POSITION Z(1000)
IF OBJECT POSITION Y(1000)<=GROUND# THEN JUMPING#=0
ENDIF
rem shooting
IF keystate(19)=0 and MOUSECLICK()=1
IF Ammo#>0
DEC Ammo#,1
ENDIF
IF OBJECT EXIST(2000)=1
IF Ammo#>0
IF INTERSECT OBJECT (2000, LIMB POSITION X(1000,1), LIMB POSITION Y(1000,1), LIMB POSITION Z(1000,1), OBJECT POSITION X(1000),OBJECT POSITION Y(1000), OBJECT POSITION Z(1000))>0
DEC EnemyHP#,1
ENDIF
ENDIF
ENDIF
ENDIF
IF EnemyHP#=0
IF OBJECT EXIST(2000)=1
DELETE OBJECT 2000
ENDIF
ENDIF
IF OBJECT EXIST(2000)=1 then CENTER TEXT OBJECT SCREEN X(2000),OBJECT SCREEN Y(2000)-70,"Enemy Health: "+str$(EnemyHP#)
IF MOUSECLICK()=0 AND KEYSTATE(19)=1 AND Ammo#<MaxAmmo# AND Clips#>0 THEN Reload#=1
IF Reload#=1 THEN INC Time#,.001
IF Time#>=1 THEN Ammo#=MaxAmmo#:DEC Clips#,1:Time#=0:Reload#=0
IF Reload#=1 THEN CENTER TEXT SCREEN WIDTH()/2,SCREEN HEIGHT()/2,"Reloading..."
rem ammo crate
IF OBJECT EXIST(3000)=1
IF Ammo#<MaxAmmo# AND INTERSECT OBJECT (3000, OBJECT POSITION X(1000),OBJECT POSITION Y(1000)-50, OBJECT POSITION Z(1000), OBJECT POSITION X(1000),OBJECT POSITION Y(1000),OBJECT POSITION Z(1000))>0
Clips#=MaxClips#
Ammo#=MaxAmmo#
DELETE OBJECT 3000
ENDIF
ENDIF
TEXT 0,SCREEN HEIGHT()-50,"Ammo: "+str$(Ammo#)
TEXT 0,SCREEN HEIGHT()-40,"Clips: "+str$(Clips#)
CIRCLE SCREEN WIDTH()/2,SCREEN HEIGHT()/2,5
IF INTERSECT OBJECT (20000,X#,(Y#-OBJECT SIZE Y(1000)/2),Z#,X#,Y#,Z#)>0
MOVE OBJECT UP 1000,1
endif
sync
loop
Why Doesn't the collision for plain number 2