thhis draws one complete FRAME with 8x Frame Animated Blocks (8 x frames per cycle) very pretty when running. have demo version but not willing to share CODE as Still Writting game. but Superfast and fully animated. Including music and sound. will upload Linux64 bit bin it requested. (demo only)
All rocks-diamonds fall as per frame cycle so its cool to see them slide down off each other. the trick is to read the screen from bottom right to top left. move pieces down (not up) so the screen draws on cycle (frame) before re looping so full animation is achieved. which i have all graphics animated, rock and diamonds falling, monsters moving all in under one frame. up to 40 of each monster and entire screen is moved and calcuated in one frame.
I have six on timers running. looking at running another to achieve the door flash when you can exit... the butterflys and fireflys where harddest to program. but they run very fast. 40 of each so 80 in total. yet on my pc there is speed loss. keyboard also runs on a on timer so i fixed the problem of the key repeat being to fast. i call fps on a timer also so i can have more time available for maths. works sweet (run beautiful program the whole thing on timers)
FPS: CLS: FOR I% = 1 TO 40: FOR J% = 1 TO 22: B% = SCREENMEM%(J%, I%): SELECT CASE B%
CASE WALL: PUT (I% * 8 - 1, J% * 16 - 16), WALL(): CASE SPACE: PUT (I% * 8 - 1, J% * 16 - 16), SPACE()
CASE DIRT: PUT (I% * 8 - 1, J% * 16 - 16), DIRT(): CASE MAN: PUT (I% * 8 - 1, J% * 16 - 16), PLAYER()
CASE BOULDER: PUT (I% * 8 - 1, J% * 16 - 16), BOULDER(): CASE BOULDERF: PUT (I% * 8 - 1, J% * 16 - 16), BOULDER()
CASE BRICK: PUT (I% * 8 - 1, J% * 16 - 16), BRICK(): CASE EXITLEVEL: IF COLLECTED% >= TOCOLLECT% THEN PUT (I% * 8 - 1, J% * 16 - 16), REXIT(): REXIT% = 1 ELSE PUT (I% * 8 - 1, J% * 16 - 16), WALL()
CASE PICKUPKEY: PUT (I% * 8 - 1, J% * 16 - 16), PICKUPKEY()
CASE DOORCLOSE: PUT (I% * 8 - 1, J% * 16 - 16), DOORCLOSE()
CASE DOOROPEN: PUT (I% * 8 - 1, J% * 16 - 16), DOOROPEN()
END SELECT: SELECT CASE ANIMATION%
CASE 1
IF B% = DIAMOND THEN PUT (I% * 8 - 1, J% * 16 - 16), DIAMOND1()
IF B% = FUNGUS THEN PUT (I% * 8 - 1, J% * 16 - 16), FUNGUS1()
IF B% = FLUTTERFLY THEN PUT (I% * 8 - 1, J% * 16 - 16), FLUTTER1()
IF B% = BOXER THEN PUT (I% * 8 - 1, J% * 16 - 16), BOXER1()
IF B% = EXPLODEA THEN PUT (I% * 8 - 1, J% * 16 - 16), BOOM1()
IF B% = EXPLODEB THEN PUT (I% * 8 - 1, J% * 16 - 16), BOOM1(): _SNDPLAY BOOMSOUND
IF B% = MAJIC THEN PUT (I% * 8 - 1, J% * 16 - 16), MAJIC1()
IF B% = MAJICROCKROCK THEN PUT (I% * 8 - 1, J% * 16 - 16), MAJIC1()
CASE 2
IF B% = DIAMOND THEN PUT (I% * 8 - 1, J% * 16 - 16), DIAMOND2()
IF B% = FUNGUS THEN PUT (I% * 8 - 1, J% * 16 - 16), FUNGUS2()
IF B% = FLUTTERFLY THEN PUT (I% * 8 - 1, J% * 16 - 16), FLUTTER2()
IF B% = BOXER THEN PUT (I% * 8 - 1, J% * 16 - 16), BOXER2()
IF B% = EXPLODEA THEN PUT (I% * 8 - 1, J% * 16 - 16), BOOM1()
IF B% = EXPLODEB THEN PUT (I% * 8 - 1, J% * 16 - 16), BOOM1()
IF B% = MAJIC THEN PUT (I% * 8 - 1, J% * 16 - 16), MAJIC2()
IF B% = MAJICROCK THEN PUT (I% * 8 - 1, J% * 16 - 16), MAJIC2()
CASE 3
IF B% = DIAMOND THEN PUT (I% * 8 - 1, J% * 16 - 16), DIAMOND3()
IF B% = FUNGUS THEN PUT (I% * 8 - 1, J% * 16 - 16), FUNGUS3()
IF B% = FLUTTERFLY THEN PUT (I% * 8 - 1, J% * 16 - 16), FLUTTER3()
IF B% = BOXER THEN PUT (I% * 8 - 1, J% * 16 - 16), BOXER3()
IF B% = EXPLODEA THEN PUT (I% * 8 - 1, J% * 16 - 16), BOOM2()
IF B% = EXPLODEB THEN PUT (I% * 8 - 1, J% * 16 - 16), BOOM2()
IF B% = MAJIC THEN PUT (I% * 8 - 1, J% * 16 - 16), MAJIC3()
IF B% = MAJICROCK THEN PUT (I% * 8 - 1, J% * 16 - 16), MAJIC3()
CASE 4
IF B% = DIAMOND THEN PUT (I% * 8 - 1, J% * 16 - 16), DIAMOND4()
IF B% = FUNGUS THEN PUT (I% * 8 - 1, J% * 16 - 16), FUNGUS4()
IF B% = FLUTTERFLY THEN PUT (I% * 8 - 1, J% * 16 - 16), FLUTTER4()
IF B% = BOXER THEN PUT (I% * 8 - 1, J% * 16 - 16), BOXER4()
IF B% = EXPLODEA THEN PUT (I% * 8 - 1, J% * 16 - 16), BOOM3()
IF B% = EXPLODEB THEN PUT (I% * 8 - 1, J% * 16 - 16), BOOM3()
IF B% = MAJIC THEN PUT (I% * 8 - 1, J% * 16 - 16), MAJIC4()
IF B% = MAJICROCK THEN PUT (I% * 8 - 1, J% * 16 - 16), MAJIC4()
CASE 5
IF B% = DIAMOND THEN PUT (I% * 8 - 1, J% * 16 - 16), DIAMOND5()
IF B% = FUNGUS THEN PUT (I% * 8 - 1, J% * 16 - 16), FUNGUS4()
IF B% = FLUTTERFLY THEN PUT (I% * 8 - 1, J% * 16 - 16), FLUTTER5()
IF B% = BOXER THEN PUT (I% * 8 - 1, J% * 16 - 16), BOXER5()
IF B% = EXPLODEA THEN PUT (I% * 8 - 1, J% * 16 - 16), BOOM3()
IF B% = EXPLODEB THEN PUT (I% * 8 - 1, J% * 16 - 16), BOOM3()
IF B% = MAJIC THEN PUT (I% * 8 - 1, J% * 16 - 16), MAJIC5()
IF B% = MAJICROCK THEN PUT (I% * 8 - 1, J% * 16 - 16), MAJIC5()
CASE 6
IF B% = DIAMOND THEN PUT (I% * 8 - 1, J% * 16 - 16), DIAMOND6()
IF B% = FUNGUS THEN PUT (I% * 8 - 1, J% * 16 - 16), FUNGUS6()
IF B% = FLUTTERFLY THEN PUT (I% * 8 - 1, J% * 16 - 16), FLUTTER6()
IF B% = BOXER THEN PUT (I% * 8 - 1, J% * 16 - 16), BOXER6()
IF B% = EXPLODEA THEN PUT (I% * 8 - 1, J% * 16 - 16), BOOM2()
IF B% = EXPLODEB THEN PUT (I% * 8 - 1, J% * 16 - 16), BOOM2()
IF B% = MAJIC THEN PUT (I% * 8 - 1, J% * 16 - 16), MAJIC6()
IF B% = MAJICROCK THEN PUT (I% * 8 - 1, J% * 16 - 16), MAJIC6()
CASE 7
IF B% = DIAMOND THEN PUT (I% * 8 - 1, J% * 16 - 16), DIAMOND7()
IF B% = FUNGUS THEN PUT (I% * 8 - 1, J% * 16 - 16), FUNGUS7()
IF B% = FLUTTERFLY THEN PUT (I% * 8 - 1, J% * 16 - 16), FLUTTER7()
IF B% = BOXER THEN PUT (I% * 8 - 1, J% * 16 - 16), BOXER7()
IF B% = EXPLODEA THEN PUT (I% * 8 - 1, J% * 16 - 16), BOOM1()
IF B% = EXPLODEB THEN PUT (I% * 8 - 1, J% * 16 - 16), BOOM1()
IF B% = MAJIC THEN PUT (I% * 8 - 1, J% * 16 - 16), MAJIC7()
IF B% = MAJICROCK THEN PUT (I% * 8 - 1, J% * 16 - 16), MAJIC7()
CASE 8
IF B% = DIAMOND THEN PUT (I% * 8 - 1, J% * 16 - 16), DIAMOND8()
IF B% = FUNGUS THEN PUT (I% * 8 - 1, J% * 16 - 16), FUNGUS8()
IF B% = FLUTTERFLY THEN PUT (I% * 8 - 1, J% * 16 - 16), FLUTTER8()
IF B% = BOXER THEN PUT (I% * 8 - 1, J% * 16 - 16), BOXER8()
IF B% = EXPLODEA THEN PUT (I% * 8 - 1, J% * 16 - 16), DIAMOND1(): SCREENMEM%(J%, I%) = DIAMOND
IF B% = EXPLODEB THEN PUT (I% * 8 - 1, J% * 16 - 16), SPACE(): SCREENMEM%(J%, I%) = SPACE
IF B% = MAJIC THEN PUT (I% * 8 - 1, J% * 16 - 16), MAJIC8()
IF B% = MAJICROCK THEN PUT (I% * 8 - 1, J% * 16 - 16), MAJIC8()
IF MANDIED% = 1 THEN MANDIED% = -1
END SELECT: NEXT J%: NEXT I%: COLOR 34: LOCATE 23, 1: PRINT "CAVE - "; LEVEL; " SCORE - "; SCORE%: PRINT " LIVES - "; LIVES; " TIMER:"; MAJICCOUNT%;: LOCATE 1, 1: _DISPLAY: RETURN
TIMER1 = ANIMATION SPEED (ANIMATION = ANIMATION + 1) IF > 8 ANIMATION = 0 : TIMER SPEED IS .06 so i call this .06 times every 8 FPS call
TIMER2 = FPS (MAIN CALLER FOR FRAMES PER SECOND) SET TO .03 (=SMOOTH AND ANIMATED X 8 DIFERENT FRAMES PER SPRITE)
TIMER3 = KEYBOARD ROUTINE
TIMER4 = ROCKS AND DIAMONDS FALL ROUTINE
TIMER5 = BUTTERFLY MOVEMENT AI
TIMER6 = FIREFLY MOVEMENT AI
TIMER7 = AMOEBAE TIMER (RUNS FOR SEC COUNT)
TIMER8 = MAJIC TILES (DROP ROCK THROUGH AND RECEIVE A DIAMOND). ALSO DISABLE WHEN OUT OF TIME.
TIMER9 = LEVEL LENGTH COMPLETE
TIMER10 = FLASH EXIT WHEN GOT ENOUGH DIAMONDS