hey
I need help. I need to know how you can make a DATA statement move around the screen when the player presses a button (IE wasd)
Also I need help stopping the players character from crashing into walls, (and making the walls dissaper)
If you can answer this it will be a great help
thnxs
jetq111
New Programmer needs help w/ moving graphics by player
-
- Veteran
- Posts: 288
- Joined: Sat Feb 18, 2006 4:02 pm
Code: Select all
' Nixon posted this over a year ago.
DIM map(100, 100)
FOR y = 1 TO 5
FOR x = 1 TO 5
READ map(x, y)
LOCATE y, x
IF map(x, y) = 1 THEN PRINT CHR$(219)
NEXT: NEXT
px = 2
py = 2
top:
LOCATE py, px: PRINT CHR$(2)
DO: P$ = INKEY$: LOOP UNTIL P$ <> ""
LOCATE py, px: PRINT " "
IF P$ = "8" AND map(px, py - 1) = 0 THEN py = py - 1
IF P$ = "5" AND map(px, py + 1) = 0 THEN py = py + 1
IF P$ = "4" AND map(px - 1, py) = 0 THEN px = px - 1
IF P$ = "6" AND map(px + 1, py) = 0 THEN px = px + 1
GOTO top
DATA 1,1,1,1,1
DATA 1,0,0,0,1
DATA 1,0,1,0,1
DATA 1,0,0,0,1
DATA 1,1,1,1,1