From 3d1356eec38881e0ff0ed1355732337de7e31bed Mon Sep 17 00:00:00 2001 From: Beppe Vanrolleghem Date: Thu, 30 Aug 2018 00:42:55 +0200 Subject: [PATCH] fixed the 3ds ratio stuff using the screens, using getwidth after setting the right screen fixed the issue, but the resolution we use in the lovegame is diff then the 3ds resolution therefore the vgrid had to be adjusted, should prob implement a love.conf for pc versions to keep it the same. --- main.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/main.lua b/main.lua index e323228..70adf30 100644 --- a/main.lua +++ b/main.lua @@ -5,7 +5,7 @@ diff = 10 frames = 0 fps = 1/diff hgrid = 20 -vgrid = 14 +vgrid = 11 bgCol = { r = 0, g = 0, @@ -45,6 +45,8 @@ function player:hardreset() self.x = 10 self.y = 10 self.blocks = {} + love.graphics.setScreen("top") + self.w = love.graphics.getWidth()/hgrid end function player:move(xvel, yvel) @@ -57,11 +59,11 @@ function player:move(xvel, yvel) end function player:update() - if self.x > hgrid +4 then + if self.x > hgrid then self.x = 0 end if self.x < 0 then - self.x = hgrid+4 + self.x = hgrid end if self.y > vgrid then self.y = 0 @@ -71,7 +73,7 @@ function player:update() end if self.tar.x == self.x and self.tar.y == self.y then table.insert(self.blocks, {x = self.x, y = self.y}) - self.tar.x = math.floor(math.random() * (hgrid+4)) + self.tar.x = math.floor(math.random() * (hgrid)) self.tar.y = math.floor(math.random() * vgrid) beep:play() end