Currently doing my third game project. It's a simple twitch-based game (not the streaming service). You basically change your color to "phase through" the falling blocks. Technically, I've done all of the core mechanics that I need (minus the collisions) but the way I'm trying to reset certain variables to their defaults are causing some slow down bug.
The bug is that when am restarting for a new game, there are still some left over blocks from the previous instance that are slowly falling down instead of not being there.
I was wondering if it's how I've programmed the game and specifically the resetting of values that's causing this issue? I really want you guys two cents on this one. (While we're at it, I would really appreciate it if someone would discuss to me the best way of handling the reloads, as well as any stupid or improper thing I've done)
So this is how you can replicate the bug:
- Start a New Game.
- On the Game State, wait until there are at least 2 blocks on the screen.
- When there are at least 2 blocks on the screen, press the "Escape" button to pause the game.
- On the pause screen, press "Escape" again to return to the Title screen.
- Start a New Game again.
EDIT: I'm not using any libraries btw and I would currently refuse to do so for this project for the sake of learning.
Thanks in advance to anyone who is going to reply to this post.
Also please pretend that I'm a five year old when explaining stuff to me if that's okay
Huge shoutout to xNick whose been entertaining my questions for the past few days now
If you're wondering why I'm not messaging him again about this, it's because I already feel bad for asking a lot of consecutive questions XD