mike: Rewrote paddle col detection; removed comments; less reliance on global variables

This commit is contained in:
2017-07-25 18:31:15 -07:00
parent ff386b2c75
commit beb04e1451
3 changed files with 61 additions and 33 deletions

View File

@@ -10,18 +10,18 @@ function love.load()
screen.height = love.graphics.getHeight()
-- Create a table to hold all the player data
player = create_object(screen.width /2, screen.height - 50, 25, 5, 10)
player = create_object(screen.width /2, screen.height - 50, 30, 5, 10)
-- Create a table to hold ball data
ball = create_object(screen.width /2, screen.height /2, 1, 1, 10)
ball.x_speed = ball.speed /2
ball.y_speed = ball.speed /2
ball.x_speed = (ball.speed /2)
ball.y_speed = (ball.speed /2)
end
function love.update(dt)
player = check_keys(player)
ball = ball_bounce(ball)
player = check_keys(player, screen)
ball = ball_bounce(player, ball)
end
function love.draw()