A sprite that drifts leftwards, bounces on a ground line, and casts a reflection.
More...
#include <UpperBGRipple.h>
|
| float | y_gnd |
| | The ground line this sprite bounces on, and the key it is depth-sorted by.
|
A sprite that drifts leftwards, bounces on a ground line, and casts a reflection.
◆ compZ:
Orders two sprites back to front by their ground lines.
- Parameters
-
| other | The sprite to compare against. |
- Returns
NSOrderedAscending , NSOrderedSame or NSOrderedDescending .
- Ghidra address:
- 0x144100
◆ initWithSprite:atPoint:xSpeed:yGround:yAmp:yCenter:yPeriod:yPhase:mag:
| - (instancetype) initWithSprite: |
|
(NSUInteger) | aSprite |
| atPoint: |
|
(CGPoint) | aPoint |
| xSpeed: |
|
(float) | xSpeed |
| yGround: |
|
(float) | yGround |
| yAmp: |
|
(float) | yAmp |
| yCenter: |
|
(float) | yCenter |
| yPeriod: |
|
(unsigned int) | yPeriod |
| yPhase: |
|
(unsigned int) | yPhase |
| mag: |
|
(float) | aMag |
Builds one sprite with its motion parameters.
The mass is not a parameter: it is chosen here at random, between 4 and 6.875.
- Parameters
-
| aSprite | The sprite index within the texture. |
| aPoint | The starting position. Its y is a height above yGround . |
| xSpeed | How far the sprite moves left each step. |
| yGround | The ground line. |
| yAmp | The wave amplitude. |
| yCenter | The wave centre. |
| yPeriod | The wave period. |
| yPhase | The wave phase. |
| aMag | The draw scale. |
- Returns
- The initialised sprite.
- Ghidra address:
- 0x143dd0
- Ghidra address:
- 0x143dd0
◆ renderWithTexture:yLimit:
| - (void) renderWithTexture: |
|
(nullable Texture2D *) | texture |
| yLimit: |
|
(float) | yLimit |
Draws the sprite and, when it is still in view, its reflection.
- Parameters
-
| texture | The texture to draw from. |
| yLimit | How far down the reflection may be drawn before it is dropped. |
- Ghidra address:
- 0x143fdc
◆ stepFall:gravity:bounce:
| - (void) stepFall: |
|
(float) | resetX |
| gravity: |
|
(float) | gravity |
| bounce: |
|
(float) | bounce |
Advances the sprite one step: left by its speed, and up or down under gravity.
- Parameters
-
| resetX | Where to put the sprite when it has drifted off the left edge. Despite being the selector's first keyword this is a position, not a step. |
| gravity | Subtracted from the vertical speed each step. |
| bounce | How much of the vertical speed survives a landing. |
- Ghidra address:
- 0x143f5c
- Ghidra address:
- 0x143f5c
◆ triggerJump:
| - (void) triggerJump: |
|
(float) | force |
|
Launches the sprite upwards, but only from rest.
The guard is a window around zero rather than a test for exactly zero, so a sprite that is airborne ignores the call entirely.
- Parameters
-
| force | The impulse. Divided by the sprite's own mass to get its speed. |
- Ghidra address:
- 0x143f18
- Ghidra address:
- 0x143f18
◆ y_gnd
The ground line this sprite bounces on, and the key it is depth-sorted by.
- Ghidra address:
- 0x144188 (getter)
The documentation for this class was generated from the following files: