pymunk_demo_platformer_04.py Diff

pymunk_demo_platformer_04.py
--- C:\Users\craven\Desktop\WebServer\arcade\doc\tutorials\pymunk_platformer\pymunk_demo_platformer_03.py
+++ C:\Users\craven\Desktop\WebServer\arcade\doc\tutorials\pymunk_platformer\pymunk_demo_platformer_04.py
@@ -53,7 +53,29 @@
 
     def setup(self):
         """ Set up everything with the game """
-        pass
+
+        # Create the sprite lists
+        self.player_list = arcade.SpriteList()
+        self.bullet_list = arcade.SpriteList()
+
+        # Read in the tiled map
+        map_name = "pymunk_test_map.tmx"
+        my_map = arcade.tilemap.read_tmx(map_name)
+
+        # Read in the map layers
+        self.wall_list = arcade.tilemap.process_layer(my_map, 'Platforms', SPRITE_SCALING_TILES)
+        self.item_list = arcade.tilemap.process_layer(my_map, 'Dynamic Items', SPRITE_SCALING_TILES)
+
+        # Create player sprite
+        self.player_sprite = arcade.Sprite(":resources:images/animated_characters/female_person/femalePerson_idle.png",
+                                           SPRITE_SCALING_PLAYER)
+        # Set player location
+        grid_x = 1
+        grid_y = 1
+        self.player_sprite.center_x = SPRITE_SIZE * grid_x + SPRITE_SIZE / 2
+        self.player_sprite.center_y = SPRITE_SIZE * grid_y + SPRITE_SIZE / 2
+        # Add to player sprite list
+        self.player_list.append(self.player_sprite)
 
     def on_key_press(self, key, modifiers):
         """Called whenever a key is pressed. """
@@ -70,6 +92,10 @@
     def on_draw(self):
         """ Draw everything """
         arcade.start_render()
+        self.wall_list.draw()
+        self.bullet_list.draw()
+        self.item_list.draw()
+        self.player_list.draw()
 
 def main():
     """ Main method """