Closed matthewjwhite closed 4 years ago
Regarding battle:
Battle
class, for example, which contains a battle
function (two inputs: player, opponent). As the user is affected, the database is updated to reflect changes in health, etc. User::save
should be further fleshed out for these purposes to effectively dump a snapshot of the user account to the database.Regarding exploration:
I think a perfect place for the initial game loop is GameSession::run
; as currently written, GameSession
represents a single user's interaction with the server, and run
is effectively the "main" method for that session.
GameSocket::get
(note reference via self.socket
in GameSession
).exit
, then save the user's state and kill the connection.battle
method in the User
class, which accepts an input monster.move
method in the User
class, which accepts a direction.⬆️ is being implemented here: https://github.com/matthewjwhite/crystal-skull/tree/initial-game-loop.
What?
The game loop will drive the basic flow of the game.
At the moment, this game does not contain a loop of any sort. Once authenticated, the connection is killed.
Acceptance Criteria