pymunk_demo_platformer_04.py Diff

pymunk_demo_platformer_04.py
--- /home/docs/checkouts/readthedocs.org/user_builds/arcade-library/checkouts/latest/doc/tutorials/pymunk_platformer/pymunk_demo_platformer_03.py
+++ /home/docs/checkouts/readthedocs.org/user_builds/arcade-library/checkouts/latest/doc/tutorials/pymunk_platformer/pymunk_demo_platformer_04.py
@@ -53,7 +53,31 @@
 
     def setup(self):
         """ Set up everything with the game """
-        pass
+
+        # Create the sprite lists
+        self.player_list = arcade.SpriteList()
+        self.bullet_list = arcade.SpriteList()
+
+        # Map name
+        map_name = "pymunk_test_map.json"
+
+        # Load in TileMap
+        tile_map = arcade.load_tilemap(map_name, SPRITE_SCALING_TILES)
+
+        # Pull the sprite layers out of the tile map
+        self.wall_list = tile_map.sprite_lists["Platforms"]
+        self.item_list = tile_map.sprite_lists["Dynamic Items"]
+
+        # 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 +94,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():