Oh no’s One of my favorite games been crippled . I looked into why the problem is more severe and figured out it’s because analogWrite configures the LED pins as digital when maximum and minimum values are set. The new version sets the LED pins always to pwm.
I felt a little guilty about “crippling” Circuit Dude with the new version 5 Arduboy2 library, so I’ve modified it to use the BeepPin2 class for sound. The rising temperature sound is as smooth as the ArduboyPlaytune version, and the red RGB LED now increases in brightness as intended.
Just compiling the original code with Aruduboy2 library version 5.0.0 instead of 4.1.0 saves 634 bytes of program memory (and 7 bytes of RAM). This is mainly due to the optimised setRGBled() function in the new library release.
Changing sound from using the ArduboyPlaytune library to the BeepPin2 class saves another 2102 bytes of code and 32 bytes of RAM, for 2736 bytes of code and 39 bytes of RAM total. There is now enough program space to add 30 more levels, if @crait desired.
Unfortunately, @crait doesn’t want people publishing modified versions of Circuit Dude, so I can’t make my changes publicly available. I will send @crait a PM with a link to it, so he can apply and publish the changes himself if he wishes.
P.S. making other changes to optimise, as I’ve pointed out in previous posts in this topic, could save a bit more code.
Just finished the game! And I love the secret ending (I didn’t expect that) Great level design, I enjoyed every minute of the game! A must have for the Arduboy! Thanks @crait (even I hated you so much on some levels ) Now time to play it on Steam!