I took a look through the code, I'd recommend changing the following (and anything similar):
This is an easy mistake to make, as it's not a recognizable problem until you change computers. This code moves the paddle 5 pixels per frame. If you're running the game on a computer at 30fps, this means the paddle will move at 30*5 = 150 pixels per second. However, if you then run the same code on a computer at 60 fps, the paddle will move at 60*5 = 300 pixels per second.
So, by using two different computers at two different framerates, your game will feel different on both. This is obviously not the optimal game experience, you want the game to feel the same no matter what machine you play it on.
The way to fix this is with a thing called "delta-time". This is the amount of time from 1 frame of your game to another. So if you're running at 1 frame per second, dt (delta-time) will equal 1. 2 frames per second, dt will equal 1/2 = .5. 30fps, dt will equal 1/30, or .0333, you get the idea.
You can get dt by changing your love.update declaration to
Then, whenever you move an object in the update function you should multiply the value by dt, like so:
Code: Select all
paddle.left.y = paddle.left.y - 5*dt
This changes the operation so that instead of your paddle moving 5 pixels per frame, your paddle will move 5 pixels per second, which therefore makes the value equal across all framerates. You'll then need to scale up the value (because I assume you weren't used to your game running at 1 fps), but nevertheless, that scaled value will work similarly across all framerates.
Just one extra step to making a better game. Let me know if you have any other questions.