Hi. Im making simple 2D asteroid shooter.
I want the bulletsprite to go from my spaceship slowly forward so i can see it all the time until it hits the righ wall.
Here's my source code:
sync on: sync rate 0
set text opaque
MyX# = 1
MyY# = 1
xx# = ShotX# + 65
yy# = ShotY# + 14
joo# = 0.1
noob = 0
backdrop on
color backdrop rgb(0,0,0)
load image "fighter1.bmp",1
load sound "raygun-01.wav",50
load image "laser.bmp",97
load image "SideScroll_Bkg01.bmp",96
sprite 96,1,358,96
CREATE ANIMATED SPRITE 99, "Explosion64.bmp", 16, 1, 2
create animated sprite 98, "Asteroids7siy.png", 8, 1, 3
do
xx# = ShotX# + 65
yy# = ShotY# + 14
ShotX# = MyX#
ShotY# = MyY#
sprite 1,MyX#,MyY#,1
sprite 97,xx#,yy#,97
hide sprite 97
XPos#=sprite x(97)
YPos#=sprite y(97)
play sprite 98, 1, 8, 150 `ASTEROIDI
sprite 98, 120,120,3
PLAY SPRITE 99, 1, 16, 100 `RÄJÄHDYS
sprite 99,200,200,2
if upkey() = 1 and MyY# > 1
inc MyY#,-joo#
rem move sprite 1,0.07
endif
if downkey() = 1 and MyY# < 449
dec MyY#,-joo#
rem move sprite 1,-0.07
endif
if spacekey() = 1 then show sprite 97: play sound 50: sprite 97,XPos#,YPos#,97
sync
loop
I will really appreciate yout help thanks.