JubeatPlus 3.9.11
Loading...
Searching...
No Matches
UpperBGRipple Class Reference

A sprite that drifts leftwards, bounces on a ground line, and casts a reflection. More...

#include <UpperBGRipple.h>

Inheritance diagram for UpperBGRipple:
Collaboration diagram for UpperBGRipple:

Instance Methods

(instancetype) - initWithSprite:atPoint:xSpeed:yGround:yAmp:yCenter:yPeriod:yPhase:mag:
 Builds one sprite with its motion parameters.
(void) - triggerJump:
 Launches the sprite upwards, but only from rest.
(void) - stepFall:gravity:bounce:
 Advances the sprite one step: left by its speed, and up or down under gravity.
(void) - renderWithTexture:yLimit:
 Draws the sprite and, when it is still in view, its reflection.
(NSInteger) - compZ:
 Orders two sprites back to front by their ground lines.

Properties

float y_gnd
 The ground line this sprite bounces on, and the key it is depth-sorted by.

Detailed Description

A sprite that drifts leftwards, bounces on a ground line, and casts a reflection.

Method Documentation

◆ compZ:

- (NSInteger) compZ: (nullable UpperBGRipple *) other

Orders two sprites back to front by their ground lines.

Parameters
otherThe 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
aSpriteThe sprite index within the texture.
aPointThe starting position. Its y is a height above yGround .
xSpeedHow far the sprite moves left each step.
yGroundThe ground line.
yAmpThe wave amplitude.
yCenterThe wave centre.
yPeriodThe wave period.
yPhaseThe wave phase.
aMagThe 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
textureThe texture to draw from.
yLimitHow 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
resetXWhere 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.
gravitySubtracted from the vertical speed each step.
bounceHow 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
forceThe impulse. Divided by the sprite's own mass to get its speed.
Ghidra address:
0x143f18
Ghidra address:
0x143f18

Property Documentation

◆ y_gnd

- (float) y_gnd
readnonatomicassign

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: