Post by plus on Jul 22, 2024 15:59:23 GMT
Again section is supposed to build walls = # up randomly around character = O
Even character O is not erased in first line of [mover]
And yet I can move curser but not character right into maze wall???
b = b + ...
Even character O is not erased in first line of [mover]
And yet I can move curser but not character right into maze wall???
' Simple Game Update bplus 2024-07-17 trans to JB 2024-07-22
Dim maze(14, 12) 'this is our game board
For x = 1 To 14 ' marks board borders and draws them
y = 1
maze(x, y) = 1
Locate x, y: Print "#";
y = 12
maze(x, y) = 1
Locate x, y: Print "#";
Next
For y = 2 To 11
x = 1
maze(x, y) = 1
Locate x, y: Print "#";
x = 14
maze(x, y) = 1
Locate x, y: Print "#";
Next
x = Int(Rnd * 7) + 3 ' set a random place to start
y = Int(Rnd * 5) + 3
While 1
Locate 2, 15: Print "score: "; S ' udate score and player
Locate x, y
Print "O";
If maze(x, y) = 1 Then
Locate x, y: Print "*";
Locate 1, 18: Print "Wall! Game Over!"
End
End If
If maze(x + 1, y) = 1 Then ' is there a place to move
If maze(x - 1, y) = 1 Then
If maze(x, y + 1) = 1 Then
If maze(x, y - 1) = 1 Then
Locate 1, 18: Print "Trapped! Game Over!": End
End If
End If
End If
End If
k$ = input$(1)
Select Case k$
Case "w": dry = -1
Case "s": dry = 1
Case "a": drx = -1
Case "d": drx = 1
Case "q": End
End Select
If drx <> 0 Or dry <> 0 Then GoSub [mover]
Wend
[mover]
Locate x, y: Print " ";
x = x + drx
y = y + dry
drx = 0
dry = 0
[Again]
notice "made it to tryAgain" '' ??? WTH never get here
newx = x + Int(Rnd(0) * 3) - 1
newy = y + Int(Rnd(0) * 3) - 1
If newy = y And newx = x Then GoTo [Again]
If maze(newx, newy) = 1 Then GoTo [Again]
maze(newx, newy) = 1
Locate newx, newy: Print "#"; ' mark new block
S = S + 1 ' increase score
Return
b = b + ...