mike: Added colors; made ball a ball

This commit is contained in:
Logen Kain 2017-07-25 21:47:00 -07:00
parent e7bc457cd5
commit 47d1c9192e

View File

@ -15,7 +15,7 @@ function love.load()
-- Create a table to hold all the player data -- Create a table to hold all the player data
actors.player = create_object(screen.width /2, screen.height - 50, 30, 5, 500) actors.player = create_object(screen.width /2, screen.height - 50, 30, 5, 500)
-- Create a table to hold ball data -- 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.x_speed = (actors.ball.speed /2)
actors.ball.y_speed = (actors.ball.speed /2) actors.ball.y_speed = (actors.ball.speed /2)
@ -29,10 +29,12 @@ end
function love.draw() function love.draw()
--Draw paddle --Draw paddle
love.graphics.setColor(255,255,255)
love.graphics.rectangle("line", actors.player.x, actors.player.y, love.graphics.rectangle("line", actors.player.x, actors.player.y,
actors.player.width, actors.player.height) actors.player.width, actors.player.height)
--Draw ball --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) actors.ball.width, actors.ball.height)
--FPS counter --FPS counter
love.graphics.print("FPS: "..tostring(love.timer.getFPS( )), 10, 10) love.graphics.print("FPS: "..tostring(love.timer.getFPS( )), 10, 10)