Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Fix minor bugs with hair and SFX #5

Merged
merged 1 commit into from
Jan 10, 2021
Merged

Fix minor bugs with hair and SFX #5

merged 1 commit into from
Jan 10, 2021

Conversation

ayuusweetfish
Copy link
Contributor

Hi! I am porting ccleste to other platforms with raylib, and have spotted issues with simple fixes. Details are as follows.

(1) SFX 9 should be played on triggering an invalid dash

This is caused by mistranslation of a block at line 279 of the original code.

    if this.spd.x!=0 then
     this.dash_accel.y*=0.70710678118
    end
   elseif dash and this.djump<=0 then
    psfx(9)
    init_object(smoke,this.x,this.y)
   end

The elseif is not paired with the if (as there is already an end); it is for the outer one. This can be very misleading if tabstop is set to 2 🤣

(2) The last circle for the character's hair is not drawn

The original game draws 5 circles, but ccleste draws only 4.

There are similar structures (looping with while (!isLast) to emulate foreach in the original Lua code) for clouds and particles. This issue does not affect clouds, as only the 25th cloud in the stage will disappear, and there are not as many clouds in-game; but for particles I have not looked into more details. Maybe I will update the commit later.

1. SFX 9 should be played on triggering an invalid dash;
2. The last circle for the character's hair is not drawn.
@lemon32767
Copy link
Owner

Thanks for the contribution! Admittedly, the code isn't well formatted, so I completely missed that misleading elseif, and I took a very lazy approach to translating those foreach loops, which naturally ended up being error prone 😅.

As for the other effects, the game uses 17 clouds and 25 particles, and I believe I'm making the same off-by-one error and processing only 16 and 24 respectively, looking at it now. I'll correct all of the while (!isLast) to ensure correctness.

@lemon32767 lemon32767 merged commit f4da7bb into lemon32767:master Jan 10, 2021
@lemon32767
Copy link
Owner

Commit ffe6229 should ensure clouds and particles don't have the same issue. Thanks again for the pull request!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants