Now first off, I like to say that I'm a newbie so don't start howling with laughter if I don't know this
. Right now I'm messing around with sprites. I've already figured out how to move a sprite(with my brother's help)and cycle several sprite frames and all that junk, but what I'm trying to do right now is to stretch the sprite and then cycle them. Any help is welcome! Here's my code.
sync on
sync rate 40
Load bitmap "tankbrigade.bmp",1
rem regular tank sprite
get image 1,662,301,690,325
rem tank frame 1
get image 2,728,103,756,127
rem tank frame 2
get image 3,728,136,756,160
rem tank frame 3
get image 4,728,169,756,193
rem tank frame 4
get image 5,728,202,756,226
rem tank frame 5
get image 6,728,235,756,259
rem tank frame 6
get image 7,728,268,756,292
rem tank frame 7
get image 8,728,301,756,325
rem bullet sprite
get image 15,210,47,217,51
cls
sprite 1, 0, 0, 1
sprite 2, 0, 0, 2
sprite 3, 0, 0, 3
sprite 4, 0, 0, 4
sprite 5, 0, 0, 5
sprite 6, 0, 0, 6
sprite 7, 0, 0, 7
sprite 8, 0, 0, 8
stretch sprite 1,150,150
stretch sprite 2,150,150
stretch sprite 3,150,150
stretch sprite 4,150,150
stretch sprite 5,150,150
stretch sprite 6,150,150
stretch sprite 7,150,150
stretch sprite 8,150,150
false = 0
bulletalive = 1
tankx = 320
tanky = 240
theplayerhasshotthegun = 0
width = 320
counter = 1
maxcounter = 10
image = 8
do
inc counter
rem Bullet code
If rightkey() = 1 then width = width - 4
If leftkey() = 1 then width = width + 4
If spacekey() = 1 and theplayerhasshotthegun = 0
theplayerhasshotthegun = 1
bulletx = tankx + 13
bullety = tanky + 11
bulletalive = 1
show sprite 15
endif
If theplayerhasshotthegun = 1 and bulletalive = 1
bulletx = bulletx + 25
If bulletx > tankx + width
theplayerhasshotthegun = 0
bulletalive = 0
hide sprite 15
endif
endif
rem Tank moving section
If spacekey() = 0 and theplayerhasshotthegun = 0 and bulletalive = 0 then hide sprite 15
If rightkey() = 1 Then tankx = tankx + 4
If leftkey() = 1
tankx = tankx - 4
inc counter
If counter > maxcounter
counter = 1
image = image + 1
endif
If image > 8 then image = 1
endif
If downkey() = 1 then tanky = tanky + 4
If upkey() = 1 then tanky = tanky - 4
if tankx < 0 then tankx = 0
if tanky < 0 then tanky = 0
if tankx > 600 then tankx = 600
if tanky > 440 then tanky = 440
sprite 1,tankx,tanky,image
sprite 15,bulletx, bullety,15
sync
loop
And here's the bitmap I'm using
Bert is evil, Barney is evil, and the Pillsbury Doughboy is evil. I knew it from the start.