public abstract class CloudsGame extends Object implements BackgroundComponent
Modifier and Type | Field and Description |
---|---|
protected SpriteTiled |
sprite
Clouds surface.
|
Constructor and Description |
---|
CloudsGame(Media media,
int cloudWidth,
int cloudHeight,
int screenWidth,
int decY)
Constructor base.
|
Modifier and Type | Method and Description |
---|---|
void |
render(Graphic g)
Render component.
|
void |
setScreenWidth(int screenWidth)
Set the screen width.
|
void |
setSpeed(int line,
double speed)
Set cloud line speed (usually, line 0 is faster than last line).
|
void |
setY(int line,
int y)
Set cloud line height (usually, line 0 is higher than last line).
|
void |
update(double extrp,
int x,
int y,
double speed)
Update component.
|
protected final SpriteTiled sprite
public CloudsGame(Media media, int cloudWidth, int cloudHeight, int screenWidth, int decY)
media
- The clouds image media.cloudWidth
- The image width.cloudHeight
- The image height.screenWidth
- The screen height.decY
- The vertical offset.LionEngineException
- If arguments are invalid or image cannot be read.public void setY(int line, int y)
line
- The cloud line (0 = top, last = bottom).y
- The cloud height.public void setSpeed(int line, double speed)
line
- The cloud line (0 = top, last = bottom).speed
- The cloud speed.public final void setScreenWidth(int screenWidth)
screenWidth
- The screen width.public void update(double extrp, int x, int y, double speed)
BackgroundComponent
update
in interface BackgroundComponent
extrp
- The extrapolation value.x
- The horizontal offset.y
- The vertical offset.speed
- The scrolling speed.public void render(Graphic g)
BackgroundComponent
render
in interface BackgroundComponent
g
- The graphic output.Copyright © 2016 Byron 3D Games Studio. All rights reserved.