Polygon Dash
Loading...
Searching...
No Matches
ComponentParallaxScroll Class Reference

Move the player by a specified amount each frame. More...

Inheritance diagram for ComponentParallaxScroll:
ComponentScript IComponent

Public Member Functions

 this (size_t owner, int depth, ComponentTransform transform)
 Set up the script.
 
override void Update ()
 Move the object forward.
 
- Public Member Functions inherited from ComponentScript
 this (size_t id)
 Store the owner id.
 
override void Render (SDL_Renderer *renderer, SDL_Rect *camera)
 Render the given script.
 
- Public Member Functions inherited from IComponent

Public Attributes

ComponentTransform mTransform
 The ComponentTransform of the linked GameObject.
 
int mSpeed
 The speed to move the parallaxed GameObject.
 

Detailed Description

Move the player by a specified amount each frame.

The amount is different from the player speed to give a 3D effect.

Constructor & Destructor Documentation

◆ this()

ComponentParallaxScroll::this ( size_t owner,
int depth,
ComponentTransform transform )
inline

Set up the script.

Parameters
ownerthe id of the linked GameObject.
depththe speed to move the parallaxed GameObject..
transformthe ComponentTransform of the linked GameObject.

Member Function Documentation

◆ Update()

override void ComponentParallaxScroll::Update ( )
inlinevirtual

Move the object forward.

See also
GameObject::Update

Implements ComponentScript.


The documentation for this class was generated from the following file: