Created
March 9, 2018 16:08
-
-
Save dfalmeida/08ce81166197bd5977c0d4930570ee95 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func sendActions(with player: Player) { | |
WebSocket.instance.sendMessage(with: "game:slimeSoccer", | |
event: "playerAction", | |
payload: [ | |
"player" : player.id, | |
"jump": player.isJumping, | |
"left": player.isMovingLeft, | |
"right": player.isMovingRight, | |
"x": player.sprite?.position.x as Any, | |
"y": player.sprite?.position.y as Any], | |
onSuccess: { (message) in }, | |
onError: { (reason) in }) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment