Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package snake
- class OnePlayerGame extends SnakeGame("Player1Snek") {
- val VictoryScore = 1000
- var points = 0
- val DimOfGame = new Dim(30, 50)
- val InitPos = Pos(5, 5, DimOfGame)
- val InitDir = South
- var snek1 = new Snake(
- InitPos,
- InitDir,
- Colors.Green,
- Colors.DarkGreen,
- this
- )
- val snekapple = new Apple(
- this
- )
- override def isGameOver: Boolean = {
- points >= VictoryScore
- }
- def play(playerNames: String*): Unit = {
- var entities: Vector[Entity] = Vector(snek1, snekapple) //TODO should be updated to a instance of their respecive classes
- val player1: Player = Player(playerNames(0), "A", "S", "D", "W", snek1)
- players = players :+ player1
- startGameLoop() //will play gameLoopAction every loop see above
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement