RandomBlocks

introprog.examples.TestBlockGame.RandomBlocks
class RandomBlocks extends BlockGame

A class extending introprog.BlockGame, see source code.

Attributes

Source
TestBlockGame.scala
Graph
Supertypes
class BlockGame
class Object
trait Matchable
class Any

Members list

Type members

Classlikes

case object GameOver extends State

Attributes

Source
TestBlockGame.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait State
class Object
trait Matchable
class Any
Show all
Self type
GameOver.type
case object Playing extends State

Attributes

Source
TestBlockGame.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait State
class Object
trait Matchable
class Any
Show all
Self type
Playing.type
case object Starting extends State

Attributes

Source
TestBlockGame.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait State
class Object
trait Matchable
class Any
Show all
Self type
Starting.type
sealed trait State

Attributes

Source
TestBlockGame.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object GameOver
object Playing
object Starting

Value members

Concrete methods

override def gameLoopAction(): Unit

Called in each gameLoop iteration. Override if you want non-empty action.

Called in each gameLoop iteration. Override if you want non-empty action.

Attributes

Definition Classes
Source
TestBlockGame.scala
override def onClose(): Unit

Called when window is closed. Override if you want non-empty action.

Called when window is closed. Override if you want non-empty action.

Attributes

Definition Classes
Source
TestBlockGame.scala
override def onKeyDown(key: String): Unit

Called when a key is pressed. Override if you want non-empty action.

Called when a key is pressed. Override if you want non-empty action.

Value parameters

key

is a string representation of the pressed key

Attributes

Definition Classes
Source
TestBlockGame.scala
override def onKeyUp(key: String): Unit

Called when a key is released. Override if you want non-empty action.

Called when a key is released. Override if you want non-empty action.

Value parameters

key

is a string representation of the released key

Attributes

Definition Classes
Source
TestBlockGame.scala
override def onMouseDown(pos: (Int, Int)): Unit

Called when mouse is pressed. Override if you want non-empty action.

Called when mouse is pressed. Override if you want non-empty action.

Value parameters

pos

the mouse position in underlying pixelWindow coordinates

Attributes

Definition Classes
Source
TestBlockGame.scala
override def onMouseUp(pos: (Int, Int)): Unit

Called when mouse is released. Override if you want non-empty action.

Called when mouse is released. Override if you want non-empty action.

Value parameters

pos

the mouse position in underlying pixelWindow coordinates

Attributes

Definition Classes
Source
TestBlockGame.scala
def play(): Unit

Attributes

Source
TestBlockGame.scala
def showEnterMessage(): Unit

Attributes

Source
TestBlockGame.scala
def showEscapeMessage(): Unit

Attributes

Source
TestBlockGame.scala

Inherited methods

def clearMessageArea(x: Int, y: Int, width: Int, height: Int): Unit

Clear a rectangle in the message area in block coordinates.

Clear a rectangle in the message area in block coordinates.

Attributes

Inherited from:
BlockGame
Source
BlockGame.scala
def clearWindow(): Unit

Erase all blocks to background color.

Erase all blocks to background color.

Attributes

Inherited from:
BlockGame
Source
BlockGame.scala
def drawBlock(x: Int, y: Int, c: Color): Unit

Paint a block in color c at (x,y) in block coordinates.

Paint a block in color c at (x,y) in block coordinates.

Attributes

Inherited from:
BlockGame
Source
BlockGame.scala
def drawCenteredText(msg: String, color: Color, size: Int): Unit

Write msg in color in the middle of the window. The drawing is postponed until the end of the current game loop iteration and thus the text drawn on top of any updated blocks.

Write msg in color in the middle of the window. The drawing is postponed until the end of the current game loop iteration and thus the text drawn on top of any updated blocks.

Attributes

Inherited from:
BlockGame
Source
BlockGame.scala
def drawTextInMessageArea(msg: String, x: Int, y: Int, color: Color, size: Int): Unit

Write msg in color in the message area at ('x','y') in block coordinates.

Write msg in color in the message area at ('x','y') in block coordinates.

Attributes

Inherited from:
BlockGame
Source
BlockGame.scala
def eraseBlock(x: Int, y: Int): Unit

Erase the block at (x,y) to background color.

Erase the block at (x,y) to background color.

Attributes

Inherited from:
BlockGame
Source
BlockGame.scala

Returns the gameLoop delay in ms implied by framesPerSecond.

Returns the gameLoop delay in ms implied by framesPerSecond.

Attributes

Inherited from:
BlockGame
Source
BlockGame.scala
def onFrameTimeOverrun(elapsedMillis: Long): Unit

Called if no time is left in iteration to keep frame rate. Default action is to print a warning message.

Called if no time is left in iteration to keep frame rate. Default action is to print a warning message.

Attributes

Inherited from:
BlockGame
Source
BlockGame.scala

Concrete fields

var isDrawingRandomBlocks: Boolean

Attributes

Source
TestBlockGame.scala
var state: State

Attributes

Source
TestBlockGame.scala

Inherited fields

val background: Color

Attributes

Inherited from:
BlockGame
Source
BlockGame.scala
val blockSize: Int

Attributes

Inherited from:
BlockGame
Source
BlockGame.scala
val dim: (Int, Int)

Attributes

Inherited from:
BlockGame
Source
BlockGame.scala
var framesPerSecond: Int

Attributes

Inherited from:
BlockGame
Source
BlockGame.scala

Attributes

Inherited from:
BlockGame
Source
BlockGame.scala

Attributes

Inherited from:
BlockGame
Source
BlockGame.scala
val title: String

Attributes

Inherited from:
BlockGame
Source
BlockGame.scala