mike: Added colors; made ball a ball
This commit is contained in:
parent
e7bc457cd5
commit
47d1c9192e
@ -15,7 +15,7 @@ function love.load()
|
||||
-- Create a table to hold all the player data
|
||||
actors.player = create_object(screen.width /2, screen.height - 50, 30, 5, 500)
|
||||
-- Create a table to hold ball data
|
||||
actors.ball = create_object(screen.width /2, screen.height /2, 1, 1, 600)
|
||||
actors.ball = create_object(screen.width /2, screen.height /2, 5, 10, 600)
|
||||
actors.ball.x_speed = (actors.ball.speed /2)
|
||||
actors.ball.y_speed = (actors.ball.speed /2)
|
||||
|
||||
@ -29,10 +29,12 @@ end
|
||||
|
||||
function love.draw()
|
||||
--Draw paddle
|
||||
love.graphics.setColor(255,255,255)
|
||||
love.graphics.rectangle("line", actors.player.x, actors.player.y,
|
||||
actors.player.width, actors.player.height)
|
||||
--Draw ball
|
||||
love.graphics.rectangle("line", actors.ball.x, actors.ball.y,
|
||||
love.graphics.setColor(255,0,0)
|
||||
love.graphics.circle("line", actors.ball.x, actors.ball.y,
|
||||
actors.ball.width, actors.ball.height)
|
||||
--FPS counter
|
||||
love.graphics.print("FPS: "..tostring(love.timer.getFPS( )), 10, 10)
|
||||
|
Loading…
x
Reference in New Issue
Block a user