Would you be able to show me a small example on how to use _memget/memput
I need to speed up this a lot more with a faster way to print. its not slow and runs perfect but i want to start adding more stuff to this.
works perfect and boulders drop as should. like boulder dash.
ANIMATE:
_LIMIT 1000: FOR I% = 2 TO 19: FOR J% = 11 TO 2 STEP -1
COLOR 14, 0
B$ = MID$(MAP$(J%), I%, 1)
C$ = MID$(MAP$(J% - 1), I%, 1)
IF B$ = " " AND C$ = "O" THEN MID$(MAP$(J%), I%, 1) = "O": MID$(MAP$(J% - 1), I%, 1) = " ": SOUND INT(RND(1) * 400) + 1030, .03
IF B$ = " " AND C$ = "D" AND INT(RND(1) * 2) = 1 THEN MID$(MAP$(J%), I%, 1) = "D": MID$(MAP$(J% - 1), I%, 1) = " ": SOUND INT(RND(1) * 400) + 5030, .04
IF B$ = "v" AND C$ = "D" AND INT(RND(1) * 6) = 5 THEN MID$(MAP$(J%), I%, 1) = "D": MID$(MAP$(J% - 1), I%, 1) = " ": SOUND INT(RND(1) * 400) + 6030, .04
NEXT J%: NEXT I%
PRINTMAP:
FOR I% = 1 TO 20: FOR J% = 1 TO 12
B$ = MID$(MAP$(J%), I%, 1)
SELECT CASE B$
CASE "B"
COLOR BRICK%, BACK%: B$ = CHR$(178)
CASE "D"
COLOR DIAMOND%, FORG%: B$ = CHR$(4)
CASE "3"
COLOR BRICK%, BACK%
CASE " "
COLOR BACK%, FORG%: B$ = " "
CASE "."
COLOR DIRT%, FORG%: B$ = CHR$(176)
CASE "M"
COLOR MONSTER%, FORG%: B$ = CHR$(234)
CASE "m"
COLOR MONSTER%, FORG%: B$ = CHR$(232)
CASE "X"
COLOR BACK%, EXITDOOR%: B$ = CHR$(127)
CASE "O"
COLOR ROCK%, FORG%: B$ = "o"
CASE "v"
COLOR MAN%, FORG%: B$ = CHR$(2)
END SELECT
LOCATE J% + 2, I%: PRINT B$;
NEXT J%: NEXT I%
_DISPLAY
RETURN