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.

This commit is contained in:
2018-08-30 00:42:55 +02:00
parent 0e0c97b4e2
commit 3d1356eec3

View File

@@ -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