class GameState[T] extends AnyRef
Container holding the Game's state.
- T
Numeric generic abstraction
- Alphabetic
- By Inheritance
- GameState
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
GameState(canvas: Canvas, pageElements: Vector[CanvasComponent[T]], isNewGame: Boolean = true, isGameOver: Boolean = false, monstersCaught: Int = 0, monstersHitTxt: String = GameState.monsterText(0), _gameOverTxt: ⇒ String = GameState.gameOverTxt, _explainTxt: ⇒ String = GameState.explainTxt)(implicit arg0: Numeric[T])
- canvas
The visual HTML element
- pageElements
This member lists the page elements. They are always in this order: Playground, Monster and Hero. E.g. pageElements.head is Playground, pageElements(1) is the Monster, pageElements.takes(2) are those both.
- isNewGame
Flags game play is just fresh started
- isGameOver
Flags a new turn
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (GameState[T], B)
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- def ensuring(cond: (GameState[T]) ⇒ Boolean, msg: ⇒ Any): GameState[T]
- def ensuring(cond: (GameState[T]) ⇒ Boolean): GameState[T]
- def ensuring(cond: Boolean, msg: ⇒ Any): GameState[T]
- def ensuring(cond: Boolean): GameState[T]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(that: Any): Boolean
- Definition Classes
- GameState → AnyRef → Any
- def explainTxt: String
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- def formatted(fmtstr: String): String
- def gameOverTxt: String
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- def hero: Hero[T]
- val isGameOver: Boolean
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val isNewGame: Boolean
-
def
keyEffect(latency: Double, keysDown: Set[Int]): GameState[T]
Process on a regular basis the arrow keys pressed.
Process on a regular basis the arrow keys pressed.
- returns
a state with the Hero position adjusted.
- val monstersHitTxt: String
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- val pageElements: Vector[CanvasComponent[T]]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- GameState → AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- def →[B](y: B): (GameState[T], B)
This is the documentation for a simple HTML5 Canvas game written in Scala, and cross compiled to run in the browser targeting the HTML5 Canvas.
See also:
Package structure
Notable packages include:
nl.amsscala.simplegame