pastthepixels / InfiniteShooter

A simplistic shooter made with the Godot engine.
https://pastthepixels.itch.io/infiniteshooter
GNU General Public License v3.0
18 stars 3 forks source link

Bug: Saving does not take into account difficulties #27

Closed pastthepixels closed 1 year ago

pastthepixels commented 1 year ago

So as soon as I merged my code for saving games I noticed a bug with it :(

Describe the bug When you save a game, it saves certain variables from Game.tscn that are initially set when you set the difficulty of the game. Therefore it shouldn't be tampered with for the rest of the run... but you can actually save it and go to the main menu, change the difficulty of the game, and then mess up some values when you load the save. This can be especially apparent under the "carnage" difficulty where InfiniteShooter will then save the game with variables changed. So, for a game that was in Medium difficulty, you can exit and come back to it in carnage, but when you save that again it will save the number of enemies that should be on the screen at one time. So something in medium difficulty will perpetually be stuck on a harder one!

To Reproduce Steps to reproduce the behavior:

  1. Create a save on any difficulty (ex. medium)
  2. Play a bit of the game (because why not?)
  3. Now, save and exit back to the main menu
  4. Open the settings dialog and set the difficulty to something else (ex. carnage)
  5. Watch it affect your save in unintended ways

Desktop:

pastthepixels commented 1 year ago

Update: Just fixed the bug and added a couple indicators of my changes in the GUI for the game. Usually I wait before merging feature requests to see if they're stable enough, but since this is a bug fix I can just merge this now. (Plus I've tested the game and everything works as expected.)