summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--animation.lua3
-rw-r--r--conf.lua41
-rw-r--r--main.lua2
-rw-r--r--player.lua2
-rw-r--r--world.lua6
5 files changed, 47 insertions, 7 deletions
diff --git a/animation.lua b/animation.lua
index 7d77d40..58cb356 100644
--- a/animation.lua
+++ b/animation.lua
@@ -44,7 +44,6 @@ function Animation:reset()
self.currentTime = 0
end
--- Returns true only for non-looping animations that have played through once.
function Animation:isFinished()
return self.looping == false and self.currentTime >= self.duration
end
@@ -62,7 +61,7 @@ function Animation:draw(x, y, flipHorizontal)
local ox = flipHorizontal and self.frameWidth or 0
local oy = 0
- love.graphics.draw(self.spriteSheet, quad, x, y, 0, sx, sy, ox, oy)
+ love.graphics.draw(self.spriteSheet, quad, math.floor(x), math.floor(y), 0, sx, sy, ox, oy)
end
return Animation
diff --git a/conf.lua b/conf.lua
new file mode 100644
index 0000000..c41f6d6
--- /dev/null
+++ b/conf.lua
@@ -0,0 +1,41 @@
+function love.conf(t)
+ t.identity = nil -- The name of the save directory (string)
+ t.appendidentity = false -- Search files in source directory before save directory (boolean)
+ t.version = "11.5" -- The LÖVE version this game was made for (string)
+ t.console = false -- Attach a console (boolean, Windows only)
+ t.accelerometerjoystick = true -- Enable the accelerometer on iOS and Android by exposing it as a Joystick (boolean)
+ t.externalstorage = false -- True to save files (and read from the save directory) in external storage on Android (boolean)
+ t.gammacorrect = false -- Enable gamma-correct rendering, when supported by the system (boolean)
+
+ t.audio.mic = false -- Request and use microphone capabilities in Android (boolean)
+ t.audio.mixwithsystem = true -- Keep background music playing when opening LOVE (boolean, iOS and Android only)
+
+ t.window.vsync = 1 -- Vertical sync mode (number)
+ t.window.msaa = 0 -- The number of samples to use with multi-sampled antialiasing (number)
+ t.window.depth = nil -- The number of bits per sample in the depth buffer
+ t.window.stencil = nil -- The number of bits per sample in the stencil buffer
+ t.window.display = 1 -- Index of the monitor to show the window in (number)
+ t.window.highdpi = false -- Enable high-dpi mode for the window on a Retina display (boolean)
+ t.window.usedpiscale = true -- Enable automatic DPI scaling when highdpi is set to true as well (boolean)
+ t.window.x = nil -- The x-coordinate of the window's position in the specified display (number)
+ t.window.y = nil -- The y-coordinate of the window's position in the specified display (number)
+
+ t.modules.audio = true -- Enable the audio module (boolean)
+ t.modules.data = true -- Enable the data module (boolean)
+ t.modules.event = true -- Enable the event module (boolean)
+ t.modules.font = true -- Enable the font module (boolean)
+ t.modules.graphics = true -- Enable the graphics module (boolean)
+ t.modules.image = true -- Enable the image module (boolean)
+ t.modules.joystick = true -- Enable the joystick module (boolean)
+ t.modules.keyboard = true -- Enable the keyboard module (boolean)
+ t.modules.math = true -- Enable the math module (boolean)
+ t.modules.mouse = true -- Enable the mouse module (boolean)
+ t.modules.physics = true -- Enable the physics module (boolean)
+ t.modules.sound = true -- Enable the sound module (boolean)
+ t.modules.system = true -- Enable the system module (boolean)
+ t.modules.thread = true -- Enable the thread module (boolean)
+ t.modules.timer = true -- Enable the timer module (boolean), Disabling it will result 0 delta time in love.update
+ t.modules.touch = true -- Enable the touch module (boolean)
+ t.modules.video = true -- Enable the video module (boolean)
+ t.modules.window = true -- Enable the window module (boolean)
+end \ No newline at end of file
diff --git a/main.lua b/main.lua
index d014b96..c0e6108 100644
--- a/main.lua
+++ b/main.lua
@@ -1,7 +1,7 @@
local VIRTUAL_WIDTH, VIRTUAL_HEIGHT = 16*10*3, 9*10*3
local CANVAS_PADDING = 6
-DEBUG = false
+DEBUG = true
local CANVAS_WIDTH = VIRTUAL_WIDTH + CANVAS_PADDING
local CANVAS_HEIGHT = VIRTUAL_HEIGHT + CANVAS_PADDING
diff --git a/player.lua b/player.lua
index 4e39f21..7995cc6 100644
--- a/player.lua
+++ b/player.lua
@@ -23,7 +23,7 @@ function Player.new(world, spawnX, spawnY)
self.animations = {
idle = Animation.new("assets/player/idle.png", 16, 16, 0.6),
- running = Animation.new("assets/player/running.png", 16, 16, 1),
+ running = Animation.new("assets/player/running.png", 16, 16, 0.9),
going_up = Animation.new("assets/player/going_up.png", 16, 16, 0.8),
going_down = Animation.new("assets/player/going_down.png", 16, 16, 0.5),
stop_running = Animation.new("assets/player/stop_running.png", 16, 16, 0.3),
diff --git a/world.lua b/world.lua
index c7f2fe4..16324bb 100644
--- a/world.lua
+++ b/world.lua
@@ -303,8 +303,8 @@ function World.drawPhysicsBodyOutlines(entityList)
local body = e.body
if body and e.physicsWidth and e.physicsHeight then
local cx, cy = body:getX(), body:getY()
- local x = cx - e.physicsWidth / 2
- local y = cy - e.physicsHeight / 2
+ local x = math.floor(cx - e.physicsWidth / 2)
+ local y = math.floor(cy - e.physicsHeight / 2)
love.graphics.rectangle("line", x, y, e.physicsWidth, e.physicsHeight)
end
end
@@ -316,7 +316,7 @@ function World.drawEntityDefault(entity)
if entity.isPlayer then
love.graphics.setColor(1, 0.3, 0.2, 1)
end
- love.graphics.rectangle("fill", entity.x, entity.y, entity.width, entity.height)
+ love.graphics.rectangle("fill", math.floor(entity.x), math.floor(entity.y), entity.width, entity.height)
love.graphics.setColor(1, 1, 1, 1)
end