Class Fruit
java.lang.Object
GameObject
Fruit
Static GameObject which grants points to Snake after collision.
-
Field Summary
Fields inherited from class GameObject
game, timer
-
Constructor Summary
ConstructorDescriptionFruit(Cell parentCell, FruitType type, FruitGenerator fruitGenerator)
Costructor that set position and type of object. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Like unity OnDestroy (invoke after destroy object or on end of game).protected void
render(Graphics2D g)
Method who render a object on screen (invoke on begin of each frames).Methods inherited from class GameObject
awake, getDeltaTime, setTimer, start, timerClockDown, update
-
Field Details
-
type
public FruitType type
-
-
Constructor Details
-
Fruit
Costructor that set position and type of object. Pass reference to fruit generator,
-
-
Method Details
-
render
Description copied from class:GameObject
Method who render a object on screen (invoke on begin of each frames).- Overrides:
render
in classGameObject
-
onDestroy
protected void onDestroy()Description copied from class:GameObject
Like unity OnDestroy (invoke after destroy object or on end of game).- Overrides:
onDestroy
in classGameObject
-