|
Alien
Jun 28, 2015 13:58:34 GMT -5
Post by PeterMaria on Jun 28, 2015 13:58:34 GMT -5
Hello, something from the Kindergarten. TextMode(TEXT_BUFFERED) ResizeSpriteArea(640,480)
Sub SprSetAnimate(nr(),x,y,w,h,frame) NewSprite(nr) SprSetxCentre(.5):SprSetyCentre(.5) SprSetSize(w,h) SprSetPos(x,y) SprSetFrame(frame) End Sub
dim h(0) = loadimageStrip("png/hop1.png",32) dim x(4),y(4),z(4),c(4),t(4),i x(0)=0 :y(0)=16 x(1)=40 :y(1)=16 x(2)=80 :y(2)=16 x(3)=120:y(3)=16
while ScankeyDown(27)=0 for i=0 to 3 if z(i)=0 then x(i)=x(i)+1 if x(i) >=620 then z(i)=1: end if end if next
for i=0 to 3 if z(i)=1 then y(i)=y(i)+1 t(i)=t(i)+1 if t(i)=40 then t(i)=0 z(i)=2 end if end if next
for i=0 to 3 if z(i)=2 then x(i)=x(i)+1*(-1) if x(i) <=20 then z(i)=3: end if end if next for i=0 to 3 if z(i)=3 then y(i)=y(i)+1 t(i)=t(i)+1 if t(i)=40 then t(i)=0 z(i)=0 end if if y(i)>=440 then z(i)=4: end if end if next
for i=0 to 3 if z(i)=4 then y(i)=y(i)-1 if y(i)=16 then z(i)=0 t(i)=0 end if end if next SprSetAnimate(h,x(0),y(0),32,32,0) SprSetAnimate(h,x(1),y(1),32,32,0) SprSetAnimate(h,x(2),y(2),32,32,0) SprSetAnimate(h,x(3),y(3),32,32,0) DrawText() waittimer(8) ClearSprites() wend Attachments:hop1.zip (1.76 KB)
|
|
|
Alien
Jun 29, 2015 9:03:49 GMT -5
Post by matthew on Jun 29, 2015 9:03:49 GMT -5
It reminds me of Space Invaders, Peter. ;-)
|
|