Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Feature] Run & Walk speed values.
#1
This replaces the current Processmovement subroutines to have an extra "catch-all" code to make sure people don't wonder off a tile completely, which is what causes the flight effect where sprites start running off-screen.

It's copy and paste, I can't be arsed with decent formatting, so here you go.

Processmovement:

Code:
Select Case GetPlayerDir(Index)
        Case DIR_UP
            Player(Index).YOffset = Player(Index).YOffset - MovementSpeed
            If Player(Index).YOffset = 0 Then Player(Index).YOffset = 0
        Case DIR_LEFT
            Player(Index).XOffset = Player(Index).XOffset - MovementSpeed
            If Player(Index).XOffset = 0 Then Player(Index).XOffset = 0
    End Select

Processnpcmovement:

Code:
Select Case MapNpc(MapNpcNum).Dir
            Case DIR_UP
                MapNpc(MapNpcNum).YOffset = MapNpc(MapNpcNum).YOffset - WALK_SPEED
                If MapNpc(MapNpcNum).YOffset = 0 Then MapNpc(MapNpcNum).YOffset = 0
            Case DIR_LEFT
                MapNpc(MapNpcNum).XOffset = MapNpc(MapNpcNum).XOffset - WALK_SPEED
                If MapNpc(MapNpcNum).XOffset = 0 Then MapNpc(MapNpcNum).XOffset = 0
        End Select

Enjoy.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)