Creating a Zelda style game in Python [with some Dark Souls elements]

Clear Code · 3.2M views · 2022 · 7:38:56

Open on YouTube

Indie game developmentGame programming & enginesPython, Ruby & scripting languagestutorial

Why Stack Overflow recommends it

Stack Overflow users cite it as the source project when they hit bugs in code they copied from it, and they link it as a reference for tile layers and graphics handling in pygame.

Recommended by 1 people across 1 different months, 2022 to 2023.

What it is

A 7.5-hour pygame tutorial by Clear Code that builds a Zelda-style action RPG in Python with Dark Souls touches. It covers level setup with Tiled maps, a player camera, sprite animations, weapons, magic, enemies, particles, a UI and an upgrade menu. Project files and art assets are provided.

What people said

Recommends KillJoy · 2022-07 · Stack Overflow · on “AttributeError: 'Group' object has no attribute 'hitbox'”

I've been teaching myself PyGame following Clear Code's video on YouTube: [this video] but i hit a wall and no matter how many times i re-watch the video i cant find a single character out of place or understand why his code is running without adding the attribute like my script is requesting me to do. Here are the scripts i believe that one would need to help me troubleshoot as well as the error output im receiving: error output [Running] python -u "c:\Devver\main.py" pygame 2.1.2 (SDL 2.0.18, Python 3.10.5) Hello from the pygame community. [LINK] Traceback (most recent call last): File "c:\Devver\main.py", line 30, in <module> game.run() File "c:\Devver\main.py", line 24, in run self.level.run(

Cites Nabil · 2022-09 · Stack Overflow · on “How can I show a Game over screenand stop the game when the health reaches 0 in pygame?”

So, I have a problem in my python code. I made a 2d game by following this tutorial on youtube [this video] . I finished the tutorial, but the maker of the video doesn't show how to make a function to die and display a game over screen. As such, I searched on the internet how to make a Game Over screen and I made it. But now I have to implement that when self.health <= 0 , the Game Over screen shows up. I have a file player.py with the health of the player, but how can I connect this with the main.py file to display the Game over screen when the health reaches 0? Thanks to the one who will help me! main.py: class Game: def __init__(self): # general setup pygame.init() self.screen = pygame.display

Cites Henri · 2022-10 · Stack Overflow · on “I am getting a IndexError: list index out of range in pygame/python”

So I am making a game in pygame and for the graphics I watched a Clear Code tutorial [this video] for style,layout in layout.items(): for row_index,row in enumerate(layout): for col_index, col in enumerate(row): if col != '-1': x = col_index * TILE_SIZE y = row_index * TILE_SIZE if style == 'boundary': Tile((x,y),[self.obstacle_spites],'invisible') if style == 'nature': surf = graphics['nature'][int(col)] Tile((x,y),[self.visible_sprites],'nature',surf) In surf = graphics['nature'][int(col)] I am getting an IndexError: list index out of range error Why is this happening?

Cites Elias Lind · 2023-02 · Stack Overflow · on “Overlapping Tile Layers from CSV files in Pygame”

I am trying to create a display surface in pygame that has mutliple tile layers involved in the making of it. I have a background, accessories, brown_dirt, yellow_dirt, and water csv files that I am reading from. I am then matching each to its respective tile from a tile set that I parsed into 32x32 tiles. What I need help with is how to layer the tile layers based on a specific order. The last link on the Youtube video from minutes 50-1:10 he walks through adding a y index to allow for this to work, but I don't believe that would work for my problem because I have a surface for each given tile I want to put. Below is all of the relevant code for this issue, but the most important sections c