Permalink
Browse files

Studyroom complete. Fixes to level and overworld.

  • Loading branch information...
1 parent ec45878 commit 59a58709e876de1c9b5759c5d1b1f2ace8753625 @jhoff jhoff committed Nov 27, 2012
View
@@ -1,8 +1,11 @@
local Floorspaces = {}
Floorspaces.__index = Floorspaces
-Floorspaces.primary = false
-Floorspaces.active = false
-Floorspaces.objects = {}
+
+function Floorspaces:init()
+ self.primary = false
+ self.active = false
+ self.objects = {}
+end
function Floorspaces:setPrimary( fs )
assert( not self.primary, "You can only have one primary floorspace!" )
@@ -13,6 +16,7 @@ function Floorspaces:setPrimary( fs )
end
function Floorspaces:getPrimary()
+ assert( self.primary, "You must have one primary floorspace!" )
return self.primary or false
end
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -18,6 +18,7 @@ local tile_cache = {}
local Player = require 'player'
local Floor = require 'nodes/floor'
local Floorspace = require 'nodes/floorspace'
+local Floorspaces = require 'floorspaces'
local Platform = require 'nodes/platform'
local Wall = require 'nodes/wall'
@@ -214,6 +215,7 @@ function Level.new(name)
end
end
+ Floorspaces:init()
if level.map.objectgroups.floorspace then
for k,v in pairs(level.map.objectgroups.floorspace.objects) do
v.objectlayer = 'floorspace'
View
@@ -5,26 +5,21 @@
<property name="title" value="Greendale"/>
</properties>
<tileset firstgid="1" name="greendale_interior" tilewidth="24" tileheight="24">
- <image source="../images/tilesets/greendale-interior.png" width="576" height="432"/>
+ <image source="../images/tilesets/greendale-interior.png" width="264" height="144"/>
</tileset>
<layer name="background" width="29" height="14">
<data encoding="base64" compression="zlib">
- eJxLZGBgYKYjTgLixFE7R7SdRsPEn+xAzEEi5sRhBro4LjvlgViBRKyIwwx0cVx2mgOxBYnYEqpXGs0MSzx2mlEJGxOhBmanDB3xQNlZCcRMdMRVQAwAchUf4A==
+ eJzTZWBgYKEj1gNiXSBmHiA76YVH7Ry1c9ROBgY+EuyUoRKWJEINzE5+OuKBstMCiJnoiC2BGAC6zw7M
</data>
</layer>
<layer name="side walls" width="29" height="14">
<data encoding="base64" compression="zlib">
- eJxjYGBgMIRiWgJ0O0btHLVz1M5RO9HtNKWxnUDzGwxR+Qy+NLYTaH4DyF4kPl2AL5Kd9AYABnQMEw==
+ eJzt1LEJADAIBMDfwsLeOTJaRstoUUjApH8hkAfBb7xOADCgoSDujL2rm2w3PE2mLJdphiepyxpmbuOb33zVVLLp97ucPf4ENX6/h5t6SSyZ1Znc8Arp
</data>
</layer>
<layer name="accents bg" width="29" height="14">
<data encoding="base64" compression="zlib">
- eJxjYBgFo2AUDHbABcTcQMxDRzuVgFgZiFXoZJ8JEFsBsTUQ29DJTh8gDgLiYCAOoZOdKXSyZyABAOOMAxk=
- </data>
- </layer>
- <layer name="accents" width="29" height="14">
- <data encoding="base64" compression="zlib">
- eJxjYBgFo2AUDBbAC8R8NDJbCoe4KhCr0chOXMAWiO2AOBCLXCoQpwFxOhBnIIl7ArEXEHtD+ZJYMD4QCsRhQByAJm4FxLVAXAfE9UDcQKQfiAG5QJwHxP5Y5KYC8TQgng7EM6hoJwz40cBMYgEALO0LQw==
+ eJxjYBgFo2AUDBbABcTcNDKbF4e4KBCL0chOXEABiBWBWAtJTIqAHiUgVgZiFSifBwvGB7SBWAeINZHEVIlzLtnADIjNgVgDScyAxnbCgDqd7MEGAHfEAwk=
</data>
</layer>
<objectgroup color="#0000a4" name="nodes" width="29" height="14">
@@ -34,12 +29,42 @@
<property name="to" value="main"/>
</properties>
</object>
- <object type="floorspace" x="96" y="264" width="552" height="48">
+ <object name="main" type="door" x="168" y="240" width="23" height="45"/>
+ <object type="sprite" x="72" y="258" width="74" height="54">
<properties>
- <property name="angled" value="true"/>
- <property name="offset" value="5"/>
+ <property name="depth_offset" value="30"/>
+ <property name="height" value="54"/>
+ <property name="sheet" value="images/table.png"/>
+ <property name="width" value="74"/>
</properties>
</object>
- <object name="main" type="door" x="168" y="240" width="23" height="45"/>
+ <object type="sprite" x="58" y="230" width="34" height="70">
+ <properties>
+ <property name="depth_offset" value="19"/>
+ <property name="height" value="70"/>
+ <property name="sheet" value="images/plant.png"/>
+ <property name="width" value="34"/>
+ </properties>
+ </object>
+ </objectgroup>
+ <objectgroup name="floorspace" width="29" height="14">
+ <object name="table" x="104" y="282">
+ <properties>
+ <property name="height" value="22"/>
+ </properties>
+ <polygon points="0,0 40,0 10,30 -30,30"/>
+ </object>
+ <object name="bookshelf" x="600" y="264">
+ <properties>
+ <property name="height" value="93"/>
+ </properties>
+ <polygon points="0,0 24,0 48,24 24,24"/>
+ </object>
+ <object x="72" y="264">
+ <properties>
+ <property name="primary" value="true"/>
+ </properties>
+ <polygon points="0,0 552,0 600,48 0,48 30,18 -20,18"/>
+ </object>
</objectgroup>
</map>
View
@@ -284,7 +284,6 @@ function state:keypressed( button )
--set the position before the switch to prevent automatic exiting from touching instant doors
level.player.position = {x=coordinates.x, y=coordinates.y} -- Copy, or player position corrupts entrance data
- Gamestate.load(self.zone.level, level.new(level.name))
Gamestate.switch(self.zone.level)
end

0 comments on commit 59a5870

Please sign in to comment.