Skip to content
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
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"Lua.workspace.library": [
"${addons}/love2d/module/library"
],
"Lua.runtime.version": "LuaJIT",
"Lua.runtime.special": {
"love.filesystem.load": "loadfile"
},
"Lua.workspace.checkThirdParty": false
}
4 changes: 4 additions & 0 deletions make_love_file.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env pwsh
Set-Location -Path $PSScriptRoot
Set-Location -Path .\pacpac
Compress-Archive -Path * -DestinationPath ..\pacpac.love -Force
10 changes: 3 additions & 7 deletions make_love_file.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#!/bin/bash
#
# Hehe.
#

cd "$( dirname "${BASH_SOURCE[0]}" )"
cd pacpac
zip -r ../pacpac.love *
cd "$( dirname "${BASH_SOURCE[0]}" )" || exit
cd pacpac || exit
zip -r ../pacpac.love ./*
Binary file modified pacpac.love
Binary file not shown.
10 changes: 5 additions & 5 deletions pacpac/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ end
-- This is a workaround for an infrequent but annoying audio bug where clips
-- simply stop playing and need to be recreated as new objects.
function PacSource:play()
if self.src:isPaused() or self.src:isStopped() then
if not self.src:isPlaying() then
self.src:play()
end
if self.src:isPaused() then
if not self.src:isPlaying() then
-- Here is the workaround. Theoretically, this block should never happen.
-- But it does.
local is_looping = self.src:isLooping()
Expand All @@ -131,13 +131,13 @@ function PacSource:play()
end

function PacSource:pause()
if not self.src:isPaused() and not self.src:isStopped() then
if self.src:isPlaying() then
self.src:pause()
end
end

function PacSource:setLooping(should_loop) self.src:setLooping(should_loop) end
function PacSource:isPaused() return self.src:isPaused() end
function PacSource:isPaused() return not self.src:isPlaying() end
function PacSource:setVolume(volume) self.src:setVolume(volume) end
function PacSource:stop() self.src:stop() end
function PacSource:rewind() self.src:rewind() end
Expand Down Expand Up @@ -788,7 +788,7 @@ function draw_controls()
end

function load_hi_score()
if not love.filesystem.exists('hi_score') then
if love.filesystem.getInfo('hi_score') == nil then
hi_score = 1000
return
end
Expand Down
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ There are 3 mazes to play through. This is thrice as
many as the original pac-man :)

You need the [löve](http://love2d.org) game engine to play. The current code is written for löve
v0.9.2.
v11.5.

The original code was written in under 24 hours as a challenge.
My wife didn't believe I could make a pac-man-like game in a day.
Here's a fun [first 24-hour evolution of the game in screenshots](http://tylerneylon.com/pacpac/).

## How to install and run

1. Download and install [löve](http://love2d.org). (Current code has been tested with löve v0.9.2.)
1. Download and install [löve](http://love2d.org). (Current code has been tested with löve v11.5.)
2. Download and unzip the [zipfile of this repo](https://github.com/tylerneylon/pacpac/archive/master.zip).
3. Double-click the file `pacpac.love`.
Alternatively, in OS X and Ubuntu, type `love pacpac.love` from the command line - which assumes
Expand Down Expand Up @@ -128,4 +128,4 @@ This game uses the font 8bitoperator created by
[CC-BY-SA](http://creativecommons.org/licenses/by-sa/2.0/) license.

Thanks to [jonfk](https://github.com/jonfk) for upgrading the code
for löve v0.9.2.
for löve v11.5.