Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for Love 11 #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pong-1/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
modern systems.
]]

package.path = package.path .. ";../?.lua"

-- push is a library that will allow us to draw our game at a virtual
-- resolution, instead of however large our window is; used to provide
-- a more retro aesthetic
Expand Down
232 changes: 0 additions & 232 deletions pong-1/push.lua

This file was deleted.

14 changes: 13 additions & 1 deletion pong-10/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
modern systems.
]]

package.path = package.path .. ";../?.lua"

-- push is a library that will allow us to draw our game at a virtual
-- resolution, instead of however large our window is; used to provide
-- a more retro aesthetic
Expand Down Expand Up @@ -51,6 +53,16 @@ VIRTUAL_HEIGHT = 243
-- speed at which we will move our paddle; multiplied by dt in update
PADDLE_SPEED = 200

--[[
Love 11 compat
]]
function clear(r, g, b, a)
if love.getVersion() >= 11 then
r, g, b, a = r / 255, g / 255, b / 255, a / 255
end
love.graphics.clear(r, g, b, a)
end

--[[
Runs when the game first starts up, only once; used to initialize the game.
]]
Expand Down Expand Up @@ -255,7 +267,7 @@ function love.draw()

-- clear the screen with a specific color; in this case, a color similar
-- to some versions of the original Pong
love.graphics.clear(40, 45, 52, 255)
clear(40, 45, 52, 255)

love.graphics.setFont(smallFont)

Expand Down
Loading