Map Explorer
#5
I like in-program generated graphics. 

I fiddled with it for a couple seconds and changed the key handling code in the navigation to only use one call to _keyhit to handle the direction moved instead of 4 calls to _keydown.  Not sure if it saves many (if any)  cycles but it structures things to make room for collision testing later if you want to add any and it eliminates the need for if then's that don't relate to user input.

Code: (Select All)
    kd = _KeyHit
    Select Case kd
        Case keyUP
            player.y = player.y - playerSpeed: t = t + 1
            If player.y < 0 Then player.y = 0
        Case keyDOWN
            player.y = player.y + playerSpeed: t = t + 1
            If player.y > _Height(map) Then player.y = _Height(map)
        Case keyLEFT
            player.x = player.x - playerSpeed: t = t + 1
            If player.x < 0 Then player.x = 0
        Case keyRIGHT
            player.x = player.x + playerSpeed: t = t + 1
            If player.y > _Height(map) Then player.y = _Height(map)
        Case Esc
            End
    End Select
Reply


Messages In This Thread
Map Explorer - by SierraKen - 08-10-2022, 12:22 AM
RE: Map Explorer - by mdijkens - 08-10-2022, 01:56 PM
RE: Map Explorer - by Petr - 08-10-2022, 02:54 PM
RE: Map Explorer - by James D Jarvis - 08-10-2022, 02:55 PM
RE: Map Explorer - by James D Jarvis - 08-10-2022, 03:03 PM
RE: Map Explorer - by SierraKen - 08-10-2022, 04:17 PM
RE: Map Explorer - by SierraKen - 08-10-2022, 04:25 PM
RE: Map Explorer - by James D Jarvis - 08-10-2022, 06:38 PM
RE: Map Explorer - by SierraKen - 08-10-2022, 06:41 PM
RE: Map Explorer - by James D Jarvis - 08-10-2022, 06:50 PM
RE: Map Explorer - by SierraKen - 08-10-2022, 04:37 PM
RE: Map Explorer - by Petr - 08-10-2022, 04:56 PM
RE: Map Explorer - by SierraKen - 08-10-2022, 05:24 PM
RE: Map Explorer - by SierraKen - 08-10-2022, 05:28 PM
RE: Map Explorer - by SierraKen - 08-10-2022, 07:22 PM
RE: Map Explorer - by SierraKen - 08-10-2022, 07:37 PM
RE: Map Explorer - by James D Jarvis - 08-10-2022, 08:13 PM
RE: Map Explorer - by bplus - 08-10-2022, 08:29 PM
RE: Map Explorer - by bplus - 08-10-2022, 08:32 PM
RE: Map Explorer - by James D Jarvis - 08-10-2022, 08:44 PM
RE: Map Explorer - by SierraKen - 08-10-2022, 11:17 PM
RE: Map Explorer - by James D Jarvis - 08-10-2022, 11:57 PM
RE: Map Explorer - by James D Jarvis - 08-11-2022, 12:19 AM
RE: Map Explorer - by bplus - 08-11-2022, 01:41 AM
RE: Map Explorer - by SierraKen - 08-11-2022, 05:44 AM
RE: Map Explorer - by James D Jarvis - 08-11-2022, 01:26 PM
RE: Map Explorer - by bplus - 08-11-2022, 03:19 PM
RE: Map Explorer - by SierraKen - 08-11-2022, 05:07 PM
RE: Map Explorer - by SierraKen - 08-11-2022, 11:59 PM
RE: Map Explorer - by vince - 08-12-2022, 06:33 AM
RE: Map Explorer - by SierraKen - 08-12-2022, 07:39 PM
RE: Map Explorer - by James D Jarvis - 08-12-2022, 02:37 PM
RE: Map Explorer - by SierraKen - 08-12-2022, 07:41 PM
RE: Map Explorer - by James D Jarvis - 08-12-2022, 11:39 PM



Users browsing this thread: 10 Guest(s)