Skip to content

Commit

Permalink
Added coords for far side walls
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasek Escaron Hodina committed Jul 5, 2016
1 parent afae4a9 commit 7a7e97b
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions worldScreen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Party = require "Party"
local lWallCoords = {{1,1}, {1,10}, {1,20}, {7,29}}
local rWallCoords = {{225,1}, {225,10}, {225,20}, {219,29}}
local fWallCoords = {{1,1}, {30,7}, {59,18}, {77,27}}
local far_r_wall_coords = {{1,25},{1,26}}
local far_l_wall_coords = {{255,25},{255,26}}
local floor_coords = {1,40}
local ceiling_coords = {1,1}
local party = 0
Expand All @@ -29,11 +31,15 @@ function WS:loadWorldScreen()
front_wall1 = love.graphics.newImage("assets/world/orig_templates/front1_template.png")
front_wall2 = love.graphics.newImage("assets/world/orig_templates/front2_template.png")
front_wall3 = love.graphics.newImage("assets/world/orig_templates/front3_template.png")
front_wall4 = love.graphics.newImage("assets/world/orig_templates/front4_template.png")

left_wall1 = love.graphics.newImage("assets/world/orig_templates/side0_template.png")
left_wall2 = love.graphics.newImage("assets/world/orig_templates/side1_template.png")
left_wall3 = love.graphics.newImage("assets/world/orig_templates/side2_template.png")
left_wall4 = love.graphics.newImage("assets/world/orig_templates/side3_template.png")

far_left_wall2 = love.graphics.newImage("assets/world/orig_templates/farside2_template.png")
far_left_wall3 = love.graphics.newImage("assets/world/orig_templates/farside3_template.png")
end

function WS:drawWorldScreen(SCALE)
Expand All @@ -56,6 +62,26 @@ function WS:drawWorldScreen(SCALE)
if viewMatrix[1][3] == 1 then love.graphics.draw(left_wall1, rWallCoords[1][1]*SCALE,rWallCoords[1][2]*SCALE,0,-SCALE,SCALE) end
end

function WS:drawCompleteWorldScreen(SCALE)
love.graphics.draw(floor,floor_coords[1]*SCALE,floor_coords[2]*SCALE,0,SCALE)
love.graphics.draw(roof,ceiling_coords[1]*SCALE,ceiling_coords[2]*SCALE,0,SCALE)
viewMatrix = WS:createViewMatrix(self.party:getX(), self.party:getY(), self.party:getDirection(), self.local_map)
if viewMatrix[4][1] == 1 then love.graphics.draw(left_wall4, lWallCoords[4][1]*SCALE,lWallCoords[4][2]*SCALE,0,SCALE) end
if viewMatrix[4][3] == 1 then love.graphics.draw(left_wall4, rWallCoords[4][1]*SCALE,rWallCoords[4][2]*SCALE,0,-SCALE,SCALE) end
if viewMatrix[4][2] == 1 then love.graphics.draw(front_wall3,fWallCoords[4][1]*SCALE,fWallCoords[4][2]*SCALE,0,SCALE) end

if viewMatrix[3][1] == 1 then love.graphics.draw(left_wall3, lWallCoords[3][1]*SCALE,lWallCoords[3][2]*SCALE,0,SCALE) end
if viewMatrix[3][3] == 1 then love.graphics.draw(left_wall3, rWallCoords[3][1]*SCALE,rWallCoords[3][2]*SCALE,0,-SCALE,SCALE) end
if viewMatrix[3][2] == 1 then love.graphics.draw(front_wall2,fWallCoords[3][1]*SCALE,fWallCoords[3][2]*SCALE,0,SCALE) end

if viewMatrix[2][1] == 1 then love.graphics.draw(left_wall2, lWallCoords[2][1]*SCALE,lWallCoords[2][2]*SCALE,0,SCALE) end
if viewMatrix[2][3] == 1 then love.graphics.draw(left_wall2, rWallCoords[2][1]*SCALE,rWallCoords[2][2]*SCALE,0,-SCALE,SCALE) end
if viewMatrix[2][2] == 1 then love.graphics.draw(front_wall1,fWallCoords[2][1]*SCALE,fWallCoords[2][2]*SCALE,0,SCALE) end

if viewMatrix[1][1] == 1 then love.graphics.draw(left_wall1, lWallCoords[1][1]*SCALE,lWallCoords[1][2]*SCALE,0,SCALE) end
if viewMatrix[1][3] == 1 then love.graphics.draw(left_wall1, rWallCoords[1][1]*SCALE,rWallCoords[1][2]*SCALE,0,-SCALE,SCALE) end
end

function WS:createViewMatrix(x,y,partyDirection,currentMap)
local viewMatrix = {}
for i=1,4 do viewMatrix[i] = {} end
Expand Down

0 comments on commit 7a7e97b

Please sign in to comment.