Class Terrain
java.lang.Object
fr.paris.saclay.sidescroller.drawables.Drawable
fr.paris.saclay.sidescroller.drawables.Terrain
Drawable responsible for creating the terrain.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
draw
(Graphics2D graphics2D) Draws the component.void
update()
This method is called by the GamePanel every time a new frame has to be generated.Methods inherited from class fr.paris.saclay.sidescroller.drawables.Drawable
getXPosition, updatePositionToCamera
-
Constructor Details
-
Terrain
Creates a Terrain instance, saves the GamePanel reference and sets the theme (tile related to the level selected in the initial menu).- Parameters:
gamePanel
- reference.theme
- theme types: grass, mushroom, castle (each one related to a different level).
-
-
Method Details
-
update
public void update()Description copied from class:Drawable
This method is called by the GamePanel every time a new frame has to be generated. Each Drawable object is responsible for calculating its position, state and aspect (such as sprite animations) for every new frame. -
draw
Draws the component.
-