Fixed some issues, mainly with the bouncing algorithm
hi Gerrit,
Thanks for accepting my previous PR! 🙂
I'm making this second PR to fix the following issues (most came from my previous PR, sorry!):
- Bonus S was not working anymore (because my previous PR was always applying ball full-speed)
- Mouse / touchscreen players could still control the paddle while moving out through the next level door
- Paddle speed influence was working for keyboard players, but not for mouse / touchscreen players
- Possible infinite loop in some rare cases
- Possible infinite ball position in some rare cases (and the ball was not removed, causing the game to be stuck)
- Some issues in computeBallHit(), especially when the ball is inside the bounds
Code simplification:
- enemies are now also included in the general bouncing algorithm (no need for an additional case anymore)
New feature:
- Mouse click = space bar (for mouse / touchscreen players)
I made more testing this time, and I think this version is pretty good, I didn't notice any fault.
But I think the ball is too slow. This video of the original game might be accelerated, but I think the ball goes much faster, so maybe we can double the default ball speed. What do you think?
Also I noticed in that video that shooting an enemy was increasing the score by 100. Can you do the same?
Final point: I asked this question on ChatGPT: what are the different bonuses in the game Arkanoid? Here is the answer that came out:
Arkanoid is a classic arcade game released by Taito in 1986. In the game, the player controls a paddle at the bottom of the screen and must bounce a ball to break through a wall of bricks. As the player progresses through the levels, they can earn different bonuses to aid them in their task. Here are some of the bonuses in Arkanoid:
1. Expand: This bonus increases the size of the player's paddle, making it easier to hit the ball.
2. Laser: This bonus adds a laser to the player's paddle, allowing them to shoot down bricks with greater accuracy.
3. Catch: This bonus allows the player's paddle to catch the ball, allowing for more precise shots.
4. Disrupt: This bonus slows down the speed of the ball, making it easier to hit.
5. Break: This bonus breaks all of the remaining bricks on the screen.
6. Extra Life: This bonus grants the player an additional life.
7. Barrier: This bonus adds a barrier to the player's paddle, allowing them to deflect the ball at different angles.
8. Slow: This bonus slows down the game's speed, making it easier to control.
9. Power Ball: This bonus makes the ball more powerful, allowing it to break through multiple bricks in one hit.
10. Score Bonus: This bonus grants the player additional points.
I don't know if you were aware of bonuses 5, 7, 9 & 10.