Skip to content

Commit

Permalink
fix: Updated core sprite
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminHalko committed Jun 25, 2024
1 parent 0fd61b8 commit 61e24f6
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/entities/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,24 @@ void CoreUpdate(Entity& self) {

ZoomSprite(sprite, originalSprite, Global::zoom);

// Update sprite center zoom
for(int i = 3 * 6; i < sprite.Size(); i++) {
sprite[i].point.x *= fmax(0.01f, CameraSystem::zoom - 1.0f) * 0.2f;
sprite[i].point.y *= fmax(0.01f, CameraSystem::zoom - 1.0f) * 0.2f;
}

// Update Sprite
for(auto &point : sprite)
point.color = MergeColors(
MakeColor(Global::lastHue, 1.0, point.alpha),
MakeColor(Global::hue, 1.0, point.alpha),
Global::hueShift
);

// Update sprite center zoom
for(int i = 3 * 6; i < sprite.Size(); i++) {
sprite[i].point.x *= fmax(0.001f, CameraSystem::zoom - 1.0f) * 0.2f;
sprite[i].point.y *= fmax(0.001f, CameraSystem::zoom - 1.0f) * 0.2f;
sprite[i].color = MergeColors(
MakeColor(Global::lastHue, 1.0, sprite[i].alpha * (float)Clamp((CameraSystem::zoom-1.0f) * 5, 0.0, 1.0)),
MakeColor(Global::hue, 1.0, sprite[i].alpha * (float)Clamp((CameraSystem::zoom-1.0f) * 5, 0.0, 1.0)),
Global::hueShift
);
}
}

// Creates a core entity (middle you rotate around)
Expand Down

0 comments on commit 61e24f6

Please sign in to comment.