Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Leonard
21
Years of Service
User Offline
Joined: 14th Jan 2003
Location:
Posted: 15th Apr 2003 03:58
i was working on a pong-type game but i was told it would be a bit to complicated for a beginner. so i am now trying to write a space invaders type game. but when i shoot the enemy ship it dissapeares, but when ever i shoot a bullet in that area the explosion sprite becomes visible for a second. i tried deleting the enemy ships sprite but then when i shoot it it just dissapeares for a second. what should i do?
here's my code:

rem ship variables
xpos=0
ypos=200


rem bullet variables
bxpos=42
bypos=178

rem alien variables
axpos=100
aypos=0


rem load images
load image "ship.bmp",1
load image "bullet.bmp",2
load image "stars.bmp",3
load image "baddie.bmp",4
load image "fireball.bmp",5




do



rem set up screen
sync on
sync rate 0
hide mouse

rem ship sprite
sprite 1,xpos,ypos,1
scale sprite 1,35

rem bullet sprite
sprite 2,bxpos,bypos,2
scale sprite 2,12
hide sprite 2

rem alien sprite
sprite 3,axpos,aypos,4
scale sprite 3,25

rem explode sprite
sprite 4,axpos,aypos,5
scale sprite 4,45
hide sprite 4

rem movement
if upkey()=1 then dec ypos,3: dec bypos,3
if downkey()=1 then inc ypos,3: inc bypos,3
if leftkey()=1 then dec xpos,3: dec bxpos,3
if rightkey()=1 then inc xpos,3: inc bxpos,3



rem shooting
if spacekey()=1 then show sprite 2: dec bypos,30

rem new bullet
if bypos
"Thou hast only to follow the wall far enough and there will de a door in it."
Leonard
21
Years of Service
User Offline
Joined: 14th Jan 2003
Location:
Posted: 15th Apr 2003 04:00
?

i was working on a pong-type game but i was told it would be a bit to complicated for a beginner. so i am now trying to write a space invaders type game. but when i shoot the enemy ship it dissapeares, but when ever i shoot a bullet in that area the explosion sprite becomes visible for a second. i tried deleting the enemy ships sprite but then when i shoot it it just dissapeares for a second. what should i do?
here's my code:

rem ship variables
xpos=0
ypos=200


rem bullet variables
bxpos=42
bypos=178

rem alien variables
axpos=100
aypos=0


rem load images
load image "ship.bmp",1
load image "bullet.bmp",2
load image "stars.bmp",3
load image "baddie.bmp",4
load image "fireball.bmp",5




do



rem set up screen
sync on
sync rate 0
hide mouse

rem ship sprite
sprite 1,xpos,ypos,1
scale sprite 1,35

rem bullet sprite
sprite 2,bxpos,bypos,2
scale sprite 2,12
hide sprite 2

rem alien sprite
sprite 3,axpos,aypos,4
scale sprite 3,25

rem explode sprite
sprite 4,axpos,aypos,5
scale sprite 4,45
hide sprite 4

rem movement
if upkey()=1 then dec ypos,3: dec bypos,3
if downkey()=1 then inc ypos,3: inc bypos,3
if leftkey()=1 then dec xpos,3: dec bxpos,3
if rightkey()=1 then inc xpos,3: inc bxpos,3



rem shooting
if spacekey()=1 then show sprite 2: dec bypos,30

rem new bullet
if bypos < 0 then bypos=sprite y(1)


rem bullet/alien collision
if sprite hit(2,3)
hide sprite 3: show sprite 4: wait 10: hide sprite 4
endif



cls
loop



(also, how can i get the enemy ship to move back and forth across the screen?)

"Thou hast only to follow the wall far enough and there will de a door in it."

Login to post a reply

Server time is: 2024-11-24 11:02:36
Your offset time is: 2024-11-24 11:02:36