Hehe spent a lot of time on this one but having a lot of trouble scoured the forums for hours and tried many a thing, The attached sprite is 2 by 4 grid of 32 x 32 pixels, shouldnt this make the Sprite run from frame 1 to 8 when the enemy is shot?
Rem Project: 2dshooter
Rem Created: 25/11/2008 16:35:14
Rem ***** Main Source File *****
GoSub Setup
GoSub Player
Spry = Sprite Y(1)
Sprx = Sprite X(1)
Bulletfired = 0
Enemyx = Sprite X(3)
Enemyy = Sprite Y(3)
Do
If Upkey() = 1 Then Dec Spry,4
If Downkey() = 1 Then Inc Spry,4
If Rightkey() = 1 Then Inc Sprx,4
If Leftkey() = 1 Then Dec Sprx,4
Sprite 1,Sprx,Spry,1
If BulletFired = 0
If Spacekey() = 1 Then GoSub StartBullet
Else
GoSub MoveBullet
EndIf
If Sprite Collision (2,3)
Hide Sprite 2
Hide Sprite 3
Play Sprite 4,1,8,3
EndIf
Sync
Loop
StartBullet:
If Spacekey() = 1
Spry2 = Spry
Sprx2 = Sprx + 35
Show Sprite 2
Sprite 2,Sprx2,Spry2,2
BulletFired = 1
EndIf
Return
MoveBullet:
Dec Spry2,6
Sprite 2,Sprx2,Spry2,2
If Spry2 < 5
Hide Sprite 2
BulletFired = 0
EndIf
Return
Player:
Load Image "sprites/Plyr1.bmp",1
Sprite 1,450,600,1
Size Sprite 1,90,138
Set Sprite Priority 1,3
Load Image "sprites/Bullet.bmp",2
Sprite 2,100,100,2
Set Sprite Priority 2,1
Hide Sprite 2
Load Image "sprites/Enemy.bmp",3
Sprite 3,600,300,3
Set Sprite Priority 3,2
Create Animated Sprite 4,"sprites/explosion.bmp",2,4,4
Set Sprite Priority 4,4
Return
Setup:
Sync on
Sync rate 60
Set Display Mode 1024,768,16
Set Image Colorkey 255,0,255
Return
Appreciate any help this ones been tickling my brain since last night now lol!
Solved this now thanks forgot the Sprite 4,Enemyx,Enemyy,4 command
!
"Face it, if crime didnt pay there would be very few criminals."
Laughton Lewis Burdock