Nothing fancy, but if anyone wanted to make an asteroid game and needs some images, I whipped these up in studio max. Each asteroid has 16 frames of animation. There are 3 different sizes and textures.
Also threw together some AppGameKit code (main reason I posted this here) demonstrating how to load animations spread across individual files. Press the spacebar to break the asteroids up into smaller chunks.
Download 12.8MB
setVirtualResolution(640,480)
showAsteroids = 1
rangeStart = 1
type Asteroid
sprite as integer
x as float
y as float
vx as float
vy as float
endtype
large = createAsteroid("large\c1")
setSpritePositionByOffset(large, 320, 240)
dim asteroids[9] as Asteroid
asteroids[1].sprite = createAsteroid("medium\a1") : setSpriteVisible(asteroids[1].sprite, 0)
asteroids[2].sprite = createAsteroid("medium\c1") : setSpriteVisible(asteroids[2].sprite, 0)
asteroids[3].sprite = createAsteroid("medium\d1") : setSpriteVisible(asteroids[3].sprite, 0)
asteroids[4].sprite = createAsteroid("small\a1") : setSpriteVisible(asteroids[4].sprite, 0)
asteroids[5].sprite = createAsteroid("small\b1") : setSpriteVisible(asteroids[5].sprite, 0)
asteroids[6].sprite = cloneSprite(asteroids[4].sprite)
asteroids[7].sprite = cloneSprite(asteroids[5].sprite)
asteroids[8].sprite = cloneSprite(asteroids[4].sprite)
asteroids[9].sprite = cloneSprite(asteroids[5].sprite)
do
if getRawKeyPressed(32)
if showAsteroids = 1
setSpriteVisible(large, 0)
for i = 1 to 3
setSpriteVisible(asteroids[i].sprite, 1)
asteroids[i].x = 320+random(0,100)-50
asteroids[i].y = 240+random(0,100)-50
setSpritePositionByOffset(asteroids[i].sprite, asteroids[i].x, asteroids[i].y)
a = random(0,360)
spd# = random(10,30) / 10.0
asteroids[i].vx = cos(a)*spd#
asteroids[i].vy = sin(a)*spd#
next i
rangeStart = 1
rangeEnd = 3
showAsteroids = 2
elseif showAsteroids = 2
setSpriteVisible(asteroids[1].sprite, 0)
setSpriteVisible(asteroids[2].sprite, 0)
setSpriteVisible(asteroids[3].sprite, 0)
j = 0
for i = 4 to 9 step 2
inc j
setSpriteVisible(asteroids[i].sprite, 1)
setSpriteVisible(asteroids[i+1].sprite, 1)
asteroids[i].x = asteroids[j].x+random(0,60)-30
asteroids[i].y = asteroids[j].y+random(0,60)-30
asteroids[i+1].x = asteroids[j].x+random(0,60)-30
asteroids[i+1].y = asteroids[j].y+random(0,60)-30
setSpritePositionByOffset(asteroids[i].sprite, asteroids[i].x, asteroids[i].y)
setSpritePositionByOffset(asteroids[i+1].sprite, asteroids[i].x, asteroids[i].y)
a = random(0,360)
spd# = random(10,30) / 10.0
a2 = random(0,360)
spd2# = random(10,30) / 10.0
asteroids[i].vx = cos(a)*spd#
asteroids[i].vy = sin(a)*spd#
asteroids[i+1].vx = cos(a2)*spd2#
asteroids[i+1].vy = sin(a2)*spd2#
next i
rangeStart = 4
rangeEnd = 9
showAsteroids = 3
endif
endif
for i = rangeStart to rangeEnd
asteroids[i].x = asteroids[i].x + asteroids[i].vx
asteroids[i].y = asteroids[i].y + asteroids[i].vy
if asteroids[i].x < -50 then asteroids[i].x = 690
if asteroids[i].x > 690 then asteroids[i].x = -50
if asteroids[i].y < -50 then asteroids[i].y = 530
if asteroids[i].y > 530 then asteroids[i].y = -50
setSpritePositionByOffset(asteroids[i].sprite, asteroids[i].x, asteroids[i].y)
next i
sync()
loop
function pad$(n)
t$ = str(n)
if n < 10 then t$ = "0"+t$
endfunction t$
function createAsteroid(f$)
img = loadImage(f$+"0000.png")
a = createSprite(img)
setSpriteOffset(a, getImageWidth(img)/2, getImageHeight(img)/2)
for i = 1 to 15
addSpriteAnimationFrame(a, loadImage(f$+"00"+pad$(i)+".png"))
next i
playSprite(a,10,1,1,16)
endfunction a