Skip to content

Commit

Permalink
Invert the flipping sprite/gravity, and make it a setting.
Browse files Browse the repository at this point in the history
  • Loading branch information
rgc-exists committed Nov 23, 2024
1 parent 5c9873d commit a42ce71
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.0.3
* Make it so the player is flipped when in REGULAR gravity, since the swingcopters face up and it feels confusing without it.
* Make that feature a setting.

# 1.0.2
* remove extra debug message from testing

Expand Down
8 changes: 7 additions & 1 deletion mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"id": "rgc_exists.swingcopter_flip",
"name": "Swingcopter Flip",
"version": "v1.0.2",
"version": "v1.0.3",
"developer": "RGC Exists",
"description": "Flips the player's visuals upside down when gravity is reversed in swingcopter mode. Makes it easier to keep track of what your gravity is.",
"tags": ["offline", "customization"],
Expand All @@ -19,6 +19,12 @@
"description": "Whether or not the mod is enabled. Turning this off will remove the flipping.",
"default": true
},
"invert-flip": {
"type": "bool",
"name": "Flip Sprite When Right Side Up",
"description": "Flip the sprite when the player is in REGULAR gravity. Most swingcopter icons face up so it can feel confusing without it.",
"default": true
},
"subtle-rotation": {
"type": "bool",
"name": "Subtle Rotation Animation",
Expand Down
5 changes: 3 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,18 @@ class $modify(PlayerObject) {

if (modEnabled) {
if (m_isSwing) {

m_fields->m_switchTimer = 0;
m_fields->m_flipDirection = (flipped ? -1 : 1);
m_fields->m_switchRotSpeed = switchRotMultiplier;

}
}
return PlayerObject::flipGravity(flipped, p1);
}

void flipSprites(bool flipped) {
bool invertFlip = Mod::get()->getSettingValue<bool>("invert-flip");
if (invertFlip) flipped = !flipped;

m_iconSprite->setFlipY(flipped);
m_iconSpriteSecondary->setFlipY(flipped);
m_iconSpriteWhitener->setFlipY(flipped);
Expand Down

0 comments on commit a42ce71

Please sign in to comment.