Saving and loading in pygame with json

  Рет қаралды 28,701

Clear Code

Clear Code

Күн бұрын

A tutorial on how to save and load files in pygame using the json module. The approach shown here would work in pretty much any python code and could generally be used to create and load data.
Timetamps:
0:00 - Intro
0:50 - saving information and json
8:46 - creating the clicker game
19:50 - json part of the game

Пікірлер: 85
@mixlaproduction
@mixlaproduction 3 жыл бұрын
The legend is back! :D
@SKSam-bq6zt
@SKSam-bq6zt 3 жыл бұрын
Yeah so cool
@reedhamyt5832
@reedhamyt5832 3 жыл бұрын
I was doing my Computer Science project and was opening the phone to google 'How to save game in pygame' but before that i see this in my notification.😂😂😂
@snowman_student
@snowman_student 3 жыл бұрын
I personally love the minimalist way of your Explanation and edits which makes it easier to get into Head!! Keep. Uploading!! Your Channel is loved!!❣
@meoweth829
@meoweth829 3 жыл бұрын
Please dont stop making these, you inspire me
@SKSam-bq6zt
@SKSam-bq6zt 3 жыл бұрын
Thanks, I just wanted to research this subject and then I found you uploaded this video. It's really important and useful in pygame games.
@SKSam-bq6zt
@SKSam-bq6zt 3 жыл бұрын
But man you are really underrated.
@ElvB
@ElvB 3 жыл бұрын
Helpful videos and great explanation!
@guusvrv924
@guusvrv924 3 жыл бұрын
I was just searching for this, perfect timing!
@amaldeeppatra8224
@amaldeeppatra8224 3 жыл бұрын
This tutorial worked perfectly for me...Thanks for this😄☺
@TheAlexdn
@TheAlexdn 2 жыл бұрын
Perfeito trabalho com pygame agora estou entendendo de verdade. Parabens pelo trabalho e dedicação. I'm from Rio de janeiro, Brazil.
@maheenmashrur2574
@maheenmashrur2574 3 жыл бұрын
Just when I was thinking about how to implement a saving mechanism.... Like a gift from heaven...
@carlfranz6805
@carlfranz6805 2 жыл бұрын
I'm gonna use this for my upgrade to your space invaders. Good fun. Thanks.
@MuxauJ7
@MuxauJ7 Жыл бұрын
I've been doing very basic coding as a way to mentally exercise and pass time with some benefits. Being a complete dummy when it comes to using external files in my programs, I just couldn't pass that roadblock for some reason (called lazyness 😄). The video has been exceedingly helpful at giving clear directions on where to look and what to do.
@deviouspolarbear4707
@deviouspolarbear4707 2 жыл бұрын
cool video, this will help me a lot in my future career! Thank you so much
@devloper_d
@devloper_d 3 жыл бұрын
Before watching this video I did same thing with SQLite, Thanks for teaching me the shortest method.😃
@trakra9959
@trakra9959 2 жыл бұрын
Amazing, back on track in half an hour
@DGHere12
@DGHere12 3 жыл бұрын
This helped me a lot man, you should do tutorials on unity
@azurnxo2134
@azurnxo2134 3 жыл бұрын
Subbed. You're amazing.
@GUITARATION
@GUITARATION 3 жыл бұрын
Plz make videos on games your explanation is best 👍👍
@DGHere12
@DGHere12 3 жыл бұрын
Thank you For making this video,
@abrarmasumabir3809
@abrarmasumabir3809 3 жыл бұрын
I am in high school..man you make my days cool...it's so awsome..I can't explain you..💜
@devloper_d
@devloper_d 3 жыл бұрын
where are you from?
@abrarmasumabir3809
@abrarmasumabir3809 3 жыл бұрын
@@devloper_d From Bangladesh bro and you....
@devloper_d
@devloper_d 3 жыл бұрын
@@abrarmasumabir3809 I am from India and I am in class 7th.
@abrarmasumabir3809
@abrarmasumabir3809 3 жыл бұрын
@@devloper_d can we contact bro...let's learn together....💜
@devloper_d
@devloper_d 3 жыл бұрын
@@abrarmasumabir3809 Yes of course share your e-mail id or other contact detail.
@ihaveagoddamnplanarthur
@ihaveagoddamnplanarthur Жыл бұрын
Straight to the point, good explanation, i understood it well!
@m_davis222
@m_davis222 10 ай бұрын
Great Video!
@j2j_official
@j2j_official 2 жыл бұрын
Thank you very much :)
@user-kt9hy1te6k
@user-kt9hy1te6k Жыл бұрын
You are truly great
@aleksandrapacia2113
@aleksandrapacia2113 2 жыл бұрын
thank you, it helped me a lot ;)
@tooez4780
@tooez4780 3 жыл бұрын
oh my gosh he uploaded another video!!
@optimistprime8172
@optimistprime8172 3 жыл бұрын
How do you do this with more complex projects containing Player and Enemy classes, animation frames etc?
@jimmyslaughter6262
@jimmyslaughter6262 2 жыл бұрын
You are amazing!!!
@GUITARATION
@GUITARATION 3 жыл бұрын
Thanks 👍👍
@hariharanthegreat5576
@hariharanthegreat5576 3 жыл бұрын
How about Menus in pygame and 3d games in Godot?
@codedecode1498
@codedecode1498 3 жыл бұрын
For 3D games in godot, i can highly recommend this channel called Garbaj :D
@hariharanthegreat5576
@hariharanthegreat5576 3 жыл бұрын
@@codedecode1498 Yeah, I too watch his videos. But this channel Clear Code explains everything in a slow and neat manner which helps me to understand better. If clear code did some, it would be amazing
@codedecode1498
@codedecode1498 3 жыл бұрын
@@hariharanthegreat5576 Yeah ik i prefer this channel over other channels too, but im just saying you could watch those till ClearCode makes them :)
@wantedunknown3100
@wantedunknown3100 3 жыл бұрын
Made my day
@mlungisindlela6810
@mlungisindlela6810 Жыл бұрын
Amazing.
@fathurbadar4490
@fathurbadar4490 2 жыл бұрын
Can anyone explain to me how this works, i have follow the video, but the load is having conflict with the dump if I never run the game (like, the text file is never created, and that creates conflict with the loader trying to get the file). Should I make the file first and assigning the dictionary value into text file (like 'click' : 0 in the text file)? Sorry if my question sounds dumb, I'm new to python, and sorry about my grammar (not really good at English). For anyone reading this comment, have a nice day!! 🙂
@tunaan80
@tunaan80 2 жыл бұрын
But how would I make multiple saves with different names that the user(s) inputs?
@JeanDeBussy
@JeanDeBussy 3 жыл бұрын
AttributeError: 'FirstPersonController' object has no attribute 'cursor' hello in the last video of minecraft in python i encounter this problem could you help me (the code is right because i also tried to get it from your git hub)
@thealgomanxr
@thealgomanxr 3 жыл бұрын
he bacc
@-_Nuke_-
@-_Nuke_- Жыл бұрын
What if I want to save a game, but manually? Like in most games, you can chose the name of your save and the path of your save, how can I do that?
@killer1o165
@killer1o165 3 жыл бұрын
Can you make a video on controller input?
@itsME-dc4vm
@itsME-dc4vm 3 жыл бұрын
Nice ;D
@mrdc3
@mrdc3 2 жыл бұрын
How would I implement this with your Mario style platformer?
@patcher14
@patcher14 2 жыл бұрын
Does this work on your ursa-craft?
@ClearCode
@ClearCode 2 жыл бұрын
it is just another python module, it works with anything, including pygame and ursina.
@anntakamaki1960
@anntakamaki1960 Жыл бұрын
Ok, so I should save each variable into a global dictionary then save that dictionary as json file, and load the variables from that dictionary?
@jeolnoel5288
@jeolnoel5288 3 жыл бұрын
could you make a Video about Sound effects in pygame?(pitching, etc..) it would help me a lot!
@il_piruz
@il_piruz 3 жыл бұрын
( i'm italian so not watch grammatic:D) please you can say me what program for Ursina engine you have used (that for minecraft Python edition)? pls (i want to create from myself but i don't know what type of file i must to use on Visual Studio)
@ClearCode
@ClearCode 3 жыл бұрын
Hey, I use sublime text but any python ide is fine
@il_piruz
@il_piruz 3 жыл бұрын
@@ClearCode thank As soon as I can I try it
@il_piruz
@il_piruz 3 жыл бұрын
​@@ClearCode sorry for disturbe but how you use (always sorry for the bad english) sublime text? ( for example run the code and show up the window with the game)?
@il_piruz
@il_piruz 3 жыл бұрын
​@@ClearCode nothing at the end i've made it and..... thankssss for all the help and time you put in for help me
@il_piruz
@il_piruz 3 жыл бұрын
@@ClearCode sorry for another disturb 😅, but I've installed also psd tools3 but the file (opened with python) not work and the prompt of python spam message of Missing assets/blocks, you can help me another time? 😅
@ZgavY
@ZgavY 2 жыл бұрын
Why use json instead of saving your data as raw binaries?
@deistormmods
@deistormmods 2 жыл бұрын
Better to use raw binary. It's quicker. But it's your choice.
@ZgavY
@ZgavY 2 жыл бұрын
@@deistormmods I'll use raw binary so 9 year olds can't edit the data and cheat on my game lol
@deistormmods
@deistormmods 2 жыл бұрын
@@ZgavY Lol if they're smart enough they can
@danigui8573
@danigui8573 2 жыл бұрын
Can you teach how to do this with sqlite3?
@pokegamerspoint6577
@pokegamerspoint6577 3 жыл бұрын
Hey! When's the new video coming?
@SKSam-bq6zt
@SKSam-bq6zt 3 жыл бұрын
Hey the content is veryyyyy gd but how can I save all the data in a game that contains classes?
@CodingCircle
@CodingCircle 2 жыл бұрын
You can save classes with json as well but the class should not contain any image or Font
@khimleshgajuddhur6892
@khimleshgajuddhur6892 2 жыл бұрын
nice video...but don't forget to record your cursor also xD :) 😁
@ckthomas5756
@ckthomas5756 3 жыл бұрын
Can you teach us how to make multiplayer game
@Mahmoud-kv1ir
@Mahmoud-kv1ir 3 жыл бұрын
new vid!!!! any plans for more Godot tutorials?
@SKSam-bq6zt
@SKSam-bq6zt 3 жыл бұрын
yeah Godot is really important for making games
@kahwigulum
@kahwigulum 2 жыл бұрын
and here i thought json stood for 'just a series of numbers'
@nirmaltheprogrammer510
@nirmaltheprogrammer510 3 жыл бұрын
But user can change the values and cheat plz make a new method
@user-dh8oi2mk4f
@user-dh8oi2mk4f 3 жыл бұрын
In a singleplayer game, why would you want to prevent the user from cheating?
@aiyazm7278
@aiyazm7278 3 жыл бұрын
Hi I need your help
@aiyazm7278
@aiyazm7278 3 жыл бұрын
I had a problem in Arduino UNO using python
@rileylecaptain113
@rileylecaptain113 4 ай бұрын
18:02, just saving so i can sleep :)
@arystokrates5772
@arystokrates5772 2 жыл бұрын
25:06 funny number :D
@samuelkalteis8442
@samuelkalteis8442 3 жыл бұрын
can you code the floppy bird game with memory?
@allanimeworld2898
@allanimeworld2898 3 жыл бұрын
Sir if its possible please make games by kivy too
@sharadthecurioustardigrade1533
@sharadthecurioustardigrade1533 3 жыл бұрын
Kivy tuts pls
@thewyattclassroom
@thewyattclassroom 10 ай бұрын
This guy keeps telling us to get rect, how rude! (This is a python joke)
Debugging in Pygame
12:28
Clear Code
Рет қаралды 13 М.
Python Tutorial: Working with JSON Data using the json Module
20:34
Corey Schafer
Рет қаралды 1,1 МЛН
Final muy inesperado 🥹
00:48
Juan De Dios Pantoja
Рет қаралды 18 МЛН
Increíble final 😱
00:37
Juan De Dios Pantoja 2
Рет қаралды 100 МЛН
How to Code (almost) Any Feature
9:48
DaFluffyPotato
Рет қаралды 654 М.
Creating SMART enemies from scratch! | Devlog
5:40
Challacade
Рет қаралды 273 М.
Beware the Runge Spikes!
17:08
Stand-up Maths
Рет қаралды 453 М.
Multiple Scenes in Pygame Tutorial (Gamestates)
15:46
Coding with Sphere
Рет қаралды 10 М.
Understanding framerate independence and deltatime
29:22
Clear Code
Рет қаралды 38 М.
How to Save and Load Data in Python Using JSON Files | Python JSON Module
13:06
Fabio Musanni - Programming Channel
Рет қаралды 8 М.
Faster than Rust and C++: the PERFECT hash table
33:52
strager
Рет қаралды 518 М.
Menus - Pygame Tutorial
7:37
DaFluffyPotato
Рет қаралды 169 М.
How To Use JSON In Python
6:11
Tech With Tim
Рет қаралды 134 М.
Final muy inesperado 🥹
00:48
Juan De Dios Pantoja
Рет қаралды 18 МЛН