Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trapping two keys
#15
"I liked the "simple" version better"
Code: (Select All)
_Title "Use arrow keys to move our hero."
heroX = 40: heroY = 12 ' middle
Do
    Cls
    Locate heroY, heroX: Print Chr$(1);
    If _KeyDown(19200) Then heroX = heroX - 1
    If _KeyDown(19712) Then heroX = heroX + 1
    If _KeyDown(18432) Then heroY = heroY - 1
    If _KeyDown(20480) Then heroY = heroY + 1
    If heroX < 1 Then heroX = 1
    If heroX > _Width Then heroX = _Width
    If heroY < 1 Then heroY = 1
    If heroY > _Height Then heroY = _Height
    _Limit 10
Loop
b = b + ...
Reply


Messages In This Thread
Trapping two keys - by PhilOfPerth - 10-01-2022, 01:52 AM
RE: Trapping two keys - by bplus - 10-01-2022, 01:59 AM
RE: Trapping two keys - by PhilOfPerth - 10-01-2022, 02:08 AM
RE: Trapping two keys - by bplus - 10-01-2022, 02:26 AM
RE: Trapping two keys - by Pete - 10-01-2022, 02:38 AM
RE: Trapping two keys - by PhilOfPerth - 10-01-2022, 08:05 AM
RE: Trapping two keys - by Pete - 10-01-2022, 01:07 PM
RE: Trapping two keys - by bplus - 10-01-2022, 03:33 PM
RE: Trapping two keys - by Pete - 10-01-2022, 04:19 PM
RE: Trapping two keys - by PhilOfPerth - 10-01-2022, 11:24 PM
RE: Trapping two keys - by PhilOfPerth - 10-02-2022, 12:04 AM
RE: Trapping two keys - by bplus - 10-02-2022, 01:41 AM
RE: Trapping two keys - by Pete - 10-02-2022, 02:00 AM
RE: Trapping two keys - by PhilOfPerth - 10-02-2022, 02:34 AM
RE: Trapping two keys - by bplus - 10-02-2022, 05:20 PM
RE: Trapping two keys - by mnrvovrfc - 10-02-2022, 07:51 PM
RE: Trapping two keys - by Pete - 10-02-2022, 05:51 PM
RE: Trapping two keys - by James D Jarvis - 10-02-2022, 07:56 PM
RE: Trapping two keys - by bplus - 10-02-2022, 07:58 PM



Users browsing this thread: 5 Guest(s)