diff --git a/src/autosave_warning.lua b/src/autosave_warning.lua index d0601d373..31b065f0d 100644 --- a/src/autosave_warning.lua +++ b/src/autosave_warning.lua @@ -26,6 +26,9 @@ function state:enter() Timer.add(8, function() Gamestate.switch('scanning') end) + local width, height, flags = love.window.getMode() + self.width = width*window.scale + self.height = height*window.scale end function state:leave() @@ -40,8 +43,8 @@ function state:draw() local width = self.background:getWidth() local height = self.background:getHeight() - local x = (window.width - width)/2 - local y = (window.height - height)/2 + local x = (self.width - width)/2 + local y = (self.height - height)/2 love.graphics.draw(self.background, x, y) self.savingAnimation:draw(self.savingImage, x + 10, y + 10) diff --git a/src/credits.lua b/src/credits.lua index 902277c7e..0584b9b53 100644 --- a/src/credits.lua +++ b/src/credits.lua @@ -17,6 +17,9 @@ function state:enter(previous) self.ty = 0 camera:setPosition(0, self.ty) self.previous = previous + local width, height, flags = love.window.getMode() + self.width = width*window.scale + self.height = height*window.scale end function state:leave() @@ -378,7 +381,7 @@ function state:draw() for i = shift - 14, shift + 1 do local name = self.credits[i] if name then - love.graphics.printf(name, 0, window.height + 25 * i, window.width, 'center') + love.graphics.printf(name, 0, self.height + 25 * i, self.width, 'center') end end end diff --git a/src/images/tilesets/baseball.png b/src/images/tilesets/baseball.png index 6d378f307..42f7b6e3d 100644 Binary files a/src/images/tilesets/baseball.png and b/src/images/tilesets/baseball.png differ diff --git a/src/images/tilesets/deans-closet.png b/src/images/tilesets/deans-closet.png index f1432c9ac..09d22e5c2 100644 Binary files a/src/images/tilesets/deans-closet.png and b/src/images/tilesets/deans-closet.png differ diff --git a/src/instructions.lua b/src/instructions.lua index e89a22fb3..b0ee7bbfe 100644 --- a/src/instructions.lua +++ b/src/instructions.lua @@ -37,7 +37,6 @@ menu:onSelect(function() state.statusText = "PRESS NEW KEY" end) function state:init() - VerticalParticles.init() self.arrow = love.graphics.newImage("images/menu/arrow.png") self.background = love.graphics.newImage("images/menu/pause.png") @@ -56,12 +55,16 @@ end function state:enter(previous) fonts.set( 'big' ) sound.playMusic( "daybreak" ) - + VerticalParticles.init() + camera:setPosition(0, 0) self.instructions = controls:getActionmap() self.previous = previous self.option = 0 self.statusText = '' + local width, height, flags = love.window.getMode() + self.width = width*window.scale + self.height = height*window.scale end function state:leave() @@ -82,29 +85,31 @@ function state:draw() VerticalParticles.draw() love.graphics.draw(self.background, - camera:getWidth() / 2 - self.background:getWidth() / 2, - camera:getHeight() / 2 - self.background:getHeight() / 2) + (self.width - self.background:getWidth()) / 2, + (self.height - self.background:getHeight()) / 2) local n = 1 - + local x = (self.width - window.width)/2 + local y = (self.height - window.height)/2 + love.graphics.setColor(255, 255, 255) local back = controls:getKey("START") .. ": BACK TO MENU" local howto = controls:getKey("ATTACK") .. " OR " .. controls:getKey("JUMP") .. ": REASSIGN CONTROL" love.graphics.print(back, 25, 25) love.graphics.print(howto, 25, 55) - love.graphics.print(self.statusText, self.left_column, 280) + love.graphics.print(self.statusText, x + self.left_column, y + 280) love.graphics.setColor( 0, 0, 0, 255 ) for i, button in ipairs(menu.options) do - local y = self.top + self.spacing * (i - 1) + local z = y + self.top + self.spacing * (i - 1) local key = controls:getKey(button) - love.graphics.print(descriptions[button], self.left_column, y, 0, 0.5) - love.graphics.print(key, self.right_column, y, 0, 0.5) + love.graphics.print(descriptions[button], x + self.left_column, z, 0, 0.5) + love.graphics.print(key, x + self.right_column, z, 0, 0.5) end love.graphics.setColor( 255, 255, 255, 255 ) - love.graphics.draw(self.arrow, 135, 87 + self.spacing * menu:selected()) + love.graphics.draw(self.arrow, x + 135, y + 87 + self.spacing * menu:selected()) end function state:remapKey(key) diff --git a/src/level.lua b/src/level.lua index 9840a1129..3d6939563 100644 --- a/src/level.lua +++ b/src/level.lua @@ -94,23 +94,22 @@ local function collision_stop(dt, shape_a, shape_b) end end -local function setBackgroundColor(map) - local prop = map.properties - if not prop.red then - love.graphics.setBackgroundColor(0, 0, 0) - return - end - love.graphics.setBackgroundColor(tonumber(prop.red), - tonumber(prop.green), - tonumber(prop.blue)) -end - local function getCameraOffset(map) local prop = map.properties - if not prop.offset then - return 0 + + local width, height, flags = love.window.getMode( ) + if not flags.fullscreen then + if not prop.offset then + return 0 + end + return tonumber(prop.offset) * map.tilewidth + else + if not prop.offset or tonumber(prop.offset) < 2 then + return (map.height*map.tileheight - height*window.scale)/2 + end + return math.min(tonumber(prop.offset)*map.tileheight + (window.height - height*window.scale)/2, + map.height*map.tileheight - height*window.scale) end - return tonumber(prop.offset) * map.tilewidth end local function getTitle(map) @@ -149,7 +148,6 @@ function Level.new(name) level.map.moving_platforms = {} -- Need to give map access to moving platforms level.tileset = tmx.load(level.map) level.collider = HC(100, on_collision, collision_stop) - level.offset = getCameraOffset(level.map) level.music = getSoundtrack(level.map) level.spawn = (level.map.properties and level.map.properties.respawn) or 'studyroom' level.overworldName = (level.map.properties and level.map.properties.overworldName) or 'greendale' @@ -371,9 +369,14 @@ function Level:enter(previous, door, position) self:restartLevel(true) end - camera.max.x = self.map.width * self.map.tilewidth - window.width - - setBackgroundColor(self.map) + local width, height, flags = love.window.getMode( ) + if not flags.fullscreen then + camera.max.x = self.map.width * self.map.tilewidth - window.width + else + local widthDif = self.map.width * self.map.tilewidth - width*window.scale + camera.max.x = widthDif > 0 and widthDif or widthDif/2 + end + self.offset = getCameraOffset(self.map) sound.playMusic( self.music ) diff --git a/src/maps/admin-hallway.tmx b/src/maps/admin-hallway.tmx index ee7b10e00..260d08ece 100644 --- a/src/maps/admin-hallway.tmx +++ b/src/maps/admin-hallway.tmx @@ -1,10 +1,7 @@ - + - - - @@ -14,6 +11,11 @@ + + + eJztwzENAAAMBKGb3r/kuugECaumqqpPD97OD8E= + + eJxjZGBwYBzCmImBgWGI4wNDGTOMQJA+SM0aBaSDjcBCZBPjwNjdC7S3j0K7TwL1nyLDDGYohgFJIJbCwsYHlgLtXTZAYYfL/dIMhN0vQ4T5QDUNxKhDB7JEqoO5nx2KDYHYCIiNkdjsOLAJHjkkNQ3EqEPHpljE7mIRYx7FgwIzDnEMAH5IPoY= @@ -34,48 +36,48 @@ eJxjYBja4CHj0MajYBSMglEwCoYu+M0IwQMFhJgYGASZsMsJMKGqE4BiXOoJmYcOvjEObTwKBhYAAAPfW1Q= - - + + - - - - - + + + + + - + - + - + - + - + - + @@ -83,17 +85,17 @@ - + - + - + diff --git a/src/maps/baseball.tmx b/src/maps/baseball.tmx index 64f9b174b..ecd5d5977 100644 --- a/src/maps/baseball.tmx +++ b/src/maps/baseball.tmx @@ -1,11 +1,7 @@ - + - - - - @@ -15,6 +11,11 @@ + + + eJxjY2BgYBvFo3gUj+JhgAFy/wc5 + + eJztzEVOg2EUhtEyYAslwbVYgherkNDirgUKxd2d5XNI/sG3gTLqm5zBTW6eWKyyyv5vcWqCu5Y66mmgkSaaaaGVNtrpIEEnXaQi3fTQG3T76GeAQYYYZoQko4wxzgSTUStNkQ0yZJkKutPkyDPDLHPMs8AiSyyzwiprrAfdP5tssc0OuxTYY5+D6P+QI0occ8IpZ5xzEXQvueKaG265454HHnnimRdeeeOdDz754pufqFtVJtVl8gs3bR3E @@ -35,14 +36,14 @@ eJxjYBgFo2AUjALsoJJGmFYAAHZ/Cmc= - - - + + + - + diff --git a/src/maps/borchert-hallway.tmx b/src/maps/borchert-hallway.tmx index 85809263e..249743a0d 100644 --- a/src/maps/borchert-hallway.tmx +++ b/src/maps/borchert-hallway.tmx @@ -1,10 +1,7 @@ - + - - - @@ -16,38 +13,38 @@ - eJxjZGBwYBykmImBgWEQ4wODFTOMghEPRIBYFIjFBtohSMAcmKktGAfaFdiBP9BdAVRymyQQS2GhiQUyDAwNMmhicmh8eTR+Fg6MzW0w82E0KW4zAeoxQRMzI8An1m2GSObDaCMs6phHMVmYcRBjAFTfNdY= + eJxjZGBwYBykmImBgWEQ4wODFbMB3TeKR/Fgw+bATG3BOPDuwIb9ge4KoJLbJIFYCgtNrH4ZBoYGGTQxOTS+PBo/CwfG5jaY+TCaFLeZAPWYoImZEeAT6zZDJPNhtBEWdcyjmCzMOIgxANdwO+s= - eJxjYBgFww3UMDA4IONqND5U7AC6GDH6KMEg89Ddmoxd7AAhPyZTJaQIugObugYizKIqwOEObGIN5JiFDTRB1Cpgw01I9lDDbaGMDAxhjMS7DZ+6ZCLdlgHFyHoUgdiHgWFBCjAtAOkDikTaSYnbZAnoRdYDdBNDCoROINZOct0GzK8MplAahKuhNAxAxRpqkPg1SGqQ9eECNUSqg9lDSN0oGLoAAIKVRDw= + eJxjYBgFww3UMDA4IONqND5U7AC6GDH6KMEg89Ddmoxd7AAhPyZTJaQIugObugYizKIqwOEObGINMLYIEIsCsRgR+rCBJohaBWy4CckeUtxmzsjAYMGIKRcKFAtjJN5t+NQlE+m2DCiG6fEH2h8AxD4MDAtSgGkBSB9QJNJOdPMlgVgKC43NbbJY7JABqpNB848cA9htDCkQOkEeTV8WDozNbTDzYTQ2twHzK4MplAbhaihtAlRnghBrANFmSOrQ+dV43FaDps4QyXwYbYRkD0zdKBh+AABfhFEc - + eJxjYBgF5AL/gXYAFADd0YBNnIOGdipQoNcbqj+dDL349HhDaVxmazIyMGgBsTYjfjsUyHAXsQCX2Y5ANzkBsTMd3BYJxFFAHA3EMUAcC8RxVDCbWP2RQD9GAXE0Fr8WAnEREBcDcQkQlwJxGdRsRaB6JTQ9nEDMRYSdFmh8JSBWxqE2E4jroeyVQLyKCLMtge6yIhB3IPAfRKCpCwDio1D2Wjx6QW5qAOJGKP8gEB8iYB/I7DQgriPsNAZxoLsk0NxmDsR3oeypSOJTUZUxTEHj3wTiWzjsCQfiCCRzpiHJTQfiGUg0MkC3cxQMHwAA2IQfgA== - + eJx7yMjA8HCQ4lEwCkbBKBgFhMFvRuyYXkCIiX52fWMcvHgUkAcAbV1ODA== - - + + - + - + @@ -55,23 +52,23 @@ - - + + - + - + - + diff --git a/src/maps/castle-hawkthorne-entrance.tmx b/src/maps/castle-hawkthorne-entrance.tmx index e77de3e58..0b8628a32 100644 --- a/src/maps/castle-hawkthorne-entrance.tmx +++ b/src/maps/castle-hawkthorne-entrance.tmx @@ -1,11 +1,8 @@ - + - - - @@ -56,53 +53,53 @@ eJztzlsz1HEAxvH/cqPS7pbDvaJdEfeS7BLuK4VS7qPY7eQtkKK3EOXwFopObyGd3wIlh04zPm/BMH5jZp+Zz/XzjaLdbz0WRRtsssVv/vCXf/yP7cHJDhcviqIESY5xnDLKqaCyaP+bUj7T1HKaOuo5QwONAZpafWbI0kY7F+igk64ATT0+e+njGtfp5wY3GQjQNOIzR5673OM+D3jIaICmMZ/jPGKCxzxhkimeBmh65nOaGZ7zglnmmGchQNNLn69YZInXvOEt73gfoOmDz2U+8onPfOEr3/geoGnF5yo/+Mkav1hng80ATSXFUXSIwxyhlKPESZAs3v+mKp8nOEk1NZwiRZraAE1NPs/SzDlaOE8rGbIBmi76vMRlurnCVXropS9A0y2fgwxxmzsMM0KOfICmwgor7OBvG2e7Qs0= - - + + - + - + - + - + - - + + - + - + @@ -110,21 +107,21 @@ - + - + - + @@ -142,7 +139,7 @@ - + @@ -150,7 +147,7 @@ - + @@ -158,9 +155,9 @@ - - - + + + diff --git a/src/maps/castle-hawkthorne-room-1.tmx b/src/maps/castle-hawkthorne-room-1.tmx index 80087203c..0cd4694cf 100644 --- a/src/maps/castle-hawkthorne-room-1.tmx +++ b/src/maps/castle-hawkthorne-room-1.tmx @@ -1,12 +1,8 @@ - + - - - - @@ -40,8 +36,8 @@ eJzt2EEJACAABEHBJDY3qgjaYR8zcAn2d2uOvayycUeDHi16tOjRokeLHi16tOjRokeLHi16tPwegd/G3n9FywFP75pZ - - + + @@ -49,17 +45,17 @@ - + - + - + diff --git a/src/maps/castle-hawkthorne-room-2.tmx b/src/maps/castle-hawkthorne-room-2.tmx index 40a30311c..6555c698f 100644 --- a/src/maps/castle-hawkthorne-room-2.tmx +++ b/src/maps/castle-hawkthorne-room-2.tmx @@ -1,12 +1,8 @@ - + - - - - @@ -40,8 +36,8 @@ eJzt2LENACAMxMCXMkk2ZxRGgwIKJsCFT/oJnCpdSVeGQ2zuCcIeLPZgsQeLPVjswWIPFnuw2IPFHiz2YLk9AH8bd/5Xv29CrwVZAqN5 - - + + @@ -49,17 +45,17 @@ - + - + - + diff --git a/src/maps/castle-hawkthorne-room-3.tmx b/src/maps/castle-hawkthorne-room-3.tmx index d31ae6d18..9bac46c24 100644 --- a/src/maps/castle-hawkthorne-room-3.tmx +++ b/src/maps/castle-hawkthorne-room-3.tmx @@ -1,12 +1,8 @@ - + - - - - @@ -40,8 +36,8 @@ eJzt2LEJADAMxMAHT5LNM4pHCwE3mSAqdPATyJVXpVdlO8Rui44Q7MFiDxZ7sNiDxR4s9mCxB4s9WOzBYg+W6RHA38bN/+r3Teh1AMz7rHk= - - + + @@ -49,17 +45,17 @@ - + - + - + diff --git a/src/maps/castle-hawkthorne-room-4.tmx b/src/maps/castle-hawkthorne-room-4.tmx index 90482505e..39f84e2ff 100644 --- a/src/maps/castle-hawkthorne-room-4.tmx +++ b/src/maps/castle-hawkthorne-room-4.tmx @@ -1,12 +1,8 @@ - + - - - - @@ -40,8 +36,8 @@ eJzt2LEJADAMxMAHT5LNM4pHCwE3mSAqdPATyJVXpVdlO8Rui44Q7MFiDxZ7sNiDxR4s9mCxB4s9WOzBYg+W6RHA38bN/+r3Teh1AMz7rHk= - - + + @@ -49,18 +45,18 @@ - + - + - - + + diff --git a/src/maps/class-basement.tmx b/src/maps/class-basement.tmx index 939c36e60..2fa18c16b 100644 --- a/src/maps/class-basement.tmx +++ b/src/maps/class-basement.tmx @@ -1,10 +1,7 @@ - + - - - @@ -13,71 +10,71 @@ - + - eJzt1zEOgCAMBdAq8RZ6C929hBzChDu4yC28qwwdapNiiBoc/vACQ9OWv+GJyIOpIZrB1qaMAOAbC2Q5VnuPPwkC8rmKyS5Y+fTivgq53gPRNry8r9XTmlM6X9cfnEtQ+XTKKO4yH10nTekt001NKaunNad0vq6PLPDpAB5oIKv2/+/vTiCJrEk= + eJzt0LENgCAQBdBD4hayhfTOY8IONrIFu0pxxUlyGBSjxS9eoLjch2+IFgOqgYgA4B0jVFn29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Dwd/gAKbdv0A== - + - eJxjYBgFo2AUjIKBA/4D7QAcAOiuBiQ23e2kJsjDwabEPFLNBKnJBeI2IG4lwz5qqoOBA4wMCTeAmERtBIECAXlvaltIAGTQ2T4QUGZkYFBhxC5ngUXsLxD/o5LdzUB7W4BYEU18Jg71VkSaWw+l1xKpvhGI63DIWQPdZ4MlfNJwqBcFqhXDEZ7E6EcGs4HmzCHCLHQwlYD8ZCRMrHnTCJhFrDsIuY1cQCtzR8EoGAWjgBIAAI5VGf8= + eJxjYBgFo2AU0BL4D7QDcACguxqQ2HS3k5ogDwebEvNINROkJheI24C4lQz7qKkOBg4wMiTcAGIStREECgTkvaltIQGQQWf7QECZkYFBhRG7nAUWsb9A/I9KdjcD7W0BYkU08Zk41FsRaW49lF5LpPpGIK7DIWcNdJ8NlvBJw6FeFKhWDEd4EqMfGcwGmjOHCLPQwVQC8pORMLHmTSNgFrHuIOQ2cgGtzB0Fo2AU4AcATKIZ/w== - + - eJztzKENACAMBdG2EwD7L8cSGAw43FetIfeSs2cGZTqpAAD41fYXtBFm7dYj55XxqbScVADqHDaNiF0= + eJztzKENACAMAMG2EwD7L9clMBhwKGoohvwlb99VxOkYAAC/GrpDrJlIWVXLeWV8XupKUcCNCcPHiF0= - - + + - - - - - + + + + + - + - + - + - + - + - - + + @@ -85,7 +82,7 @@ - + @@ -93,7 +90,7 @@ - + @@ -101,7 +98,7 @@ - + @@ -109,7 +106,7 @@ - + @@ -117,7 +114,7 @@ - + @@ -125,7 +122,7 @@ - + @@ -133,7 +130,7 @@ - + @@ -141,7 +138,7 @@ - + @@ -149,7 +146,7 @@ - + diff --git a/src/maps/class-hallway-2.tmx b/src/maps/class-hallway-2.tmx index c7c143fcd..aff4be484 100644 --- a/src/maps/class-hallway-2.tmx +++ b/src/maps/class-hallway-2.tmx @@ -1,10 +1,7 @@ - + - - - @@ -14,6 +11,11 @@ + + + eJztw0ENAAAMA6F71b/kCRkkrJqqqqqq+vIBJVAeMQ== + + eJztlT0KwkAQhXeNnsLYG9BC0T4p9RJa22mjpTfQW+ghFDyAv6A38PcWPsFAGLJhN4YNyDz4ip2d2Zl5KSKF8CVjjYIQgrHKhrGHYLFYrIzkfMlCDfyAmzKjx3LSHhwM8h3sW9TY2SF8VENdndQewUmzdwe13YTeK9ytc/geW7DTzL2DB4kNMfNIMXcZcTel33F6gpfGnDo6Y65LDn5fwS1FXQ+z9sEMzH+cO8nvCjm7Bu96Qky9mPggQqiqZp4q10QmO4S9xvB4AhZgqfCbeqUS9bsUoU3OLXJOIoDfQUw86mMY8zXzVLkmmOxg0ot6pYL6zTD/iGSs8gbMi39G @@ -34,73 +36,73 @@ eJztzjEOABAMRuHWCXD/y7mExWKR2GiiMfC+5G3NT1GRQtcCAAAA8J6mM4+7H+QgEkcp+O5a97Lh/d2eZePkj6v7qnQz4GUdOnOxPg== - - + + - + - + - + - - - - - - + + + + + + - + - + - + - + - + - + - + diff --git a/src/maps/class-hallway.tmx b/src/maps/class-hallway.tmx index a37d6ccf0..9bec93943 100644 --- a/src/maps/class-hallway.tmx +++ b/src/maps/class-hallway.tmx @@ -1,10 +1,7 @@ - + - - - @@ -14,6 +11,11 @@ + + + eJztw0ENAAAMA6F71b/kCRkkrJqqqqqq+vIBJVAeMQ== + + eJzt1EkKwjAUBuAXPYUDikdwwLXn8RS9gtMhnJa6dlzq3uku/lACEkLKa/VJy/vho6RJSfpDa4gGRokpEZEStVNySKPJWUb4MY9hAlOYmX+fqNiZo98FLGEFa+37p9mj3wMc4QRnT99lhyZ9buj3Dg94witj3xWoeq4SaQXmNnivbU6+3TR912KR2/fQw3ffps44Z2jtBV1fE/r+1l6+NAJzTWfM6bsNHejGIju24fbdS9jvM5y1WZ/n7tVnzLl9K1VERol6A0q/ftA= @@ -34,88 +36,88 @@ eJztzLEJACAMBdHECdT9l3MJGxvtFSEgEeUeXBM+KSpSyC0AAAAAb2k6t7rjrhxE4iiFM/ts/LXbWn5ZVCXPgJ91MtWzwA== - - + + - + - + - - - - - + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/src/maps/deans-closet.tmx b/src/maps/deans-closet.tmx index b71e77988..bebeada42 100644 --- a/src/maps/deans-closet.tmx +++ b/src/maps/deans-closet.tmx @@ -1,10 +1,7 @@ - + - - - @@ -14,6 +11,11 @@ + + + eJztw0ENAAAMA6GTVf/KZmJPSFg1VVVVVVVVVVVVVVV9ftdujb8= + + eJztWd1u60QQntRtkos4UgGpUXsACScOFwikcIFAIAI3IH7egUfxo5xH6aPhqeeLv0x21+vTpHB0OtLI9np3Z3bmmx8nIq/0Sq/0LlT/1wq80gdDa5Emd251QT3OTUMxtHkRLT4sOmfe2kbGrzpueGwsLot3UehMFDuXUj3w/rmksb7urll0dUFdPOXqNJbUps/JWz4/xvwzMWaqOvlNblzsxqkWJfVbIYdYOTwXkVyvZ0zhbmtcj6gVY6gizqHlJZQIUFsjmlanfc7c+vi+ic0DnsacN0Twl8rdmP8Q30welxsZtjf2RI28foaeTCXpo7wI6AfScwB3sdywJT43qcz/Iy5Nr30OLteGX2AzdQ59p/5GnkitSfVOW+nx6Flof5+PKhm2t3+fymlKub0tMDhv+d6uGPPY4/PE9LwkLnPsBLIa0Fj+b4bmumesy9VrP4RL6z0ab5/QOdb0Tllr44P0OK0Cc0P25ncx1r00Ny2Ny75Pary913KKf+8P7BOiWD9Sd9xw3p3YuZfEOxv3eTEUa0qo/7V7bzn+CR8WR4wV4bHIUQ62wJkqW2N9T5TeOBbpbcrr1nJaG+CnMjO2GZeQ4fMG4WDP9mE/Ff1+R7WhNF1CMYm5Hpc8NoRLPf+05Y/s3uMxlQ94XM/jcVkH5jKm+JwFvVc97qSr3yvb80F6XFoNOKrhPL4hXUJnrmzflhvsG2Jgz3CoNavxdRu8pHus86Rnurez3EmPgdr8izPBLxu3dmfXIeIazjmTeyHEq+45s2uo7mC+Py/sx2Nm+6cxxjmIfTSES7XnbcufyrFtY1wnav2dsxt0qN08tn/Ir8sEp87DfB2Z7+2KHmEvXXyq/jeSF6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o/X/q/QR1Y+33lmzn8G6oDTVe+68OMxbzDD9LPOcE/NIuvOc6etdhdS3QVG9jjbeR3JY7Re2Z9RmXMD1Fb9HwnAXK3Z1HqHMs9+1qD0eZboHHrWq31nF0aNcp1/1m3xzKuWZ+S6K4bKL33pQdGXEay+RNkLFaLUDw== - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/src/maps/deans-closet2.tmx b/src/maps/deans-closet2.tmx index 2d06fd149..2a1c6be67 100644 --- a/src/maps/deans-closet2.tmx +++ b/src/maps/deans-closet2.tmx @@ -1,11 +1,8 @@ - + - - - @@ -14,6 +11,11 @@ + + + eJyzYGBgsBjFo3gUj+JRPIpHKAYA8e5icQ== + + eJztkksOwCAIRLmLINfk6NVEokWj1rbpok4yC8Lg8wewtZWFwfQBl5Pf5HtTU8F1yU9LGcoPtbhFbpxHqM9hFTKi60PBaHHxvFdRhr6BN/OYMm5gmsjwZKaXsz3OjncgnZyM2CvmsWXm3Hf4V/qte9B/8ycdKecbyA== @@ -39,22 +41,22 @@ eJxjYBgFo4B4MIVKZlDDHELmU2IHsn5qmEcpoNRuStyPTd8UIjEx6gcKkOL+kQaqBggPFAAAqPAmAQ== - - + + - + - + diff --git a/src/maps/deans-office-2.tmx b/src/maps/deans-office-2.tmx index daa75e4b9..1ae1bc7b9 100644 --- a/src/maps/deans-office-2.tmx +++ b/src/maps/deans-office-2.tmx @@ -1,17 +1,19 @@ - + - - - + + + eJxjZGBgYBzFo3gUj+JhgAHsdgE1 + + eJxTYmBgUKIBpgZgxIKHi7nZQJxDwLwYEsx1htJlQFxOhFuriDAXZKYuEWYhg1YC5oLM9ANiSQaGA6SYOwGPuchmMgNpcjC6uTC/U2ImNrOpZSa62dQ0E9lsapsJw7Qoc0AYAPkCEXI= @@ -32,50 +34,50 @@ eJxjYBgFowA7mEUjc5fSyNxRMAoAKpEBQA== - - + + - + - + - + - + - + - - + + - + @@ -91,7 +93,7 @@ - + @@ -100,7 +102,7 @@ - + @@ -109,7 +111,7 @@ - + @@ -118,7 +120,7 @@ - + @@ -127,7 +129,7 @@ - + @@ -135,7 +137,7 @@ - + @@ -143,6 +145,6 @@ - + diff --git a/src/maps/deans-office.tmx b/src/maps/deans-office.tmx index 884181b8d..6b909d403 100644 --- a/src/maps/deans-office.tmx +++ b/src/maps/deans-office.tmx @@ -1,17 +1,19 @@ - + - - - + + + eJxjZGBgYBzFo3gUj+JhgAHsdgE1 + + eJxTYmBgUKIBHgWDE6ggsSUZGBpoYYcf0FxizBYnEQPNdCBkNjOZGJ/Z5JqJz2xKzUQ3m5pmIptNbTNhmBZlDggDAPUbEN8= @@ -32,22 +34,22 @@ eJxjYBgFowA7mEGB3pl45BZTYO4SCvSOguEPAPbHAnk= - - + + - + - + @@ -56,7 +58,7 @@ - + @@ -64,7 +66,7 @@ - + @@ -72,12 +74,12 @@ - + - + @@ -86,31 +88,31 @@ - - + + - + - + - + - + diff --git a/src/maps/dorm-lobby.tmx b/src/maps/dorm-lobby.tmx index 246650bd8..61d313b94 100644 --- a/src/maps/dorm-lobby.tmx +++ b/src/maps/dorm-lobby.tmx @@ -1,10 +1,7 @@ - + - - - @@ -13,6 +10,11 @@ + + + eJxjZ2BgYB/Fo3gUj+JRTDIGADcICTE= + + eJxjZGBwYKQhZmJgYKAxPkBLzEAjUAMMGxCm1Jw0YCCnA3EGIxUchQXUAc2tB+IGAuZfAuLLZJg/DWjudCCeQcD8V0D8mgzz1wHNXQ/EG8gIn2wkjI2PCyQC7UpCs08GGIQyVDK/Emh2FZr5JkDzTQjoIwXUQDHzEMeMNMYAn2gt+Q== @@ -33,20 +35,20 @@ eJx7yMjA8JCGeBSMglEwdME3RtrioQ4AXc8sWQ== - - + + - - + + - + diff --git a/src/options.lua b/src/options.lua index ce63a3b8a..820ce1789 100644 --- a/src/options.lua +++ b/src/options.lua @@ -215,6 +215,11 @@ function state:enter(previous, target) camera:setPosition(0, 0) self.previous = previous self.target = target + + local width, height, flags = love.window.getMode() + self.width = width*window.scale + self.height = height*window.scale + end function state:leave() @@ -227,15 +232,19 @@ end function state:updateFullscreen() if self.option_map['FULLSCREEN'].bool then utils.setMode(0, 0, true) - local width = love.graphics:getWidth() - local height = love.graphics:getHeight() - camera:setScale( window.width / width , window.height / height ) + --TODO: large screens & changing scale + camera:setScale(window.scale, window.scale) love.mouse.setVisible(false) else - camera:setScale(window.scale,window.scale) + camera:setScale(window.scale, window.scale) utils.setMode(window.screen_width, window.screen_height, false) love.mouse.setVisible(true) end + --TODO: see if there's a better way to do this + local width, height, flags = love.window.getMode() + self.width = width*window.scale + self.height = height*window.scale + VerticalParticles.init() end function state:updateFpsSetting() @@ -336,15 +345,16 @@ function state:draw() local back = controls:getKey("START") .. ": BACK TO MENU" love.graphics.print(back, 25, 25) - local y = 96 + local x = (self.width - window.width)/2 + local y = 96 + (self.height - window.height)/2 love.graphics.draw(self.background, - camera:getWidth() / 2 - self.background:getWidth() / 2, - camera:getHeight() / 2 - self.background:getHeight() / 2) + (self.width - self.background:getWidth()) / 2, + (self.height - self.background:getHeight()) / 2) love.graphics.setColor( 0, 0, 0, 255 ) - local xoffset = self.page == 'optionspage' and 20 or 0 + local xoffset = self.page == 'optionspage' and x + 20 or x for n, opt in pairs(menu.options) do if tonumber( n ) ~= nil then @@ -353,9 +363,9 @@ function state:draw() local option = self.option_map[opt] if option.bool ~= nil then if option.bool then - love.graphics.draw( self.checkbox_checked, 366, y ) + love.graphics.draw( self.checkbox_checked, x + 366, y ) else - love.graphics.draw( self.checkbox_unchecked, 366, y ) + love.graphics.draw( self.checkbox_unchecked, x + 366, y ) end elseif option.range ~= nil then love.graphics.draw( self.range, 336, y + 2 ) @@ -367,10 +377,11 @@ function state:draw() end if self.page ~= 'optionspage' then - love.graphics.draw( self.arrow, 138, 124 + ( 26 * ( menu.selection - 1 ) ) ) + -- TODO: currently too low down on "GAME" menu + love.graphics.draw( self.arrow, x + 138, y - 52 + ( 26 * ( menu.selection - 1 ) ) ) else love.graphics.setColor(255,255,255,255) - love.graphics.draw( self.bigarrow, 138, 116 + ( 26 * ( menu.selection - 1) ) ) + love.graphics.draw( self.bigarrow, x + 138, y - 110 + ( 26 * ( menu.selection - 1) ) ) end love.graphics.setColor( 255, 255, 255, 255 ) end diff --git a/src/pause.lua b/src/pause.lua index b436fe3ed..6123c2998 100644 --- a/src/pause.lua +++ b/src/pause.lua @@ -20,6 +20,10 @@ function state:enter(previous, player) fonts.set( 'big' ) + local width, height, flags = love.window.getMode() + self.width = width*window.scale + self.height = height*window.scale + camera:setPosition(0, 0) self.option = 0 @@ -91,19 +95,22 @@ function state:draw() VerticalParticles.draw() love.graphics.draw(self.background, - camera:getWidth() / 2 - self.background:getWidth() / 2, - camera:getHeight() / 2 - self.background:getHeight() / 2) + (self.width - self.background:getWidth()) / 2, + (self.height - self.background:getHeight()) / 2) + + local x = (self.width - window.width)/2 + local y = (self.height - window.height)/2 local controls = self.player.controls love.graphics.setColor( 0, 0, 0, 255 ) - love.graphics.print('Controls', 198, 101) - love.graphics.print('Options', 198, 131) - love.graphics.print('Quit to Map', 198, 161) - love.graphics.print('Quit to Menu', 198, 191) - love.graphics.print('Quit to Desktop', 198, 221) + love.graphics.print('Controls', x + 198, y + 101) + love.graphics.print('Options', x + 198, y + 131) + love.graphics.print('Quit to Map', x + 198, y + 161) + love.graphics.print('Quit to Menu', x + 198, y + 191) + love.graphics.print('Quit to Desktop', x + 198, y + 221) love.graphics.setColor( 255, 255, 255, 255 ) - love.graphics.draw(self.arrow, 156, 96 + 30 * self.option) + love.graphics.draw(self.arrow, x + 156, y + 96 + 30 * self.option) local back = controls:getKey("START") .. ": BACK TO GAME" local howto = controls:getKey("ATTACK") .. " OR " .. controls:getKey("JUMP") .. ": SELECT ITEM" love.graphics.print(back, 25, 25) diff --git a/src/scanning.lua b/src/scanning.lua index 7df829d22..5fe2318d4 100644 --- a/src/scanning.lua +++ b/src/scanning.lua @@ -16,6 +16,9 @@ function state:enter(previous) self:refresh() self.previous = previous self.music = sound.playMusic("opening") + local width, height, flags = love.window.getMode() + self.width = width*window.scale + self.height = height*window.scale end function state:keypressed( button ) @@ -57,8 +60,8 @@ function state:draw() love.graphics.setColor( 255, 255, 255, 255 ) -- coloured backgrounds - local width = window.width - local height = window.height + local width = self.width + local height = self.height local xcorner = width/2 - 200 local ycorner = height/2 - 125 diff --git a/src/start.lua b/src/start.lua index 19d5ed3b2..a921abaa1 100644 --- a/src/start.lua +++ b/src/start.lua @@ -41,6 +41,9 @@ function state:enter( previous ) camera:setPosition( 0, 0 ) self.previous = previous self.window = 'main' + local width, height, flags = love.window.getMode() + self.width = width*window.scale + self.height = height*window.scale end function state:leave() @@ -161,8 +164,11 @@ function state:draw() love.graphics.setColor(255, 255, 255) love.graphics.draw(self.background, - camera:getWidth() / 2 - self.background:getWidth() / 2, - camera:getHeight() / 2 - self.background:getHeight() / 2) + (self.width - self.background:getWidth()) / 2, + (self.height - self.background:getHeight()) / 2) + + local x = (self.width - window.width)/2 + local y = 90 + (self.height - window.height)/2 if self.window == 'main' then love.graphics.setColor(255, 255, 255) @@ -172,20 +178,18 @@ function state:draw() love.graphics.print(delete, 25, 55) local yFactor = 20 - local y = 90 - love.graphics.setColor( 0, 0, 0, 255 ) for n, opt in pairs(self.options) do if tonumber( n ) ~= nil then if opt.name and opt.slot then - love.graphics.print( opt.name , 175, y, 0 ) + love.graphics.print( opt.name , x + 175, y, 0 ) y = y + yFactor - love.graphics.print( self.get_slot_level( opt.slot ), 190, y, 0 ) + love.graphics.print( self.get_slot_level( opt.slot ), x + 190, y, 0 ) y = y + yFactor elseif opt.name then y = y + yFactor - love.graphics.print( opt.name, 175, y, 0 ) + love.graphics.print( opt.name, x + 175, y, 0 ) end end end @@ -195,7 +199,7 @@ function state:draw() if self.selection > 2 then arrowYFactor = 2.5 end - love.graphics.draw( self.arrow, 135, 127 + ( (yFactor * arrowYFactor) * ( self.selection - 1 ) ) ) + love.graphics.draw( self.arrow, x + 135, y - 80 + ( (yFactor * arrowYFactor) * ( self.selection - 1 ) ) ) elseif self.window == 'deleteSlot' then love.graphics.setColor(255, 255, 255) local howto = controls:getKey("UP") .. " OR " .. controls:getKey("DOWN") .. ": CHANGE OPTION" @@ -203,11 +207,11 @@ function state:draw() love.graphics.print(howto, 25, 25) love.graphics.print(delete, 25, 55) love.graphics.setColor( 0, 0, 0, 255 ) - love.graphics.printf('Are you sure you want to delete this slot?', 155, 110, self.background:getWidth() - 30, 'left') - love.graphics.print('Yes', 175, 175, 0) - love.graphics.print('No', 175, 205, 0) + love.graphics.printf('Are you sure you want to delete this slot?', x + 155, y + 20, self.background:getWidth() - 30, 'left') + love.graphics.print('Yes', x + 175, y + 85, 0) + love.graphics.print('No', x + 175, y + 115, 0) love.graphics.setColor( 255, 255, 255, 255 ) - love.graphics.draw( self.arrow, 140, 170 + 30 * self.selectionDelete ) + love.graphics.draw( self.arrow, x + 140, y + 80 + 30 * self.selectionDelete ) end end diff --git a/src/update.lua b/src/update.lua index b389c519a..db732a2ce 100644 --- a/src/update.lua +++ b/src/update.lua @@ -21,6 +21,9 @@ function screen:enter() self.logo = love.graphics.newImage('images/menu/splash.png') self.bg = sound.playMusic("ending") self.updater:start() + local width, height, flags = love.window.getMode() + self.width = width*window.scale + self.height = height*window.scale end function screen:update(dt) @@ -54,16 +57,16 @@ end function screen:draw() love.graphics.setColor(255, 255, 255, math.min(255, self.time * 100)) - love.graphics.draw(self.logo, window.width / 2 - self.logo:getWidth() / 2, - window.height / 2 - self.logo:getHeight() / 2) + love.graphics.draw(self.logo, (self.width - self.logo:getWidth()) / 2, + (self.height - self.logo:getHeight()) / 2) if self.progress > 0 then love.graphics.setColor(255, 255, 255) - love.graphics.rectangle("line", 40, window.height - 75, window.width - 80, 10) - love.graphics.rectangle("fill", 40, window.height - 75, - (window.width - 80) * self.progress / 100, 10) - love.graphics.printf(self.message, 40, window.height - 55, - window.width - 80, 'center') + love.graphics.rectangle("line", 40, self.width - 75, self.height - 80, 10) + love.graphics.rectangle("fill", 40, self.height - 75, + (self.width - 80) * self.progress / 100, 10) + love.graphics.printf(self.message, 40, self.height - 55, + self.width - 80, 'center') end end diff --git a/src/verticalparticles.lua b/src/verticalparticles.lua index 21f4f0447..de5a38134 100644 --- a/src/verticalparticles.lua +++ b/src/verticalparticles.lua @@ -7,12 +7,14 @@ function Particle:new() new = {} setmetatable(new, Particle) - local winWidth = window.width + local width, height, flags = love.window.getMode() + self.width = width*window.scale + self.height = height*window.scale new.size = math.random(3) - new.pos = { x = math.random(winWidth), y = math.random(window.height) } + new.pos = { x = math.random(self.width), y = math.random(self.height) } - local ratio = 1.0 - math.cos(math.abs(new.pos.x - winWidth/2) * 2 / winWidth) * 0.6 + local ratio = 1.0 - math.cos(math.abs(new.pos.x - self.width/2) * 2 / self.width) * 0.6 new.speed = 300 * (ratio + math.random()/4) @@ -23,7 +25,7 @@ end function Particle:update(dt) self.pos.y = self.pos.y - (dt * self.speed) - if self.pos.y < 0 then self.pos.y = window.height end + if self.pos.y < 0 then self.pos.y = self.height end end function Particle:draw() diff --git a/src/welcome.lua b/src/welcome.lua index 4f453623b..93c35ef3b 100644 --- a/src/welcome.lua +++ b/src/welcome.lua @@ -22,7 +22,6 @@ function state:init() Gamestate.switch(option) end end) - end function state:enter(previous) @@ -30,6 +29,10 @@ function state:enter(previous) self.arrow = love.graphics.newImage("images/menu/small_arrow.png") self.text = string.format(app.i18n('s_or_s_select_item'), controls:getKey('JUMP'), controls:getKey('ATTACK') ) self.bg = sound.playMusic("ending") + + local width, height, flags = love.window.getMode() + self.width = width*window.scale + self.height = height*window.scale self.line = " terminal:// \n\n operations://loadprogram:(true) \n\n".. " program:-journey-to-the-center-of-hawkthorne \n\n loading simulation ..." @@ -87,23 +90,21 @@ end function state:draw() - --background colour - love.graphics.setColor( 0, 0, 0, 255 ) - love.graphics.rectangle( 'fill', 0, 0, love.graphics:getWidth(), love.graphics:getHeight() ) - love.graphics.setColor( 255, 255, 255, 255 ) + local a = (self.width - window.width)/2 + local b = (self.height - window.height)/2 -- green terminal fonts.set('courier') love.graphics.setColor( 48, 254, 31, 225 ) if self.code_loaded == false then - love.graphics.print(self.line_short, 50, 50, 0, 0.5, 0.5 ) + love.graphics.print(self.line_short, a + 50, b + 50, 0, 0.5, 0.5 ) for i = 1, 7 do - love.graphics.print(self.code_short[i], 60*i - 10, 130, 0, 0.4, 0.4) + love.graphics.print(self.code_short[i], a + 60*i - 10, b + 130, 0, 0.4, 0.4) end else - love.graphics.print(self.line, 50, 50, 0, 0.5, 0.5 ) + love.graphics.print(self.line, a + 50, b + 50, 0, 0.5, 0.5 ) for i = 1, 7 do - love.graphics.print(self.code, 60*i - 10, 130, 0, 0.4, 0.4) + love.graphics.print(self.code, a + 60*i - 10, b + 130, 0, 0.4, 0.4) end end @@ -111,8 +112,8 @@ function state:draw() fonts.set( 'big' ) -- menu - local x = window.width / 2 - self.splash:getWidth()/2 - local y = 2*window.height / 2.5 - self.splash:getHeight()/2 + local x = (self.width - self.splash:getWidth())/2 + local y = 0.8* self.height - self.splash:getHeight()/2 if self.code_loaded then love.graphics.draw(self.splash, x, y) love.graphics.draw(self.arrow, x + 12, y + 23 + 12 * (self.menu:selected() - 1)) @@ -121,7 +122,7 @@ function state:draw() end self.menu_shown = true -- control instructions - love.graphics.print(self.text, window.width/2-65, window.height - 24, 0, 0.5, 0.5) + love.graphics.print(self.text, self.width/2-65, self.height - 24, 0, 0.5, 0.5) end end