mirror of
https://github.com/bvanroll/3dsStuff.git
synced 2025-08-29 20:02:41 +00:00
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:
10
main.lua
10
main.lua
@@ -5,7 +5,7 @@ diff = 10
|
|||||||
frames = 0
|
frames = 0
|
||||||
fps = 1/diff
|
fps = 1/diff
|
||||||
hgrid = 20
|
hgrid = 20
|
||||||
vgrid = 14
|
vgrid = 11
|
||||||
bgCol = {
|
bgCol = {
|
||||||
r = 0,
|
r = 0,
|
||||||
g = 0,
|
g = 0,
|
||||||
@@ -45,6 +45,8 @@ function player:hardreset()
|
|||||||
self.x = 10
|
self.x = 10
|
||||||
self.y = 10
|
self.y = 10
|
||||||
self.blocks = {}
|
self.blocks = {}
|
||||||
|
love.graphics.setScreen("top")
|
||||||
|
self.w = love.graphics.getWidth()/hgrid
|
||||||
end
|
end
|
||||||
|
|
||||||
function player:move(xvel, yvel)
|
function player:move(xvel, yvel)
|
||||||
@@ -57,11 +59,11 @@ function player:move(xvel, yvel)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function player:update()
|
function player:update()
|
||||||
if self.x > hgrid +4 then
|
if self.x > hgrid then
|
||||||
self.x = 0
|
self.x = 0
|
||||||
end
|
end
|
||||||
if self.x < 0 then
|
if self.x < 0 then
|
||||||
self.x = hgrid+4
|
self.x = hgrid
|
||||||
end
|
end
|
||||||
if self.y > vgrid then
|
if self.y > vgrid then
|
||||||
self.y = 0
|
self.y = 0
|
||||||
@@ -71,7 +73,7 @@ function player:update()
|
|||||||
end
|
end
|
||||||
if self.tar.x == self.x and self.tar.y == self.y then
|
if self.tar.x == self.x and self.tar.y == self.y then
|
||||||
table.insert(self.blocks, {x = self.x, y = self.y})
|
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)
|
self.tar.y = math.floor(math.random() * vgrid)
|
||||||
beep:play()
|
beep:play()
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user