Hey,
i decided to make a space invaders game after seeing someone else trying on here.
Everything works up to now pretty much.
There is just one problem with the movement.
When i go right and reach the boundary it stops as it should.
When i go left though when i reach the boundary the character moves back right one space instead of staying where it is.
The code for both is practically identical.
I was wondering if anyone knows the cause ?
Any other criticisms are welcome :)
Don't think its that.
Because even if i had it set to 10 or whatever it's moving when it shouldn't be in the opposite direction to the way it should be.
I think you'd have to run the code to understand what i mean.
Thanks anyway
In physics.cpp the switch-case statement has the break in the wrong place.
Because it was inside the block controlled by the if statement, when the condition is false, control falls through and executes the following case -in this case it executes the code for case 'd' as well.