//
// PlayerObject::update from 0x34ef60 to 0x34fa56 (2806 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void PlayerObject::update(PlayerObject *a1, float a2)
{
double m_flashTime; // d10
float *p_m_flashDuration; // r7
double v6; // d10
double m_flashDuration; // d7
PlayerObject *v8; // r0
cocos2d::ccColor3B *p_m_originalSecondColor; // r1
void (__fastcall *setColor)(PlayerObject *__hidden, const cocos2d::ccColor3B *); // r8
float v11; // s15
int v12; // r0
float v13; // s15
int v14; // r0
char v15; // r3
double *p_m_yVelocity; // r5
double m_yVelocity; // d5
double *p_m_platformerXVelocity; // r3
double m_platformerXVelocity; // d6
const cocos2d::CCPoint *LastPosition; // r7
const cocos2d::CCPoint *v21; // r0
float v22; // r0
int v23; // r2
bool v24; // r3
float v25; // s22
float v26; // s15
double v27; // d9
float v28; // s11
double v29; // d9
double v30; // d12
double v31; // d8
double v32; // d9
double v33; // d7
double v34; // d9
double *p_m_dashY; // r3
double v36; // d6
double m_dashX; // d5
double v38; // d7
_BOOL4 m_isGoingLeft; // r3
float v40; // s13
double *p_m_maybeReverseAcceleration; // r7
double v42; // d11
double v43; // d7
void (__fastcall *setPosition)(PlayerObject *__hidden, const cocos2d::CCPoint *); // r10
const cocos2d::CCPoint *v45; // r0
float v46; // s15
float v47; // r1
float v48; // s15
const cocos2d::CCPoint *v49; // r11
double m_maybeReverseSpeed; // d7
double v51; // d8
double v52; // d6
bool v53; // r3
double v54; // d6
HardStreak *m_waveTrail; // r5
_BOOL4 m_playEffects; // r3
GameManager *v57; // r0
cocos2d::CCDirector *v58; // r0
float x; // s16
HardStreak *v60; // r5
float v61; // s17
GameManager *v62; // r0
PlayerFireBoostSprite *m_robotFire; // r0
PlayerFireBoostSprite_vtbl *v64; // r3
double m_accelerationOrSpeed; // d7
cocos2d::CCSequence *v66; // r10
cocos2d::CCScaleTo *v67; // r9
cocos2d::CCScaleTo *v68; // r8
cocos2d::CCScaleTo *v69; // r7
cocos2d::CCScaleTo *v70; // r0
cocos2d::CCAction *v71; // r0
cocos2d::CCParticleSystemQuad *m_robotBurstParticles; // r0
double v73; // d7
GhostTrailEffect *m_ghostTrail; // r7
float v75; // s15
float y; // s14
GhostTrailEffect *v77; // r8
int v78; // r2
bool v79; // r3
PlayerObject *p_m_position; // r0
cocos2d::CCParticleSystemQuad *m_swingBurstParticles1; // r5
void (__fastcall *setAngle)(cocos2d::CCParticleSystem *__hidden, float); // r7
float v83; // s15
float v84; // s14
cocos2d::CCParticleSystemQuad *m_swingBurstParticles2; // r5
void (__fastcall *v86)(cocos2d::CCParticleSystem *__hidden, float); // r7
float v87; // r0
float v88; // s14
cocos2d::CCMotionStreak *m_shipStreak; // r7
void (__fastcall *setTexture)(cocos2d::CCMotionStreak *__hidden, cocos2d::CCTexture2D *); // r8
cocos2d::CCTextureCache *v91; // r0
float m_totalTime; // s15
cocos2d::CCTextureCache *v93; // r9
cocos2d::CCTexture2D *v94; // r0
DashRingObject *m_dashRing; // r3
float m_maxDuration; // s14
cocos2d::CCDelayTime *v97; // r0
cocos2d::CCSequence *v98; // r7
cocos2d::CCFiniteTimeAction *v99; // r0
cocos2d::CCAction *v100; // r5
cocos2d::CCSequence *v101; // r7
cocos2d::CCHide *v102; // r0
cocos2d::CCAction *v103; // r5
cocos2d::CCPoint v104; // [sp+Ch] [bp-20h] BYREF
cocos2d::CCPoint v105; // [sp+14h] [bp-18h] BYREF
_DWORD v106[2]; // [sp+1Ch] [bp-10h] BYREF
m_flashTime = a1->m_flashTime;
if ( m_flashTime >= 0.0 )
{
p_m_flashDuration = &a1->m_flashDuration;
v6 = a1->m_totalTime - m_flashTime - a1->m_flashDelay;
m_flashDuration = a1->m_flashDuration;
if ( v6 < m_flashDuration )
{
if ( v6 <= 0.0 )
goto LABEL_7;
setColor = a1->setColor;
v11 = v6 / m_flashDuration;
*(cocos2d::ccColor3B *)&v12 = GameToolbox::multipliedColorValue(
(cocos2d::ccColor3B)*(_DWORD *)&a1->m_flashMainColor.r,
(cocos2d::ccColor3B)(*(unsigned __int16 *)&a1->m_originalMainColor.r
| (a1->m_originalMainColor.b << 16)),
v11);
LOWORD(v106[0]) = v12;
BYTE2(v106[0]) = BYTE2(v12);
setColor(a1, (const cocos2d::ccColor3B *)v106);
v13 = v6 / *p_m_flashDuration;
*(cocos2d::ccColor3B *)&v14 = GameToolbox::multipliedColorValue(
(cocos2d::ccColor3B)(a1->m_flashSecondColor.r
| (a1->m_flashSecondColor.g << 8)
| (a1->m_flashSecondColor.b << 16)),
(cocos2d::ccColor3B)(a1->m_originalSecondColor.r
| (a1->m_originalSecondColor.g << 8)
| (a1->m_originalSecondColor.b << 16)),
v13);
p_m_originalSecondColor = (cocos2d::ccColor3B *)v106;
v15 = BYTE1(v14);
LOBYTE(v106[0]) = v14;
BYTE2(v106[0]) = BYTE2(v14);
v8 = a1;
BYTE1(v106[0]) = v15;
}
else
{
a1->m_flashTime = -1.0;
a1->setColor(a1, &a1->m_originalMainColor);
v8 = a1;
p_m_originalSecondColor = &a1->m_originalSecondColor;
}
PlayerObject::setSecondColor(v8, p_m_originalSecondColor);
}
LABEL_7:
p_m_yVelocity = &a1->m_yVelocity;
m_yVelocity = a1->m_yVelocity;
if ( m_yVelocity <= 1000.0 )
{
if ( m_yVelocity < -1000.0 )
*p_m_yVelocity = -1000.0;
}
else
{
*p_m_yVelocity = 1000.0;
}
if ( a1->m_isPlatformer )
{
p_m_platformerXVelocity = &a1->m_platformerXVelocity;
m_platformerXVelocity = a1->m_platformerXVelocity;
if ( m_platformerXVelocity <= 1000.0 )
{
if ( m_platformerXVelocity < -1000.0 )
*p_m_platformerXVelocity = -1000.0;
}
else
{
*p_m_platformerXVelocity = 1000.0;
}
}
if ( !a1->m_isDead )
{
LastPosition = GameObject::getLastPosition(a1);
v21 = a1->getPosition(a1);
cocos2d::ccpDistance(LastPosition, v21);
v22 = ((float (__fastcall *)(PlayerObject *))a1->getPosition)(a1);
cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_lastPosition, v22, v23, v24);
a1->m_yVelocityRelated3 = 0.0;
if ( a1->m_isLocked )
goto LABEL_80;
v25 = a2 * 0.9;
PlayerObject::updateJump(a1, a2 * 0.9);
if ( a1->m_stateForce <= 0 )
{
LABEL_53:
if ( a1->m_isDashing )
PlayerObject::setYVelocity(a1, 0.0, 1);
v29 = v25;
v30 = *p_m_yVelocity;
if ( a1->m_isPlatformer )
PlayerObject::updateMove(a1, a2 * 0.9);
v31 = PlayerObject::getCurrentXVelocity(a1) * a2;
if ( !a1->m_isDart || a1->m_isDashing )
{
if ( a1->m_isDashing )
{
p_m_dashY = &a1->m_dashY;
if ( a1->m_isPlatformer )
{
v36 = *p_m_dashY;
m_dashX = a1->m_dashX;
v38 = m_dashX * v29;
a1->m_platformerXVelocity = m_dashX;
*p_m_yVelocity = v36;
v34 = v36 * v29;
goto LABEL_69;
}
v34 = v31 * *p_m_dashY;
}
else
{
v34 = v30 * v29;
}
}
else
{
v32 = -1.0;
v33 = fabs(v31) * (double)PlayerObject::flipMod(a1);
if ( a1->m_jumpBuffered )
v32 = 1.0;
v34 = v33 * v32;
if ( a1->m_vehicleSize != 1.0 )
v34 = v34 + v34;
}
v38 = v31;
LABEL_69:
m_isGoingLeft = a1->m_isGoingLeft;
v40 = v34;
a1->m_yVelocityRelated3 = v40;
if ( m_isGoingLeft && !a1->m_isPlatformer )
v38 = -v38;
p_m_maybeReverseAcceleration = &a1->m_maybeReverseAcceleration;
v42 = v38 + a1->m_maybeReverseAcceleration;
if ( a1->m_isSideways )
{
v43 = v34;
v34 = v42;
v42 = v43;
}
setPosition = a1->setPosition;
v45 = a1->getPosition(a1);
v46 = v42;
v47 = v46;
v48 = v34;
v49 = v45;
cocos2d::CCPoint::CCPoint(&v105, v47, v48);
cocos2d::CCPoint::operator+(v106, v49, &v105);
setPosition(a1, (const cocos2d::CCPoint *)v106);
*p_m_maybeReverseAcceleration = 0.0;
m_maybeReverseSpeed = a1->m_maybeReverseSpeed;
if ( m_maybeReverseSpeed != 0.0 )
{
v51 = v31 * 0.0199999996;
v52 = fabs(m_maybeReverseSpeed);
if ( v52 < v51 )
v51 = v52;
if ( m_maybeReverseSpeed <= 0.0 )
v51 = -v51;
*p_m_maybeReverseAcceleration = v51;
a1->m_maybeReverseSpeed = m_maybeReverseSpeed - v51;
}
LABEL_80:
if ( !PlayerObject::isFlying(a1) )
{
if ( !a1->m_isOnGround2
|| PlayerObject::levelFlipping(a1)
|| a1->m_isLocked
|| a1->m_isHidden
|| a1->m_isPlatformer && fabs(a1->m_platformerXVelocity) <= 2.5 )
{
if ( a1->m_hasGroundParticles && !cocos2d::CCNode::getActionByTag(a1, 3) )
{
v97 = cocos2d::CCDelayTime::create(0.06);
v106[1] = 0;
v106[0] = PlayerObject::deactivateParticle;
v98 = (cocos2d::CCSequence *)v97;
v99 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(a1, PlayerObject::deactivateParticle, 0);
v100 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v98, v99, 0);
v100->setTag(v100, 3);
cocos2d::CCNode::runAction(a1, v100);
}
}
else
{
if ( !a1->m_hasGroundParticles )
cocos2d::CCParticleSystem::resumeSystem(a1->m_playerGroundParticles);
a1->m_hasGroundParticles = 1;
cocos2d::CCNode::stopActionByTag(a1, 3);
}
LABEL_111:
m_waveTrail = a1->m_waveTrail;
m_playEffects = a1->m_playEffects;
m_waveTrail->m_pulseSize = (float)((float)(a1->m_audioScale - 0.1) * 2.1) + 0.4;
if ( m_playEffects )
{
if ( a1->m_isGoingLeft )
{
v58 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCSize *)&v105, v58);
x = v105.x;
v60 = a1->m_waveTrail;
v61 = GameManager::sharedState()->m_playLayer->m_gameState.m_cameraPosition2.x;
v62 = GameManager::sharedState();
HardStreak::clearAboveXPos(v60, v61 + (float)(x / v62->m_playLayer->m_gameState.m_cameraZoom));
}
else
{
v57 = GameManager::sharedState();
HardStreak::clearBehindXPos(m_waveTrail, v57->m_playLayer->m_gameState.m_cameraPosition2.x);
}
}
m_robotFire = a1->m_robotFire;
if ( m_robotFire )
{
v64 = m_robotFire->cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
if ( a1->m_isRobot
&& a1->m_jumpBuffered
&& !a1->m_touchedPad
&& a1->m_maybeIsBoosted
&& (m_accelerationOrSpeed = a1->m_accelerationOrSpeed, m_accelerationOrSpeed > 0.270000011)
&& m_accelerationOrSpeed < 1.5 )
{
if ( !((int (*)(void))v64->isVisible)() )
{
cocos2d::CCNode::stopAllActions(a1->m_robotFire);
((void (__fastcall *)(PlayerFireBoostSprite *, int))a1->m_robotFire->setScale)(
a1->m_robotFire,
1036831949);
a1->m_robotFire->setVisible(a1->m_robotFire, 1);
v66 = (cocos2d::CCSequence *)cocos2d::CCScaleTo::create(0.05, 1.44);
v67 = cocos2d::CCScaleTo::create(0.05, 0.72);
v68 = cocos2d::CCScaleTo::create(0.05, 1.8);
v69 = cocos2d::CCScaleTo::create(0.05, 0.9);
v70 = cocos2d::CCScaleTo::create(0.05, 1.8);
v71 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v66, v67, v68, v69, v70, 0);
cocos2d::CCNode::runAction(a1->m_robotFire, v71);
cocos2d::CCParticleSystem::resumeSystem(a1->m_robotBurstParticles);
}
}
else if ( ((int (*)(void))v64->isVisible)() && !cocos2d::CCNode::getActionByTag(a1->m_robotFire, 9) )
{
cocos2d::CCNode::stopAllActions(a1->m_robotFire);
v101 = (cocos2d::CCSequence *)cocos2d::CCScaleTo::create(0.15, 0.05);
v102 = cocos2d::CCHide::create();
v103 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v101, v102, 0);
v103->setTag(v103, 9);
cocos2d::CCNode::runAction(a1->m_robotFire, v103);
cocos2d::CCParticleSystem::stopSystem(a1->m_robotBurstParticles);
}
}
m_robotBurstParticles = a1->m_robotBurstParticles;
if ( a1->m_isRobot
&& a1->m_jumpBuffered
&& !a1->m_touchedPad
&& a1->m_maybeIsBoosted
&& (v73 = a1->m_accelerationOrSpeed, v73 > 0.100000001)
&& v73 < 1.5
&& !a1->m_isHidden )
{
if ( !((int (__fastcall *)(cocos2d::CCParticleSystemQuad *))m_robotBurstParticles->isActive)(m_robotBurstParticles) )
cocos2d::CCParticleSystem::resumeSystem(a1->m_robotBurstParticles);
}
else if ( ((int (__fastcall *)(cocos2d::CCParticleSystemQuad *))m_robotBurstParticles->isActive)(m_robotBurstParticles) )
{
cocos2d::CCParticleSystem::stopSystem(a1->m_robotBurstParticles);
}
m_ghostTrail = a1->m_ghostTrail;
a1->m_maybeSpriteRelated = 0;
if ( !m_ghostTrail )
goto LABEL_146;
if ( a1->m_isRobot )
{
v75 = 7.0;
y = a1->m_robotSprite->m_headSprite->getPosition(a1->m_robotSprite->m_headSprite)->y;
}
else
{
if ( !a1->m_isSpider )
{
cocos2d::CCPoint::CCPoint(&v105, &stru_AC5C68);
p_m_position = (PlayerObject *)&m_ghostTrail->m_position;
goto LABEL_145;
}
v75 = 2.0;
y = a1->m_spiderSprite->m_headSprite->getPosition(a1->m_spiderSprite->m_headSprite)->y;
}
cocos2d::CCPoint::CCPoint(&v104, 0.0, v75 + (float)(y * 0.4));
v77 = a1->m_ghostTrail;
cocos2d::CCPoint::CCPoint(&v105, &v104);
p_m_position = (PlayerObject *)&v77->m_position;
LABEL_145:
cocos2d::CCPoint::operator=(p_m_position, COERCE_FLOAT(&v105), v78, v79);
LABEL_146:
if ( a1->m_isDashing )
PlayerObject::updateDashAnimation(a1);
if ( a1->m_isSwing )
{
m_swingBurstParticles1 = a1->m_swingBurstParticles1;
setAngle = m_swingBurstParticles1->setAngle;
v83 = 90.0;
v84 = (float)(45.0 - COERCE_FLOAT(((int (__fastcall *)(PlayerObject *))a1->getRotation)(a1))) - 180.0;
if ( !a1->m_isGoingLeft )
v83 = 0.0;
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, _DWORD))setAngle)(m_swingBurstParticles1, v84 + v83);
m_swingBurstParticles2 = a1->m_swingBurstParticles2;
v86 = m_swingBurstParticles2->setAngle;
v87 = COERCE_FLOAT(((int (__fastcall *)(PlayerObject *))a1->getRotation)(a1));
v88 = -90.0;
if ( !a1->m_isGoingLeft )
v88 = 0.0;
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, _DWORD))v86)(
m_swingBurstParticles2,
(float)((float)((float)-v87 - 45.0) - 180.0) + v88);
}
PlayerObject::updateJumpVariables(a1);
PlayerObject::updateStateVariables(a1);
m_shipStreak = a1->m_shipStreak;
if ( m_shipStreak )
{
setTexture = m_shipStreak->setTexture;
v91 = cocos2d::CCTextureCache::sharedTextureCache();
m_totalTime = a1->m_totalTime;
v93 = v91;
getFrameForStreak((int)&v105, a1->m_shipStreakType, m_totalTime);
v94 = cocos2d::CCTextureCache::addImage(v93, (const char *)LODWORD(v105.x), 0);
setTexture(m_shipStreak, v94);
sub_774008(&v105);
}
if ( a1->m_isPlatformer && a1->m_isDashing )
{
m_dashRing = a1->m_dashRing;
if ( m_dashRing )
{
m_maxDuration = m_dashRing->m_maxDuration;
if ( m_maxDuration > 0.0 && a1->m_totalTime - a1->m_dashStartTime > m_maxDuration )
{
PlayerObject::stopDashing(a1);
a1->m_jumpBuffered = 0;
}
}
}
return;
}
if ( a1->m_isShip )
{
if ( !a1->m_jumpBuffered || PlayerObject::levelFlipping(a1) || a1->m_isHidden )
{
if ( a1->m_hasShipParticles )
cocos2d::CCParticleSystem::stopSystem(a1->m_shipClickParticles);
v53 = 0;
}
else
{
if ( !a1->m_hasShipParticles )
cocos2d::CCParticleSystem::resumeSystem(a1->m_shipClickParticles);
v53 = 1;
}
a1->m_hasShipParticles = v53;
}
if ( !a1->m_isDart && a1->m_isOnGround2 )
{
v54 = *p_m_yVelocity;
if ( !a1->m_isUpsideDown )
{
if ( v54 <= -1.0 )
goto LABEL_110;
LABEL_102:
if ( !a1->m_isLocked
&& !a1->m_isHidden
&& (!a1->m_isPlatformer
|| a1->m_holdingLeft
|| a1->m_holdingRight
|| a1->m_platformerMovingLeft
|| a1->m_platformerMovingRight) )
{
cocos2d::CCParticleSystem::resumeSystem(a1->m_vehicleGroundParticles);
goto LABEL_111;
}
goto LABEL_110;
}
if ( v54 < 1.0 )
goto LABEL_102;
}
LABEL_110:
cocos2d::CCParticleSystem::stopSystem(a1->m_vehicleGroundParticles);
goto LABEL_111;
}
if ( a1->m_isShip )
{
v26 = 0.47;
}
else if ( a1->m_isBird )
{
v26 = 0.58;
}
else if ( a1->m_isSwing )
{
v26 = 0.4;
}
else if ( a1->m_isBall || a1->m_isSpider )
{
v26 = 0.6;
}
else if ( a1->m_isRobot )
{
v26 = 0.9;
}
else
{
v26 = 1.0;
}
if ( a1->m_vehicleSize != 1.0 )
{
if ( a1->m_isShip )
{
v26 = 0.5875;
}
else if ( a1->m_isBird )
{
v26 = 0.725;
}
else if ( a1->m_isSwing )
{
v26 = 0.61538;
}
}
v27 = (float)((float)(v25 * a1->m_stateForceVector.y) * v26);
PlayerObject::addToYVelocity(a1, v27, 69);
if ( v27 != 0.0 )
a1->m_isAccelerating = 1;
if ( a1->m_isUpsideDown )
{
if ( v27 >= 0.0 )
goto LABEL_46;
}
else if ( v27 <= 0.0 )
{
LABEL_46:
if ( a1->m_isPlatformer )
{
v28 = a1->m_stateForceVector.x;
a1->m_platformerXVelocity = a1->m_platformerXVelocity + (float)(v28 * v25);
if ( v28 != 0.0 )
a1->m_affectedByForces = 1;
if ( PlayerObject::isInNormalMode(a1) && !a1->m_isRotating && fabsf(a1->m_stateForceVector.x) > 0.1 )
PlayerObject::runNormalRotation(a1, 1, 1.0);
}
goto LABEL_53;
}
a1->m_accelerationOrSpeed = a1->m_accelerationOrSpeed + v27 / 12.9399996 * 1.5;
goto LABEL_46;
}
}