Can't someone out there figure it out? Can't someone please have a look and see what's going on with it?
This has really got me stuck, is it possible that the overlapping of all the transparent sprites is causing it? Someone must have some idea...
-Dave
REM --------------------------------------------------------------------------
rem Project: Spaceman
Rem Created: 8/17/2003 10:34:09 PM
REM A Pimpin' Fox Creation
REM Coded by DivW aka. The Soul Bearer, Big D, Nappyboy, all sorts of weird crap
REM With lots of help from the blokes on the DBP Forums...
REM --------------------------------------------------------------------------
REM set display mode 800,600,16
Set Display Mode 800,600,16
REM --------------------------------------------------------------------------
REM **** Variable And Array List and Functions ****
REMSTART
REM --------------------------------------------------------------------------
REMEND
REM Quick Loading Thing...
REM --------------------------------------------------------------------------
REM **CORE OF THE PROGRAM**
REM --------------------------------------------------------------------------
gosub setup
goto Mainloop
REM --------------------------------------------------------------------------
REM **SUBROUTINE SETUP: LOADS ALL IMPORTANT INFORMATION**
REM --------------------------------------------------------------------------
setup:
REM Setup Basics
Sync rate 60
hide mouse
REM Load Images
Load Image "Ship.png",1
Load Image "Baddie.png",2
Load Image "Bullet1.png",500
Load Image "SpaceBG.png",501
REM Sets up Variables
BY1#=Rnd(370+50)
BX1#=900
X#=50
y#=400
dim bulletposx#(30)
dim BulletPosy#(30)
dim bulletnumber(30)
for i = 0 to 30
bulletnumber(i)=0
next i
Dim BX#(100)
Dim BY#(100)
BADX#1=0
BADX#2=0
BADX#3=0
BADX#4=0
REM ENDS LOAD CODE
Return
REM ---------------------------------------------------------------------
REM Main loop from here onwards
REM ---------------------------------------------------------------------
REM STARTS MAIN LOOP
mainloop:
REM Sets up Player's Sprite
Set Sprite 201,1,1
REM Sets the value for things only to be run once in the code.
Q=0
Sync ON
Badguynumber=0
REM --------------------------------------------------------------------------
REM **MAIN LOOP BEGINS**
REM --------------------------------------------------------------------------
Sync on
Do
REM SETS SPRITE 1'S POSITION
Sprite 201,X#,Y#,1
REM Links to the backgroundmovement
gosub Backgroundmovement
REM Returns...
REM Movement Keys
If Downkey()=1 and Y# < 540 then Inc Y#,5
If Upkey()=1 and y# > 30 then Dec Y#,5
If RightKey()=1 and x# < 600 then Inc x#,5
If Leftkey()=1 and x# > 30 then Dec x#,2.5
REM Bad Guy Creation...long and complicated it is...
REM Currently removed
REM End of Bad Guy creation
REM This links to the bad guy movement Algorithm.
Numbers1=1
Numbers2=100
Movement1(Numbers1,Numbers2)
REM Test Rapid Fire
If ControlKey()=1
Firemode=1
Else
Firemode=0
EndIf
REM Shooting Function, this large block of code should handle all the shooting. It can be eassily turned into
REM function once it has been perfected, although perhaps functioning it earlier will be a good idea for time
REM efficiency.
FOR i=1 to 30
t=i+500
IF spacekey()=1
REM Normal Fire Bullet Delay
IF Firemode=0
IF (timer()-bulletTime) > 200
IF bulletnumber(i)=0
bulletnumber(i)=1
bulletposx#(i)=x#+35
bulletposy#(i)=y#+10
BulletTime = timer()
ENDIF
ENDIF
ENDIF
REM Rapid Fire Bullet Delay
IF Firemode=1
IF (timer()-bulletTime) > 100
IF bulletnumber(i)=0
bulletnumber(i)=1
bulletposx#(i)=x#+35
bulletposy#(i)=y#+10
BulletTime = timer()
ENDIF
ENDIF
ENDIF
ENDIF
REM Normal Shooting
IF Firemode = 0
IF bulletnumber(i)>0
bulletposx#(i) = bulletposx#(i)+8
sprite (t),bulletposx#(i),bulletposy#(i),500
ENDIF
ENDIF
REM Rapid Fire
IF Firemode = 1
IF bulletnumber(i)>0
bulletposx#(i) = bulletposx#(i) + 12
sprite (t),bulletposx#(i),bulletposy#(i),500
ENDIF
ENDIF
REM Deletes Offscreen bullets
IF Bulletposx#(i)>=800
Delete Sprite (t)
bulletnumber(i)=0
ENDIF
NEXT i
REM This block of code should handle Collisions...
For BadGuyCounter = 1 to 100
If sprite exist(Badguycounter)
REM Player/Badguy Collision Algorithm
If sprite exist(BadGuyCounter)
If Sprite collision(201,BadguyNumber)
Inc Gameovers
Delete Sprite BadGuyCounter
EndIf
EndIf
REM Bullet/BadGuy Collision Algorithm
For i = 500 to 530
If Sprite exist(i)
If Sprite collision(Badguycounter,i)
Delete Sprite i
Delete Sprite BadguyCounter
Score=Score+100
Exit
EndIf
EndIf
Next i
EndIf
Next Badguycounter
REM Types some variables so u know wtf's going on...
CLS
Set Cursor 0,0
print "Frame Rate : ";Screen FPS()
print "Firemode : ";firemode
print "Amount of Times You should be dead : ";GameOvers
print "Score : ";Score
print "Bad Guy Number : ";BadguyNumber
Print "Number Of Baddies : ";NumberofBaddies
a=0
For i = 1 to 30
If bulletnumber(i)>0 then inc a
Next i
Print "Number of bullets on screen right now: ";a
Sync
REM Game Over Variables
Loop
REM --------------------------------------------------------------------------
REM End of the main loop
REM --------------------------------------------------------------------------
REM This cuts the program here
End
REM --------------------------------------------------------------------------
REM ---------------------From here on it is all functions---------------------
REM --------------------------------------------------------------------------
REM --------------------------------------------------------------------------
REM This is a function for basic bad guy movement.
REM --------------------------------------------------------------------------
Function Movement1(Numbers1,Numbers2)
For BadGuyCounter = Numbers1 to Numbers2
If Sprite Exist(BadGuyCounter)
BX#(BadGuyCounter)=BX#(BadGuyCounter) - 3
Sprite BadguyCounter,BX#(BadGuyCounter),BY#(BadGuyCounter),2
If BX#(BadGuyCounter) < -50 then Delete Sprite BadGuyCounter
EndIF
Next BadGuyCounter
Endfunction
REM --------------------------------------------------------------------------
REM --------------------------------------------------------------------------
REM This is a function for Moving the background.
REM --------------------------------------------------------------------------
backgroundmovement:
Sprite 531,BADX#1,0,501
Sprite 532,(BADX#1+800),0,501
REMSTART
Sprite 533,BADX#2,0,501
Sprite 534,(BADX#2+800),0,501
Sprite 535,BADX#3,0,501
Sprite 536,(BADX#3+800),0,501
Sprite 537,BADX#4,0,501
Sprite 538,(BADX#4+800),0,501
REMEND
If Q = 0
Set Sprite 533,1,1
Set Sprite 534,1,1
Set Sprite 535,1,1
Set Sprite 536,1,1
Set Sprite 537,1,1
Set Sprite 538,1,1
Q=1
EndIf
Dec BadX#1,1
Dec BadX#2,5
Dec BadX#3,10
Dec BadX#4,15
If BadX#1=-800 then BadX#1=0
If BadX#2=-800 then BadX#2=0
If BadX#3=-800 then BadX#3=0
If BadX#4=-800 then BadX#4=0
Return
REM --------------------------------------------------------------------------
Your soul...it tastes like chicken

Official Website Coming Soon