Creating a Stardew Valley inspired game in Python
A Stardew Valley style game in Python and Pygame. This includes
farming and foraging, a day and night cycle, weather effects
and a merchant. The game was also made in Tiled so you can
expand it yourself.
You can get my Pygame course here: www.udemy.com/course/learn-py...
If you want to support me check out my Patreon: / clearcode
(You also get lots of perks and all my courses)
Social stuff:
Twitter - / clear_coder
Discord - / discord
Project files:
github.com/clear-code-project...
Links to related pygame videos:
Ultimate introduction to Pygame - • The ultimate introduct...
Delta time in pygame - • Understanding framerat...
Masks in pygame - • Understanding Pygame m...
Collisions - • Collisions between mov...
Tiled - • A guide to level creat...
Cameras - • Cameras in Pygame
Timestamps:
0:00:00 - Intro
0:01:53 - Setup
0:10:19 - Creating the basic player
0:29:49 - Importing the player graphics
0:42:59 - Animating the player
0:53:32 - Tool use
1:09:04 - Switching between tools
1:21:27 - Creating the overlay
1:32:20 - Starting the camera and importing the floor
1:50:50 - Importing all elements and faking more 3D
2:18:52 - Collisions
2:42:29 - Working on the trees
3:06:42 - Particles
3:16:32 - Player inventory
3:21:57 - Restarting the day
3:46:00 - Starting the soil
4:12:29 - Soil patch graphics
4:32:51 - Watering logic
4:43:19 - Rain
5:03:36 - Creating the plants
5:24:56 - Harvesting
5:32:53 - Daytime transition
5:41:04 - The merchant
6:23:46 - Audio (+ some final fixes )
Пікірлер: 510
I've learned more theory and code patterns from your videos than in years of studying textbooks. Thank you so much for your excellent content!
@ClearCode
Жыл бұрын
hey, thank you so much! And super happy to hear that the videos are helpful :)
@cowiekmaupa
Жыл бұрын
what have you been reading? html for dummies?
Can't wait to watch this after school's over!
@bishnuprasadpahari3780
Жыл бұрын
Lol yez
@Raven-wr4we
Жыл бұрын
damnn, thought it was holidays for all school's atm
@Solomonwo
Жыл бұрын
You can watch it right away, not wait for school being over
@vimwizard
Жыл бұрын
Yoo champ still waiting for holidays or u already watched it?
@vadvenurt
4 ай бұрын
you finished it?
Thank you so much for these tutorials, they have helped me tremendously.
@ClearCode
Жыл бұрын
Hey, thank you so much! You have no idea how helpful that is. Really glad you like the videos so much :)
@GCKteamKrispy
Жыл бұрын
@Clear Code Your videos are veeery helpful, also bought your course😀
@pieterbosch87
Жыл бұрын
Love these game tutorials but how to protect pygames and e.g. sell them? Compiling them to exe or multiplatform. What would be the best distribution posibilities? Perhaps a nice idea for a video:)
@Meletion1
5 ай бұрын
Wow not many replies
You are the BEST! I can't imagine how much effort you put into this tutorial. Thank you!
Wow, I just finished your Zeldalike tutorial and was thinking it would be easy enough to try making this exact concept, you sure work fast. Looking forward to checking this out in detail as well. Thank you for providing these!
Can we like the video 3 thousand times in a row? Dude, I work with written documentation, and I know the amount of fucking work that goes into explaining every single little detail. I've done a couple of explanatory videos before. Nothing comes close to the level of detail and the dedication that you put into your videos. They're very helpful! Thank you very much for putting up this kind of content! It's a blessing for people learning Python and game development in general!
Dude seriously, THANK YOU. The fact that you put in all this work to teach us this stuff is amazing. Just goes to show how much you care. I'll support anything you make!
If you enjoy this video check out my course: www.udemy.com/course/learn-python-by-making-games/?referralCode=A80FECE8C76096E01111 and my Patreon: patreon.com/clearcode
@help6732
Жыл бұрын
can u upload dis game on playstore? (android)
@vPee-Ton
Жыл бұрын
can you post the raw code so I can just copy and paste it into python so i dont waste time please:D
This tutorial is very high quality!! Got to appreciate your work!
@ClearCode
Жыл бұрын
Thank you so much! :)
Can't wait to start this. The other tutorials have given me confidence just to start and this just looks so much more expansive!
Finished this tutorial today. Just want to say thank you for a great video. Really learnt a lot of really neat tricks, and I think you have cleared up some of my confusion regarding object interactivity and importing. Great video...
Currently working through your paid course and now I'm excited to finish that to then start on this tutorial. Thanks for the amazing content.
Just going to toss this into my watch later list for a rainy weekend! Looks great and can't wait to watch.
Thank you so much for all the time and effort you must have put in making and preparing this video!! It was not only helpful in getting to understand pygame, but also more generally how to organize the code with classes. Many thanks, job very well done! :-)
@ClearCode
Жыл бұрын
Thank you so much and glad it helped :)
Thanks so much for this tutorial! I always thought making a game like this would be really difficult, but you've shown me how achievable it is.
Well… isn’t this just a delight.
This guy deserves much more subscribers! Thank you buddy for all the effort and knowledge you share !!
Actually did it... So many obstacles overcome but I actually got it more or less done. Thank you. I learned so much from this project.
AWESOME! Top quality content! Thank you!
doing zelda under your close supervision atm, and then suddenly a new video with even more challenges to overtake! THANK YOU!
Amazing! A lot of effort you put into this tutorial Thanks mate!
These videos are awesome. Please never stop.
it is really nice, I really can't understand how people can create so nice games and so nice videos! You are the best
Your course in Udemy is fantastic, I bump into in your channel and after saw your tutorials I just needed to got the course, congratulations.
This is a great video, very clear and easy to follow along. Thank you so much.
Chris, thanks for the tutorial, my game is running just fine! A lot of the concepts in this tutorial I will use when creating my own projects. God bless you!
This is awesome!! Your videos inspired me to further my education. For that you have earnt my money sadly I don't have any yet but when I do I wont forget you ClearCode! Thanks again
It's like a mix of Stardew Valley and Littlewood. Great job!
I love all these pygame tutorials of yours
Hey clear code! You were a huge help back when I was using pygame and your content quality is amazing. Wondering if you would ever make content about game dev in rust with a framework like bevy
Amazing! These videos are really helpful for learning python
You are making the best tutorials and all free. Thanks bro
Really appreciate the fact that you're making all this for FREE. BTW, your paid Udemy course is very good for the price! Keep up the good work, you're a great YTber!
Totally awesome guide, thanks for your work!
ANOTHER GAME YESSSS I LOVE YOU your tutorials helped me so much !!
this channel is insane, hats off dude!
Wow! Stardew valley is one of my favourite games of all time... Just yesterday I was wondering if I'll be making a clone of it in pygame... And here you are with a video today. Thank you for this!!
@kenna_king100
Жыл бұрын
Me tooo!!
@VickylanceMedia
Жыл бұрын
Although pygame is not suited for a game as large as stardew valley. If you are serious prefer more lightweight and performant engine
@charg1nmalaz0r51
Жыл бұрын
@@VickylanceMedia i disagree, a game like stardew valley isnt that demanding on resources. You can quite happily make most 2d games in pygame without issue. you would have to be doing an awful lot for it to make any sort of performance issue that requires a better language or engine to get the most out of things
This is why I subscribe to your channel. Amazing content, Keep it up.
for those who run into an issue with pygame and mp3 files: from my short dive into it, apparently mp3 is really finnicky on pygame, and some combinations of app versions and OS lead to pygame unable to load mp3s; this was true for my Windows 10 and latest versions of all software. the solution is either skip the mp3s or use/convert to the recommended ogg or wav format (wav didn't cause me no issues).
The quality of your videos is amazing.
I don't even see this kind of master tutorial 🤩 well done brother
Great tutorial! Finished it in 3 days. Excellent
The youtube algorithm threw this at me randomly... 3 hours in and loving it! Thanks for all the effort!
Thank you so much!! Going to start right after I finish the Zelda tutorial :D
Now this is beautiful. Thank you!
I like that you make really long videos so i don't have to switch between different videos every 10 minutes lol
you are honestly the best! thank you for your work❤
Absolutely amazing content!
Thanks you for this great video ! I'm at 32:30 and just in case there's too much animations you can use os module to check for any folder name to create the keys for the assets dictionnary. By using dictionnary comprehension you can also fill it and if you add or remove animations the process work by itself ! 😊
This channel is a gold mine for python tutorials, amazing!
I really enjoy your content for the last year or so that I've been learning python! I did buy your Udemy course too, can't wait to dig into that.
@albertsun8725
11 ай бұрын
I agree
No way!! I was just thinking about this a few weeks ago, I really wanted to make something like this but had no clue how to start. I absolutely love you. Immediately liked the video
Just found a gem of a KZreadr 💎 Just liked & subbed.
Amazing! This video is very helpful
It 100% works now 🎉 was really fun making this. Definitely considering getting the premium assets to really bring this game to have more life
Awesome tutorial dude!
Thank you so much for sharing your valuable knowledge
Hey! I just finished the whole thing and thought I'd give some feed back as thanks, for the great Tutorial! First of all, really great Tutorial and it is clear how much effort it must have been! This tutorial was uplaoded in the right moment for me, because I was looking to refresh my python skills and really didn't just wanna go over the basics or work with a fictional Datascience optimization Example. I was recomended this by chance by the youtube algorithm and saw how long it is and first thought, nah that's insane. A couple days later however I thought this would be the right thing, since I've never done anything like this and it looked like a fun project where I could learn a lot and maybe expaned this whole thing with more tutorials later on. Since I didn't watch any of your previouse videos or worked with Pygame I expected this to be though, and sometimes it got though to understand the full logic. However I thought you explained everything very well. I did start getting more and more impatient/unconentraited after the first couple of hours and it did also feel like you started getting slightly impatient as well after like the 3h mark and especially at the end. I did like that you left the mistakes in, where you checked for why the code was not running. It was just minor things like, cuts in the editing of the video, where the code suddenly would change mid writing or you repeating a sentence. Also when you did your fixes in the end I was a bit confused since your first fix, wasn't necessary in my code, so I assume you did fix it before putting the video together and I didn't have the line to delete. Also stuff like, the s21 Files for Daytime were already changed to the state of the next chapter, which confused for a moment when I tried to find a mistake I did. One last thing was the way to loud background music that you added into the game, I had to take down the Video volume to 20% everytime that played, I feel like something went wrong there with the audio editing in the video. Anyway, this is really just nitpicking, especially on a 6h+ Video. All in all I really loved the Tutorial, the chapters, the explanaitons and all the assets you put in one package so people could work alongside. Everytime I had an issue because I forgot a () somewhere or anything similar I downloaded the Chapter files and went line for line, which really helped. I really would love a part 2 where we learn more about implementing a proper Menu and maybe controler support or just in general build out the programm on this foundation. I'll definetly will look more into PyGame, Tiled and other things to expaned on this and try to make it my own little game project on which I work on over time. First thing I'll fix is the way to fast night timer which also keeps running when your in the menu with the merchant. That one bugged me a lot while testing. I thought I'll give a full feedback since really appreciated the work you put in, hope this is not seen as just me complaining!
@dr_frankenmiller2607
Жыл бұрын
Can you help me to find the assets for this build please? A URL or link to your GitHub where I can find the sprite sheets and WAV files please? I want build this game from scratch the GitHub repo he left up there only has text files
Although I am using other engines to create games, this pygame tutorial helps me to deeply understand the basic of 2d game development. Amazing tutorails, thanks so much.
Great tutorial. Very helpful.
thank u so much bro i hope u can make more pygame next time!
Hey I’ve seen this pack on itch! Fun to see someone using it in the wild
hey clear code you should only make the amazing game on this channel you are awesome
OMG! You are my hero!!!! LOVE THIS!
Finally I dig diamond from KZread search , Thank you so much sir🙏🏼.
Thanks a lot for this Contents .. Its really helping me a ton.
Unbelievable man! God bless you!
I've been a software engineer and mainly python developer for over 15 years now, and programming about 25+ years. Fun to watch your videos and your presentation style. I will definitely pass these along
@gooser1
Жыл бұрын
hiii can you help me please, im stuck at animating my character, my “position center” seems to be off to the right bottom and 0,0 is not in the corner even. idk whats wrong
@jjcruz750
Жыл бұрын
@@gooser1 try leet code or something similar. They might be able to help
I Love this type of videos! But I have a good idea for the next… can you try to make a game like this BUT with online multiplayer? It would be amazing but keep the work up I like it!
This is such a nice game!!
Amazing work!!
Amazing series
I have the dumb, your GitHub has the right files. Thank you.
At 46m09s, for the mechanism to make the frames repeat, instead of using an "if statement" you could use a module operator (%). It is faster (since it wouldn't need to do comparisons all the time) and cleaner (onli one small line of code) Short Example: frame = (frame+dt*4)%len_anim
@kenhaley4
Жыл бұрын
I noticed this as well.
Dude, my head exploded with the sprite updates
I love the tutorials and they really help. Like a lot. Could you please make a tutorial teaching us how to code a pinball game in pygame?
you have earned yourself a subscriber
Clear Code your videos are awesome, they helped me so much, my request, if you would like to, then please create a video on how to solve problems, implement them in code. Thank You!
Loving it so far! BTW 1:15:15 was such a perfect place to use a modulo (%) : self.tool_index = (self.tool_index + 1) % len(self.tools)
@ClearCode
5 ай бұрын
true! :D
@musicdudejoe263
5 ай бұрын
Was just about to comment this haha.
@Kbu73
22 күн бұрын
You can do similarly for the frame_index: self.frame_index = (self.frame_index + 4 * dt) % len(self.animations[self.status])
awesome. find some time to teach us backend development with python too. you are so good.
These are great tutorials, and they have taught me much. I do lament not seeing solutions for adding joystick support through pygame as i tried to add this myself on another clear code project only to fail miserably and become so confused on mutilating the main game loop, it became more maddening than anything positive at all. PLEASE INCLUDE number of lives, joystick support, adding expanded levels, second player or even playing 2 player graphic game over network.... most important though is joystick support because NO ONE, and I mean of the 30-40 tuts ive looked at, NO ONE had joystick support that wors with how you seperate your player out into its own class.
For those who are struggling with walk() function: you probably missed slash or smth. pathlib library is more comfortable to debug so you may want to discover it
Your videos are not good at all their great! Ive learned so much from your videos, Thank you!
Just completed the tutorial - took me about 16 hours total. Wow! Can't believe something like this is free. Learnt a lot and was really fun to learn something new and see/play the final finished game. Would love to see videos on the following types of games uisng pygame: - card game: yu-gi-oh style - pokemon style game - in particular aspects of changing maps, saving files and the turn based battle styles. - A game which utilies random map generation to build worlds for a top down game - A game which has dynamic world - I guess similar to this tutorial but with animals having behaviours that can interact with one another without player input. I will be going through your Zelda tutorials and Mario Maker ones too. Keep up the good work. Thanks !
@gooser1
Жыл бұрын
hi what IDE did you use? im using pycharm and i dont know why it keeps on saying “video not initialized” and “Game” has no attribute “clock”” even i typed the same thing as Clear Code does. ive been having the same problem from my first code but i dont know why this errors keeps on popping up for me. 3:31 and a lot of errors happening already :((
@gooser1
Жыл бұрын
i finished the pygame introduction video by him but idk why im having this kind of problem :((( i would be happy to have help since im presenting this as my final project
@lindenhamer4766
Жыл бұрын
Hi, I used VS code. I haven’t used APY charm before. I’m terms of where you are getting stuck. Don’t worry. I also encountered MANY bugs that I had to overcome - I will say 99% were small typos and other bugs. Potentially start again (as you’re not far into it) and try to write everything from scratch. OR re-download the starting folder and then remove anything which got added before folder was pushed to the repo.
@gooser1
Жыл бұрын
@@lindenhamer4766 hello, thank you for replying. im starting all over again :)) still stuck though which sucks hahaha
@gooser1
Жыл бұрын
oop! update! got it now! :))
You're a good teacher, tnx a loot!!! 👏
Thank you so much!
Great tutorial better than the coding I learnt at university
Fr bro subbing to you was one of the better decisions I've made
You re just amazing!
you are amazing dude like wth
A Tutorial that leads to a bunch of tutorials. Really cool
He make 6 hours gamedev tutorial, amazing
Really helpful.
You honestly deserve so much more recognition
Thank you so much for your tutorials!
great tutorial so far (1 hour in :)), i do have a question regarding the Timer class, any reason to not use the pygame set_timer() ? other than keeping the main loop & events clean, and contain the timers in the relevant class
Muchas gracias, saludos desde Perú
Thank you for your work!! it is very easy to learn with your explanation, is it possible to build a multiplayer with the base of this code?☺
Thanks!!
Wow, your teaching style is incredible! Would it be okay if I used it as inspiration to create content in Portuguese and share it here, in Brazil? Your videos have had such a profound impact on me, and I would love nothing more than to spread your programming culture to my community (i dont have a community right now, but i will try to create one). If you prefer that I don't proceed, I completely understand and will respect your wishes. I absolutely adore your teaching style! Your videos are unlike anything I have ever seen here in Brazil, and I believe they would be an incredible resource for those who are interested in programming but don't speak English. It would be amazing to bring your content to a whole new audience and help bridge the gap for those who are struggling to find quality programming resources in their native language. Is this okay for u?