Last active
August 29, 2015 13:56
-
-
Save dpogorzelski/9298461 to your computer and use it in GitHub Desktop.
This file contains 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
type Message struct { | |
Y int // current Y position | |
X int // as above | |
Id string // the id of the player that sent the message | |
New bool // true if this player just connected so we know when to | |
// spawn a new sprite on the screens of the other players. for all subsequent | |
// messages it's false | |
Online bool // true if the player is no longer connected so the frontend | |
// will remove it's sprite | |
} | |
type Player struct { | |
Y int // Y position of the player | |
X int // X position | |
Id string // a unique id to identify the player by the frontend | |
Socket *websocket.Conn // websocket connection of the player | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment