Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

True 3-Frame Movement


Electrokinesis
 Share

Recommended Posts

  • 4 weeks later...
  • Replies 93
  • Created
  • Last Reply

Top Posters In This Topic

First, under 'BltPlayer' in modGameLogic find where it says 'check for animation and change everything between that and the next set of green text to this:

```
' Check for animation
    Anim = 1
  If Player(Index).Attacking = 0 Then
    Select Case GetPlayerDir(Index)
      Case DIR_UP
        If (Player(Index).yOffset > 8) Then Anim = Player(Index).Step
      Case DIR_DOWN
        If (Player(Index).yOffset < -8) Then Anim = Player(Index).Step
      Case DIR_LEFT
        If (Player(Index).xOffset > 8) Then Anim = Player(Index).Step
      Case DIR_RIGHT
        If (Player(Index).xOffset < -8) Then Anim = Player(Index).Step
    End Select
  Else
    If Player(Index).AttackTimer + 1000 > GetTickCount Then
      Anim = 2
    End If
  End If
```
Use the same code and same process under 'BltPlayerTop'.
______________________
Next find 'Sub processmovement' and replace the entire code (in between the lines) with this:
```
Sub ProcessMovement(ByVal Index As Long)

  ' Check if player is walking, and if so process moving them over
  If Player(Index).Moving = MOVING_WALKING Then
    Select Case GetPlayerDir(Index)
      Case DIR_UP
        Player(Index).YOffset = Player(Index).YOffset - WALK_SPEED
      Case DIR_DOWN
        Player(Index).YOffset = Player(Index).YOffset + WALK_SPEED
      Case DIR_LEFT
        Player(Index).XOffset = Player(Index).XOffset - WALK_SPEED
      Case DIR_RIGHT
        Player(Index).XOffset = Player(Index).XOffset + WALK_SPEED
    End Select

    ' Check if completed walking over to the next tile
    If Player(Index).Dir = DIR_RIGHT Or Player(Index).Dir = DIR_DOWN Then
      If (Player(Index).XOffset >= 0) And (Player(Index).YOffset >= 0) Then
        Player(Index).Moving = 0
        If Player(Index).Step = 0 Then
          Player(Index).Step = 2
        Else
          Player(Index).Step = 0
        End If
      End If
    Else
      If (Player(Index).XOffset <= 0) And (Player(Index).YOffset <= 0) Then
        Player(Index).Moving = 0
        If Player(Index).Step = 0 Then
          Player(Index).Step = 2
        Else
          Player(Index).Step = 0
        End If
      End If
    End If
  End If

  ' Check if player is running, and if so process moving them over
  If Player(Index).Moving = MOVING_RUNNING Then
    Select Case GetPlayerDir(Index)
      Case DIR_UP
        Player(Index).YOffset = Player(Index).YOffset - RUN_SPEED
      Case DIR_DOWN
        Player(Index).YOffset = Player(Index).YOffset + RUN_SPEED
      Case DIR_LEFT
        Player(Index).XOffset = Player(Index).XOffset - RUN_SPEED
      Case DIR_RIGHT
        Player(Index).XOffset = Player(Index).XOffset + RUN_SPEED
    End Select

    ' Check if completed walking over to the next tile
    If Player(Index).Dir = DIR_RIGHT Or Player(Index).Dir = DIR_DOWN Then
      If (Player(Index).XOffset >= 0) And (Player(Index).YOffset >= 0) Then
        Player(Index).Moving = 0
        If Player(Index).Step = 0 Then
          Player(Index).Step = 2
        Else
          Player(Index).Step = 0
        End If
      End If
    Else
      If (Player(Index).XOffset <= 0) And (Player(Index).YOffset <= 0) Then
        Player(Index).Moving = 0
        If Player(Index).Step = 0 Then
          Player(Index).Step = 2
        Else
          Player(Index).Step = 0
        End If
      End If
    End If
  End If

  Select Case GetPlayerDir(Index)
    Case DIR_UP
      If Player(Index).YOffset <= 0 Then
        Player(Index).YOffset = 0
      End If
    Case DIR_DOWN
      If Player(Index).YOffset >= 0 Then
        Player(Index).YOffset = 0
      End If
    Case DIR_LEFT
      If Player(Index).XOffset <= 0 Then
        Player(Index).XOffset = 0
      End If
    Case DIR_RIGHT
      If Player(Index).XOffset >= 0 Then
        Player(Index).XOffset = 0
      End If
  End Select
End Sub
```_________________
Finally, in modType find 'PlayerRec' and add this after "Party As PartyRec":
```
Step As Byte
```

Ok, so will this code work for EE2.7 and/or EE2.8?
Link to comment
Share on other sites

@Zetasis:

> Darn my luck. It would be awesome if someone could add this to the EE2.8 that AkselJ made for people like me who can't afford VB.

seriously, how many guys you think here have a "real" VB?

just a few are lucky to get it from work or stuff, rest is… well acquired a not so nice way if ya get my drift...

Damian666
Link to comment
Share on other sites

  • 2 weeks later...
That's pretty assumptive. I tried putting this in source twice, watching carefully to do it EXACTLY like Robin said… However, I makes my map editor keep the "chest" attribute checked, and it overlaps my Tiles 3 button. It's just plain weird. I'm using version 2.8 if that means anything.  :P
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×
×
  • Create New...