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.
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
Thanks a lot! That's really good to hear and that's definitely the way to learn, just by figuring stuff out, adding new features etc. I'm no expert and have been learning exactly the same way. Yea I always like seeing what others have done and what features they've added etc. Maybe you can put the pics online? There's lots of free image sharing sites (imgur, imgbb)
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!
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: reader = csv.reader(csvfile, delimiter=',') for x, row in enumerate(reader): for y, tile in enumerate(row): world_data[x][y] = int(tile) world = World() player, health_bar = world.process_data(world_data)" 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
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.
Would there be a method or collision formula that would force the enemy unit to switch directions, if it reached the edge of the platform it was standing on. I am assuming it would be with the collision section, regarding the enemy bottom and the tile top. but I guess I dont fully understand the formula in order to amend or add a check for this.
Hi Harry, glad you got it figured out, I didn't get round to checking the comments until now. Yea you definitely could add in a bit more intelligence to the AI - one way I can think of would be that prior to the enemy moving, it first does a check to see if there is a ground tile in front of it (you would take the soldier's co-ordinates, work out where he is on the tile map and then check the next tile over). It's doable, but could be a little tricky to get right. I took the easy way out and just made sure they had enough room when creating levels, but it was trial and error and there were lots of red guys falling off during that process 😀
@@CodingWithRuss 100% Thanks man. Just finished your series. Its great stuff, and I have started working on my own project because of it. (only 3 months into learning python...so, its slow going.)
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?
Time line 23:14 - You declare level_complete = False and True in the next If routine. I'm using MS Visual Studio and it the two variables won't even acknowledge each other (greyed out). I've even tried using a Global and that's just painful. Any answers appreciated, I've come too far to give up now :(
I don't how your doing it but I just can't get a boolean statement returned from the class. Literature says Python doesn't do this. I set screen_scroll to 1000 to get the argument back. But now I can't get level_complete back to False and all the tiles on the next level are a jumbled mess.
@@CodingWithRuss Thanks Russ, no typos, I swapped the True/False argument for a 0 or 1 argument, presto, worked. But the tiles still won't load correctly next level. I'm thinking of putting that all into a def load_tiles routine. Cheers - great tutoring.
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?
@@CodingWithRuss No, I had forgotten to create an empty list for the world_data variable. I have it fixed now, but thank you for getting back to me. I do want to try to create a level menu system, so that instead of just automatically playing the next level, there is menu for navigating through unlocked levels. If you think this is a good idea, I was wondering if you could do a tutorial on it? You're really good at figuring stuff out, so I thought this might be up your alley.
@@StormwreckerOfficial Ah nice, glad you got it working. That does sound like a good feature and could be interesting to develop something like that. It could be done with a bunch of buttons (i have an existing button class that could be used for this). Then each button will be assigned a specific level number so when any of them are clicked, it will launch that level. That's how I would approach it and see if it works. I wouldn't have time to work on that now though, I've been working on my website, which is taking a lot of time.
@@CodingWithRuss I understand. I have been working on getting it up and running. I have created a separate level button class which has extra characteristics, including an integer which represents the level that the button is "storing." I have also created a "game_state" variable that updates every time the game switches between menus. There are some bugs I've been fixing, but it is do-able. If you want, I could send it to you via email, so you could kind of "proof-read" it for inefficient code.
I know it.s been so many years, but maybe if you are still here... Have you resolved this issue? It's the same for me and i can't wrap my head around it no matter what i try
Hi Eli, I started by following tutorials to learn the basics and then started making my own games. Start with something small first, like tic tac toe and see if you can make it yourself. Then from there you can move to bigger projects
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.
Thanks a lot! I'm glad these are helpful 🙂
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.
Thanks Dan! Glad to hear the videos are useful
"Hello folks" is the intro i have been waiting for days lol love your tutorials
My standard greeting 😀
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
Thanks a lot! That's really good to hear and that's definitely the way to learn, just by figuring stuff out, adding new features etc. I'm no expert and have been learning exactly the same way. Yea I always like seeing what others have done and what features they've added etc. Maybe you can put the pics online? There's lots of free image sharing sites (imgur, imgbb)
Another lesson completed, still working as a charm
Thanks alot, Russ, dear teacher
Thanks Anton, glad to hear it. Looks like you have nearly completed this one :)
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!
is about waiting everyday to continue this great proyect bro, amazing
Thanks! I will have the last part uploaded soon
Just subbed, you're incredible man, looking forward to more videos!
Awesome, thank you!
I am on a roll today!
it's really helpful to me thank you
Glad to hear it!
@@CodingWithRuss Can you tell me about the next campaign
@@CodingWithRuss I can't do anything to get the player to stand up in the box, hoping for your help
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:
reader = csv.reader(csvfile, delimiter=',')
for x, row in enumerate(reader):
for y, tile in enumerate(row):
world_data[x][y] = int(tile)
world = World()
player, health_bar = world.process_data(world_data)"
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
Cool
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.
Nevermind, i found it. was the speed argument on the soldier class...at 3, meant the soldier were walking off the edges..
Would there be a method or collision formula that would force the enemy unit to switch directions, if it reached the edge of the platform it was standing on. I am assuming it would be with the collision section, regarding the enemy bottom and the tile top. but I guess I dont fully understand the formula in order to amend or add a check for this.
Hi Harry, glad you got it figured out, I didn't get round to checking the comments until now.
Yea you definitely could add in a bit more intelligence to the AI - one way I can think of would be that prior to the enemy moving, it first does a check to see if there is a ground tile in front of it (you would take the soldier's co-ordinates, work out where he is on the tile map and then check the next tile over). It's doable, but could be a little tricky to get right. I took the easy way out and just made sure they had enough room when creating levels, but it was trial and error and there were lots of red guys falling off during that process 😀
@@CodingWithRuss 100% Thanks man. Just finished your series. Its great stuff, and I have started working on my own project because of it. (only 3 months into learning python...so, its slow going.)
Can you teach us how to make apps with python?
amazing
Thanks!
in process_data
return player, health_bar
UnboundLocalError: local variable 'player' referenced before assignment
how do i fix this?
Have you created any level files yet? If so, make sure the player has a spawn point I had the same issue.
@@khorneflakes4446 yeh I figured this out 4 months ago, thanks anyways though
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?
How do I specifically load a level/csv file? I've been trying to create a "tutorial" level and have been struggling
Time line 23:14 - You declare level_complete = False and True in the next If routine. I'm using MS Visual Studio and it the two variables won't even acknowledge each other (greyed out). I've even tried using a Global and that's just painful. Any answers appreciated, I've come too far to give up now :(
I just opened it up in VS code to check and it works fine. You sure there are no typos in the variable names?
What error do you get?
I don't how your doing it but I just can't get a boolean statement returned from the class. Literature says Python doesn't do this. I set screen_scroll to 1000 to get the argument back. But now I can't get level_complete back to False and all the tiles on the next level are a jumbled mess.
@@CodingWithRuss Thanks Russ, no typos, I swapped the True/False argument for a 0 or 1 argument, presto, worked. But the tiles still won't load correctly next level. I'm thinking of putting that all into a def load_tiles routine. Cheers - great tutoring.
OK that worked onto level 13
@@philluvschips3787 Phew! Strange that the original code runs for me and not for you, but glad to hear you got it working another way.
when i try to add menu, when i try its not responding
Hello Russ, thank you so much for your amazing videos ! One day, can you make a video on how to use spritesheet in pygame ? Thank you again !
Thanks Max, yea sure, I plan to do that soon!
@@CodingWithRuss Okay, thank you !
is there some solution to the game screen freezing for a bit before i restart the game?
How do you get the level editor?
please, someone explain time[1], time[0] means and why in screenblit we pass two values of title at once: title[1]?
great video but quick question how do you save the level_data files it does not say the download button can you help me
I didn't notice that before. You could fork/clone the repo and then you will have all the files in the correct folders automatically
@@CodingWithRuss thanks so much your videos are the best m thing worked well
@@CodingWithRuss oh and i subscribed to you
@@annmugo Thanks :)
Hey import button not module not found please tell me❤
Did you create the button.py file and put it in the same folder as main.py
how many more video will it take to complete.
Only one more video
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?
Do you have the level_data file in the folder? It may be missing
@@CodingWithRuss No, I had forgotten to create an empty list for the world_data variable. I have it fixed now, but thank you for getting back to me. I do want to try to create a level menu system, so that instead of just automatically playing the next level, there is menu for navigating through unlocked levels. If you think this is a good idea, I was wondering if you could do a tutorial on it? You're really good at figuring stuff out, so I thought this might be up your alley.
@@StormwreckerOfficial Ah nice, glad you got it working. That does sound like a good feature and could be interesting to develop something like that. It could be done with a bunch of buttons (i have an existing button class that could be used for this). Then each button will be assigned a specific level number so when any of them are clicked, it will launch that level.
That's how I would approach it and see if it works. I wouldn't have time to work on that now though, I've been working on my website, which is taking a lot of time.
@@CodingWithRuss I understand. I have been working on getting it up and running. I have created a separate level button class which has extra characteristics, including an integer which represents the level that the button is "storing." I have also created a "game_state" variable that updates every time the game switches between menus. There are some bugs I've been fixing, but it is do-able. If you want, I could send it to you via email, so you could kind of "proof-read" it for inefficient code.
Hey it is bringing an error saying base_color and hovering_color argument are required from the button class 😭 help pls 🥺
Hello, the button code used for this game doesn't use those variables, double check the code on github to make sure you have the right one.
I can't access the link for assets Please create a new link for downloading assets.
I'll update the links. Try my github for now, all the assets are there: github.com/russs123/Shooter
How come level 3 is just a bunch of "Nothing-Ness"?
My imagination ran out after 2 levels :D. The rest of the levels are a blank canvas for you guys to create
@@CodingWithRuss Yeah I saw that you made a "Level Editor" Now I have 4 levels :)
Anyway someone can help me out? When I run this pygame doesn't respond and I have to exit using the python shell to get rid of the pygame screen.
I know it.s been so many years, but maybe if you are still here... Have you resolved this issue? It's the same for me and i can't wrap my head around it no matter what i try
My buttons are not working
You may have made a typo somewhere. Take a look at the source code in the description and see if you can find the issue
@@CodingWithRuss error solve
Hello bro
My import function isnt working for some reason.. can you tell why?
nvm nvm it works now, Thanks for all these tuts till now, helped alot!
Glad you got it figured out!
russ I'm an eight year old kid how did you get in to coding?
Hi Eli, I started by following tutorials to learn the basics and then started making my own games. Start with something small first, like tic tac toe and see if you can make it yourself. Then from there you can move to bigger projects
@@CodingWithRuss thanks
o/ :D
How to sell our game online..?