Multiple Scenes in Pygame Tutorial (Gamestates)

  Рет қаралды 10,109

Coding with Sphere

Coding with Sphere

Жыл бұрын

Thanks for watching!
I'm still new to making KZbin videos so please leave your constructive criticisms in the comments!

Пікірлер: 23
@wilzzuu
@wilzzuu 6 ай бұрын
This is by far the best tutorial for game states that I have found, thank you so much!
@the_foliot
@the_foliot 5 ай бұрын
So my take away is that I really like this method of game state management, but like you sad it does not inherently run simultaneous loops so if you are running the game loop then change states and you only run the pause state/loop and switch back to game then essentially it will reset unless you do that extra finicking, possibly in the form of storing the data temporarily and then reloading the info when you switch back to game state from pause or other. Anyway, thank you, I will be attempting to adapt this game state manager.
@Smyky
@Smyky 10 ай бұрын
This tuto is so clear. Your voice so calm when explaining so this is very enjoyable and easy to understand. Thanks you so much.
@chalkypj
@chalkypj Жыл бұрын
Excellent tutorial which was easy to follow and easy to understand. You explain things well. Good that you give the prerequisites.
@kinuseo1616
@kinuseo1616 Жыл бұрын
This is so simple compared to other explanations, very valuable information. keep it up!
@user-uy8eu6yd4w
@user-uy8eu6yd4w 5 ай бұрын
Thank you very much for your explanation. It is practical and has clear inspiration. This is your achievement!
@user-eo4pv7ir3m
@user-eo4pv7ir3m 5 ай бұрын
thanks man please keep on giving us this tutorials , are quite useful, I hope that you reach a million followers very soon
@fadhillahsidik
@fadhillahsidik 9 ай бұрын
Exactly what I need man! Thank you so much!
@TasteDaRDX
@TasteDaRDX 9 ай бұрын
Great technique, thanks for sharing. I see a lot of potential to improve my games that used several while run for different menus, which got very complex and hard to track/debug.
@sergey_a
@sergey_a 7 ай бұрын
14:25 If you want to do this, you create a simple function outside the class that has an if else condition. And projects are launched in them.
@dylansaga
@dylansaga 6 ай бұрын
mate this was a great tutorial so high quality deserves more views and subscribers keep making videos you will get big
@antoine-alexandrleytens9941
@antoine-alexandrleytens9941 7 ай бұрын
Man... You are my hero !
@aniketbarad7962
@aniketbarad7962 3 ай бұрын
great video helped me a lot thanks
@Ch4gx
@Ch4gx Ай бұрын
Sheesh! this tuts slaps! im still so confuse making classes but sheesh! may i request for github as a guide?
@R00kTruth
@R00kTruth Ай бұрын
screen sizes shouldn't be a constant anyways, as some applications allow you to change the size, depending on the resolution of main display.. anyways i suppose Tuples would be classed as a "constant"
@codingwithsphere
@codingwithsphere Ай бұрын
For this example, there is no intention for the screen to be resized, so the screen size variables being constant works fine
@R00kTruth
@R00kTruth Ай бұрын
@@codingwithsphere I know, my comment was for others, as programming in this style (oop), it's best to keep it as modualer as possible, so you're able to reuse the code in other projects, also this was just a reply to your comment about constant "I don't think there is a way to do constant within python"
@varunnayak5369
@varunnayak5369 7 ай бұрын
I made a Home Screen for my chess game using Pygame (it doesn't look too bad but obviously not industry-standard with PyGame) and I seem to be having a problem with my screens. When I run my code, it not only generates the screen from the Home Screen code but then over it, it generates a new screen with the chess game itself running. Do you think that using a game state manager would be useful in this situation since all of my code is in PyGame? I would have used gui Zero for my UI but then I thought that I would have problems with integrating my chess game into it which works and is written in PyGame.
@R00kTruth
@R00kTruth Ай бұрын
did you sort this out, it seems you're bliting both images at once, perhaps introduce a scene(s) manager into your program.
@varunnayak5369
@varunnayak5369 Ай бұрын
@@R00kTruth It wasn't because I'm blitting both images at once. It was generated two different windows at the time and I think it may have something to do with the use of multiprocessing and the collisions of graphics packages as I was also using some other graphics packages for the project, which I found out through a Google search (I knew I was using two graphics packages but I didn't know about this stuff on collisions where the use of multiple will affect the functionalities of the others. Every time that the program ran into an instance of a screen (Each of the PyGame screens which I planned to use was its own object so that it would be easier for me to determine which screen to flick to through a simple instantiation), it would generate a new window displaying that screen and I tried to change and play around with my screen change logic (which I thought made sense) but it was done to no avail so instead I decided to use a different graphics package since PyGame graphics is more for the game itself, though they are decent. I found a way around this issue through using tkinter for my main menu screen and login screen UI and then using Pygame for the game functionalities, which seemed to work fine, though I'm not a huge tkinter fan. .
@R00kTruth
@R00kTruth Ай бұрын
@@varunnayak5369 yeah that will do ut lol, pygame isn't designed/programmed in the way to handle multiple windowing, There are ways around it, but 9/10 of the times will cause more problems then worth. depending on the complexity of your games/apps, it might make more sense and beneficial to create an event manager class, so you can keep all events in one file(location). but use the example within the guide, and make a skeleton file of the basics, and just experiment by adding more classes, ro repersent different scenes(colours), then rather them all being called via the events, have one or two called before you call your app from the main condition( name=__'main'__). I was hoping to have my system to be set up, to be able to give you some examples, however I have contractors working at my property, and dont have my otg kit to attach to dex. but if you're able to upload any code to pastebin, just reply I and others can see where you may need help(if you require it). anyways goodluck if no help is required. and feel free to message back anytime.
Sliders | Pygame Tutorial
14:02
Coding with Sphere
Рет қаралды 4,3 М.
Saving and loading in pygame with json
25:23
Clear Code
Рет қаралды 28 М.
La revancha 😱
00:55
Juan De Dios Pantoja 2
Рет қаралды 64 МЛН
⬅️🤔➡️
00:31
Celine Dept
Рет қаралды 37 МЛН
I made Games with Python for 10 Years...
28:52
DaFluffyPotato
Рет қаралды 258 М.
I Made a Neural Network with just Redstone!
17:23
mattbatwings
Рет қаралды 594 М.
Easy Way to Make Jumping in PyGame! (7 Mins)
7:24
baraltech
Рет қаралды 29 М.
Create Buttons in PyGame! (Python Button Class Tutorial)
22:33
LeMaster Tech
Рет қаралды 10 М.
Pygame Menu System Tutorial Part 1: Game Loops and Structure
18:26
How to Code (almost) Any Feature
9:48
DaFluffyPotato
Рет қаралды 651 М.
So you want to make a Game Engine!? (WATCH THIS before you start)
14:39
Giant Sloth Games
Рет қаралды 263 М.
Make Your Own Raycaster Part 1
16:52
3DSage
Рет қаралды 401 М.
AIs learn to WALK
20:21
Pezzza's Work
Рет қаралды 52 М.
skibidi toilet multiverse - season 09 (all episodes)
1:7:26
DOM Studio
Рет қаралды 4,7 МЛН
[RU] BLAST Premier Spring Final 2024 - Day 5
4:46:21
RLG PARI RU
Рет қаралды 363 М.