Skip to content

Commit

Permalink
Finished map in DriveTheBus
Browse files Browse the repository at this point in the history
  • Loading branch information
Jictyvoo committed Feb 7, 2019
1 parent 53f1bc2 commit a2ac9bc
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/controllers/gamemodes/BusStop/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 1 addition & 7 deletions src/controllers/gamemodes/DeficientElevator/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
Expand Down
65 changes: 63 additions & 2 deletions src/controllers/gamemodes/DriveTheBus/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a2ac9bc

Please sign in to comment.