1. Sami Loone
  2. Fat x Fast

Commits

dryatu desk  committed de4e299

Changed the readme. Minor code improvements.

  • Participants
  • Parent commits a39d43d
  • Branches default

Comments (0)

Files changed (4)

File FatxFast/rsc/levels.xml

View file
  • Ignore whitespace
     </map>
     <map type="custom">
         <filename>sokkelo.tmx</filename>
+        <maps_left>1337</maps_left>
     </map>
 </timedmode>
 <classicmode>

File FatxFast/rsc/widgets.xml

View file
  • Ignore whitespace
 	
 	<gamebar type="boxwidget" name="gamebar" width="1024" height="100" x="0" y="0"></gamebar>
 	<buffbar type="menuwidget" name="buffbar" width="64" height="650" x="0" y="60"></buffbar>	
-	<attributebar type="boxwidget" name="attributebar" width="1024" height="150" x="0" y="0"></attributebar>
+	<attributebar type="boxwidget" name="attributebar" width="1024" height="150" x="0" y="0"></attributebar> 
     <gamehud type="boxwidget" name="game" width="1024" height="710" x="0" y="0"></gamehud>
 	<gametext type="textwidget" y="0" size="28" color="gold3"></gametext>
     <separator type="boxwidget" y="0" x="0" bgcolor="black" />
     
-
 	<buffwidget type="boxwidget" y="auto" width="100" height="64"></buffwidget>
 	<bufftext name="bufftext" type="textwidget" y="21" x="21" size="26" color="gold3" font="lavoir.ttf"></bufftext>
     <buffstacksizetext name="buffstacksizetext" type="textwidget" y="0" x="0" size="22" color="red3" font="lavoir.ttf"/>

File FatxFast/tilemap/gamemap.py

View file
  • Ignore whitespace
         self.properties = {}
         self.spawnareas = camera.CameraGroup()
 
-    def draw(self, surface, camera):
-        surface.fill((0,0,0))
-        self.renderer.set_camera_rect(camera.rect)
-        self.renderer.render_layer(surface, self.sprite_layers[GROUND_LAYER]) 
-        self.draw_sprites(surface, camera)
-        self.renderer.render_layer(surface, self.sprite_layers[ROOF_LAYER]) 
-
-    def draw_map(self, surface, camera):
-        """Blit the big surface of maze at a desired location.
-        Defaults to the topleft corner of its rect"""
-        self.renderer.set_camera_rect(camera.rect)
-        for layer in self.sprite_layers:
-            if layer.visible and not layer.is_object_group:
-                self.renderer.render_layer(surface, layer)
-
-    def draw_sprites(self, surface, camera):
-        self.world.draw(surface, camera)
-
     def _create_entity(self, class_id, **kwargs): 
         init_object = class_id(**kwargs)
         self.world.add(init_object)
             self._create_object(obj, obj_class, **obj.properties)
 
     def _create_spawn(self, class_id, **kwargs):
+        # Creates a spawn object. Entity_id IDs the spawnable objects
         init_object = self._entity_types[SPAWNAREA_ID](self.world, 
             **kwargs)
         init_object.add_entity_class(class_id)
     def _create_trigger(self, class_id, **kwargs):
         self.triggers.add(self._create_entity(class_id, **kwargs))
 
+    def draw(self, surface, camera):
+        surface.fill((0,0,0))
+        self.renderer.set_camera_rect(camera.rect)
+        self.renderer.render_layer(surface, self.sprite_layers[GROUND_LAYER]) 
+        self.draw_sprites(surface, camera)
+        self.renderer.render_layer(surface, self.sprite_layers[ROOF_LAYER]) 
+
+    def draw_map(self, surface, camera):
+        """Blit the big surface of maze at a desired location.
+        Defaults to the topleft corner of its rect"""
+        self.renderer.set_camera_rect(camera.rect)
+        for layer in self.sprite_layers:
+            if layer.visible and not layer.is_object_group:
+                self.renderer.render_layer(surface, layer)
+
+    def draw_sprites(self, surface, camera):
+        self.world.draw(surface, camera)
+
     def get_tile_by_coordinate(self, pos):
         return self.get_tile(self.get_tile_position(pos))
 
         #self.renderer = MapRenderer(len(self.sprite_layers))
 
     def _load_saved_properties(self, obj, save):
+        # Merge saved data to the object's properties - ID'd by obj_name
         obj_name = obj.properties.get("name")
         if not obj_name is None and obj_name in save.mapdata:
             obj.properties.update(save.mapdata[obj_name])

File README.txt

View file
  • Ignore whitespace
 but custom maps can be created with tiled(http://www.mapeditor.org/).
 
 Game is tested on python 2.7.5 Windows 7 x64 and Linux x86/x64
-Libraries used: pygame, tiledtmxloader(by DR0ID), matplotlib(Optional)
+Libraries used: pygame(1.9.2), tiledtmxloader(by DR0ID), matplotlib(Optional)
 
 
 Contact info