diff --git a/src/controllers/gamemodes/BusStop/init.lua b/src/controllers/gamemodes/BusStop/init.lua index 62dfde0..ec85906 100644 --- a/src/controllers/gamemodes/BusStop/init.lua +++ b/src/controllers/gamemodes/BusStop/init.lua @@ -51,7 +51,7 @@ end function GameController:keypressed(key, scancode, isrepeat) if key == "space" then - if self.x >= 296 - 10 and self.x <= 296 + 10 then + if self.x >= 296 - 30 and self.x <= 296 + 30 then if self.currentStop == self.requestedStop then self.requestedStop = love.math.random(1, #self.busStops); self.score = self.score + 1 else diff --git a/src/controllers/gamemodes/DeficientElevator/init.lua b/src/controllers/gamemodes/DeficientElevator/init.lua index ac76806..f0a5d46 100644 --- a/src/controllers/gamemodes/DeficientElevator/init.lua +++ b/src/controllers/gamemodes/DeficientElevator/init.lua @@ -16,7 +16,7 @@ function GameController:new(world) background = love.graphics.newImage("assets/sprites/DeficientElevator/bus_background.png"), elevator = love.graphics.newImage("assets/sprites/DeficientElevator/elevator.png"), wheelchair = gameDirector:getLibrary("Pixelurite").configureSpriteSheet("wheelchair", "assets/sprites/DeficientElevator/", true, nil, 1, 1, true), - elapsedTime = 0, tx = 0, ty = 0, + elapsedTime = 0, score = 0, currentState = 0, driverSprite = gameDirector:getLibrary("Pixelurite").configureSpriteSheet("driver", "assets/sprites/DeficientElevator/", true, nil, 1, 1, true) } @@ -61,12 +61,6 @@ end function GameController:keyreleased(key, scancode) end -function GameController:mousemoved(x, y, dx, dy, istouch) - self.tx = x - self.ty = y - print(x, y) -end - function GameController:update(dt) self.elapsedTime = self.elapsedTime + dt self.driverSprite:update(dt) diff --git a/src/controllers/gamemodes/DriveTheBus/init.lua b/src/controllers/gamemodes/DriveTheBus/init.lua index fe0f7b5..9cca992 100644 --- a/src/controllers/gamemodes/DriveTheBus/init.lua +++ b/src/controllers/gamemodes/DriveTheBus/init.lua @@ -34,7 +34,7 @@ function GameController:new(world) gamemodeController = nil, waitTime = love.math.random(1.5, 6) } - this.cameraController = gameDirector:getLibrary("CameraController"):new(this.busHead, this.mapSize, 0.33) + this.cameraController = gameDirector:getLibrary("CameraController"):new(this.busHead, this.mapSize, 1) world:addCallback("DriveTheBus", beginContact, "beginContact") world:changeCallbacks("DriveTheBus") @@ -76,6 +76,67 @@ function GameController:new(world) table.insert(this.invisibleWall, Wall:new(world.world, 1340, 1020, {w = 10, h = 280})) table.insert(this.invisibleWall, Wall:new(world.world, 1240, 1540, {w = 10, h = 200})) table.insert(this.invisibleWall, Wall:new(world.world, 1340, 1540, {w = 10, h = 180})) + table.insert(this.invisibleWall, Wall:new(world.world, 1530, 800, {w = 10, h = 440})) + table.insert(this.invisibleWall, Wall:new(world.world, 1630, 800, {w = 10, h = 440})) + table.insert(this.invisibleWall, Wall:new(world.world, 1670, 800, {w = 10, h = 440})) + table.insert(this.invisibleWall, Wall:new(world.world, 1770, 800, {w = 10, h = 440})) + table.insert(this.invisibleWall, Wall:new(world.world, 2240, 870, {w = 10, h = 310})) + table.insert(this.invisibleWall, Wall:new(world.world, 2350, 870, {w = 10, h = 310})) + table.insert(this.invisibleWall, Wall:new(world.world, 2100, 1450, {w = 10, h = 310})) + table.insert(this.invisibleWall, Wall:new(world.world, 2210, 1450, {w = 10, h = 310})) + table.insert(this.invisibleWall, Wall:new(world.world, 1820, 1250, {w = 10, h = 150})) + table.insert(this.invisibleWall, Wall:new(world.world, 1920, 1250, {w = 10, h = 150})) + table.insert(this.invisibleWall, Wall:new(world.world, 1960, 510, {w = 10, h = 150})) + table.insert(this.invisibleWall, Wall:new(world.world, 2070, 510, {w = 10, h = 150})) + table.insert(this.invisibleWall, Wall:new(world.world, 2210, 505, {w = 10, h = 150})) + table.insert(this.invisibleWall, Wall:new(world.world, 2110, 515, {w = 10, h = 150})) + table.insert(this.invisibleWall, Wall:new(world.world, 1590, 1160, {w = 180, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 420, 895, {w = 180, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 435, 1045, {w = 180, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 2080, 1045, {w = 320, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 345, 1155, {w = 320, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 1725, 470, {w = 320, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 425, 1015, {w = 160, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 2165, 1155, {w = 160, h = 10})) + table.insert(this.invisibleWall, Wall:new(world.world, 585, 1090, {w = 160, h = 10}, nil, 0.653599)) + table.insert(this.invisibleWall, Wall:new(world.world, 580, 350, {w = 160, h = 10}, nil, -0.503599)) + table.insert(this.invisibleWall, Wall:new(world.world, 835, 670, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 1280, 800, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 1430, 1080, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 1855, 1105, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 1290, 1380, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 2710, 955, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 105, 1400, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 1555, 530, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 1885, 1405, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 2180, 1695, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 2030, 675, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 1745, 1095, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 1455, 1240, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 1010, 1540, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 585, 960, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 2315, 1105, {w = 160, h = 10}, nil, -0.8035)) + table.insert(this.invisibleWall, Wall:new(world.world, 710, 1225, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 1000, 1230, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 1290, 1695, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 130, 1540, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 560, 1260, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 135, 1115, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 855, 1260, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 1270, 235, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 1865, 680, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 2155, 680, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 1275, 1250, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 2005, 1255, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 2155, 1220, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 1460, 670, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 2020, 220, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 2295, 640, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 2160, 360, {w = 160, h = 10}, nil, 0.6535)) + table.insert(this.invisibleWall, Wall:new(world.world, 1900, 530, {w = 160, h = 10}, nil, 0.7535)) + table.insert(this.invisibleWall, Wall:new(world.world, 745, 1365, {w = 160, h = 10}, nil, 1.8535)) + table.insert(this.invisibleWall, Wall:new(world.world, 260, 960, {w = 160, h = 10}, nil, 2.2535)) + table.insert(this.invisibleWall, Wall:new(world.world, 1440, 820, {w = 160, h = 10}, nil, 2.2535)) this = setmetatable(this, GameController) for count = 1, 6 do @@ -142,7 +203,7 @@ function GameController:draw() self.cameraController:draw(function() love.graphics.draw(self.background, 0, 0) for _, wall in pairs(self.walls) do wall:draw() end - for _, wall in pairs(self.invisibleWall) do wall:draw() end + --for _, wall in pairs(self.invisibleWall) do wall:draw() end self.busHead:draw() for _, passenger in pairs(self.passengers) do passenger:draw() diff --git a/src/controllers/gamemodes/DriveTheBus/models/entities/Passenger.lua b/src/controllers/gamemodes/DriveTheBus/models/entities/Passenger.lua index da7e1f5..98937b7 100644 --- a/src/controllers/gamemodes/DriveTheBus/models/entities/Passenger.lua +++ b/src/controllers/gamemodes/DriveTheBus/models/entities/Passenger.lua @@ -34,7 +34,7 @@ end function Passenger:draw() --love.graphics.circle("line", self.body:getX(), self.body:getY(), 10) - love.graphics.draw(self.sprite, self.body:getX(), self.body:getY(), 0, 1 , 1, 10, 10) + love.graphics.draw(self.sprite, self.body:getX(), self.body:getY(), 0, 1 , 1, 20, 20) end return Passenger