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

Diagonally walking script help? [ES]


Ikeyzo
 Share

Recommended Posts

I had been using EE 2.7 for a while, and was using a diagonal movement script. I decided to step it up one level, to **ES**. I won't use EO until it has custom.

Anyway, I was wondering where this would go in the source of ES.
In EE 2.7, it goes in modHandleData, under the IF statement Player movement packet.

```
    ' ::::::::::::::::::::::::::::
    ' :: Player movement packet ::
    ' ::::::::::::::::::::::::::::
    If (casestring = "playermove") Then
        I = Val(parse(1))
        X = Val(parse(2))
        y = Val(parse(3))
        Dir = Val(parse(4))
        n = Val(parse(5))

        If Dir < DIR_UP Or Dir > DIR_RIGHT Then
            Exit Sub
        End If

        Call SetPlayerX(I, X)
        Call SetPlayerY(I, y)
        Call SetPlayerDir(I, Dir)

        Player(I).xOffset = 0
        Player(I).yOffset = 0
        Player(I).Moving = n

        ' Replaced with the one from TE.
        Select Case GetPlayerDir(I)
            Case DIR_UP
                Player(I).yOffset = PIC_Y
                Player(I).xOffset = PIC_X 'Moshu-----
            Case DIR_DOWN
                Player(I).yOffset = PIC_Y * -1
                Player(I).xOffset = PIC_X * -1 'Moshu-----
            Case DIR_LEFT
                Player(I).xOffset = PIC_X
                Player(I).yOffset = PIC_Y 'Moshu-----
            Case DIR_RIGHT
                Player(I).xOffset = PIC_X * -1
                Player(I).yOffset = PIC_Y * -1 'Moshu-----
        End Select

        Exit Sub
    End If

```
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...