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

[EA]Convert Rotation code(Solved)


DMF
 Share

Recommended Posts

ok's this is a far outdated code wonder if some one could convert it to format of EA 3.0.21 .

this code was under

"Private Sub Form_KeyUp"

idk i didn't see an i in the code.

```

Dim d As Long, i As Integer

```

Rotation code was under same sub.

```

If KeyCode = vbKeyEnd Then

d = GetPlayerDir(MyIndex)

If Player(MyIndex).Moving = NO Then

If Player(MyIndex).Dir = DIR_DOWN Then

Call SetPlayerDir(MyIndex, DIR_LEFT)

If d <> DIR_LEFT Then

Call SendPlayerDir

End If

ElseIf Player(MyIndex).Dir = DIR_LEFT Then

Call SetPlayerDir(MyIndex, DIR_UP)

If d <> DIR_UP Then

Call SendPlayerDir

End If

ElseIf Player(MyIndex).Dir = DIR_UP Then

Call SetPlayerDir(MyIndex, DIR_RIGHT)

If d <> DIR_RIGHT Then

Call SendPlayerDir

End If

ElseIf Player(MyIndex).Dir = DIR_RIGHT Then

Call SetPlayerDir(MyIndex, DIR_DOWN)

If d <> DIR_DOWN Then

Call SendPlayerDir

End If

End If

End If

End If

```

this would be really great help to me if someone could convert this.

Thanks in advance.
Link to comment
Share on other sites

then tell me how get it in with out crashing? or where exactly i should add it?? b/c it dont work. 1 if i get it open the enter button crashes it. if that doesnt .moving does or it dont work at all.

o-o ya i was testing it,, so any ideas?
Link to comment
Share on other sites

Remove all that shit you added.

Go to:```

Public Sub HandleKeyUp(ByVal KeyCode As Long)

```and before the```
End Sub
```add:```

If KeyCode = vbKeyEnd Then

If TempPlayer(MyIndex).Moving = NO Then

Select Case GetPlayerDir(MyIndex)

Case DIR_UP ' Change to right

SetPlayerDir MyIndex, DIR_RIGHT

Case DIR_RIGHT ' Change to down

SetPlayerDir MyIndex, DIR_DOWN

Case DIR_DOWN ' change to left

SetPlayerDir MyIndex, DIR_LEFT

Case DIR_LEFT ' change to up

SetPlayerDir MyIndex, DIR_UP

End Select

Call SendPlayerDir

End If

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