PyGame Scrolling Shooter Game Beginner Tutorial in Python - PART 12 | Main Menu and Restart Level

preview_player
Показать описание
In this Python tutorial I code a Scrolling Shooter Game using the PyGame module. I'm going to cover how to create a main menu as well as an option to restart the level after the player has died

Credits for assets used:

Check out my other PyGame tutorials:
Рекомендации по теме
Комментарии
Автор

You're under-rated aha I've learnt more from simply watching this then going through hour long courses. Hope to see more from you.

HostileOTB
Автор

"Hello folks" is the intro i have been waiting for days lol love your tutorials <3

BeRaikwal
Автор

This was excellent, I have watched so many “state videos” but they always create separate state handlers which make it difficult to follow. This was very easy to follow along. I also like that you assist the viewer by only creating new variables just before you use them. It makes it easier to understand specifically what you are working on.

danwalker
Автор

Hey Russ just want to let you know you have inspired me my friend... I just spent the last 2 days trying to fig out how to do what you explained in this video and today ugh finally I got it done sadly it is not as nicely coded as your code but never the less I did it on y own ! this doesn't mean I am done watching you I have a lot to learn but it means that I am getting the know how on things and can't thank you enough. I have added things like lives and removing the dead sprites as there killed I redid the Level editor and made it with other stuff the list goes on man You are amazing my friend would love to share the pics of things I made so far if i can let me know how other wise nw you rock no matter what :D

johnandlisalinderman
Автор

Your vids was great!!!
However for thoese that don't know:
If the screen scrolls the enemie visions actually doesn't adjust the position
So in the AI funtion that's inside the solder class, after self.rect.x += screen_scroll, just put self.vision.x += screen_scroll and that will fix the problem!

nightmanmain
Автор

Another lesson completed, still working as a charm
Thanks alot, Russ, dear teacher

АнтонНазарук-щс
Автор

is about waiting everyday to continue this great proyect bro, amazing

OmarRamirez-edbw
Автор

Just subbed, you're incredible man, looking forward to more videos!

naxo
Автор

Hello Russ, I had an error I was hoping you can help me solve
in the
"with open(f'level{level}_data.csv', newline='') as csvfile:
= csv.reader(csvfile, delimiter=', ')
x, row in enumerate(reader):
y, tile in enumerate(row):
= int(tile)
= World()
health_bar =


in both the new level and restart level I get this error "list index out of range", I have created the empty list world_data and I have "level1_data level2_data and level3_data in my folder

alichahbandar
Автор

it's really helpful to me thank you

quanvu
Автор

in process_data
return player, health_bar
UnboundLocalError: local variable 'player' referenced before assignment

how do i fix this?

tgk
Автор

Hey man, i been working through this series quite diligently.

I am having an issue here at the end. Some of the enemies seem to not turn around in teim, and walk off the edge of whatever they are standing on, and fall to their demise.

Any ideas, on where I might have made a mistake in the coding, ie - where to look?

I have dl'd your example from github...but struggling to see discrepancies.

HoRRoRlets
Автор

How do I specifically load a level/csv file? I've been trying to create a "tutorial" level and have been struggling

fate
Автор

is there some solution to the game screen freezing for a bit before i restart the game?

fiascogamingchannel
Автор

when i try to add menu, when i try its not responding

melonmidi
Автор

Hey it is bringing an error saying base_color and hovering_color argument are required from the button class 😭 help pls 🥺

adoniyasephraim
Автор

I have added depleting maximum HP and I want to continue to base the game around trading HP for items. Is there a way to not have the HP and items reset upon entering new levels?

khorneflakes
Автор

Hi! Thanks for the tutorial! When the game loads level 2, I get this error:

world_data[x][y] = int(tile)
IndexError: list assignment index out of range


I've checked to make sure that nothing was wrong, but is there something I could be missing?

stormwrecker
Автор

please, someone explain time[1], time[0] means and why in screenblit we pass two values of title at once: title[1]?

ratsplinter
Автор

Can you teach us how to make apps with python?

Billy-yxse