Sheepolution / how-to-love

LÖVE tutorials
MIT License
98 stars 25 forks source link

Chapter 21 - Saving and loading #35

Closed Rmtdi closed 1 month ago

Rmtdi commented 1 month ago

In “Loading”, I met some trouble. After I saving the game, and I pressed F2 to restart it, I found here are some coins that were not killed properly. For example, if I eat two coins, only one disappears after saving and loading, two disappears if I eat four, and four disappears after eating eight....... I have a few clues, but I still can't solve this problem. Is it the reason for the difference between the saved coins data and the number of coins initialized in the load? Please help me ;( saving&loading.zip

Rmtdi commented 1 month ago

Oh,sorry. I know why. This is because I didn't add "else" after reading file.