Saving and loading in pygame with json

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

  • @reedhamyt5832
    @reedhamyt58323 жыл бұрын

    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.😂😂😂

  • @mixlaproduction
    @mixlaproduction3 жыл бұрын

    The legend is back! :D

  • @SKSam-bq6zt

    @SKSam-bq6zt

    3 жыл бұрын

    Yeah so cool

  • @snowman_student
    @snowman_student3 жыл бұрын

    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
    @meoweth8293 жыл бұрын

    Please dont stop making these, you inspire me

  • @SKSam-bq6zt
    @SKSam-bq6zt3 жыл бұрын

    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
    @ElvB3 жыл бұрын

    Helpful videos and great explanation!

  • @maheenmashrur2574
    @maheenmashrur25743 жыл бұрын

    Just when I was thinking about how to implement a saving mechanism.... Like a gift from heaven...

  • @guusvrv924
    @guusvrv9243 жыл бұрын

    I was just searching for this, perfect timing!

  • @amaldeeppatra8224
    @amaldeeppatra82243 жыл бұрын

    This tutorial worked perfectly for me...Thanks for this😄☺

  • @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.

  • @TheAlexdn
    @TheAlexdn2 жыл бұрын

    Perfeito trabalho com pygame agora estou entendendo de verdade. Parabens pelo trabalho e dedicação. I'm from Rio de janeiro, Brazil.

  • @carlfranz6805
    @carlfranz68052 жыл бұрын

    I'm gonna use this for my upgrade to your space invaders. Good fun. Thanks.

  • @devloper_d
    @devloper_d3 жыл бұрын

    Before watching this video I did same thing with SQLite, Thanks for teaching me the shortest method.😃

  • @ihaveagoddamnplanarthur
    @ihaveagoddamnplanarthur Жыл бұрын

    Straight to the point, good explanation, i understood it well!

  • @trakra9959
    @trakra99592 жыл бұрын

    Amazing, back on track in half an hour

  • @deviouspolarbear4707
    @deviouspolarbear4707 Жыл бұрын

    cool video, this will help me a lot in my future career! Thank you so much

  • @DGHere12
    @DGHere123 жыл бұрын

    Thank you For making this video,

  • @GUITARATION
    @GUITARATION3 жыл бұрын

    Plz make videos on games your explanation is best 👍👍

  • @DGHere12
    @DGHere123 жыл бұрын

    This helped me a lot man, you should do tutorials on unity

  • @user-kt9hy1te6k
    @user-kt9hy1te6k Жыл бұрын

    You are truly great

  • @j2j_official
    @j2j_official2 жыл бұрын

    Thank you very much :)

  • @abrarmasumabir3809
    @abrarmasumabir38093 жыл бұрын

    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.

  • @tooez4780
    @tooez47803 жыл бұрын

    oh my gosh he uploaded another video!!

  • @aleksandrapacia2113
    @aleksandrapacia21132 жыл бұрын

    thank you, it helped me a lot ;)

  • @azurnxo2134
    @azurnxo21343 жыл бұрын

    Subbed. You're amazing.

  • @m_davis222
    @m_davis22210 ай бұрын

    Great Video!

  • @GUITARATION
    @GUITARATION3 жыл бұрын

    Thanks 👍👍

  • @mlungisindlela6810
    @mlungisindlela6810 Жыл бұрын

    Amazing.

  • @wantedunknown3100
    @wantedunknown31003 жыл бұрын

    Made my day

  • @jimmyslaughter6262
    @jimmyslaughter62622 жыл бұрын

    You are amazing!!!

  • @hariharanthegreat5576
    @hariharanthegreat55763 жыл бұрын

    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 :)

  • @optimistprime8172
    @optimistprime81723 жыл бұрын

    How do you do this with more complex projects containing Player and Enemy classes, animation frames etc?

  • @itsME-dc4vm
    @itsME-dc4vm3 жыл бұрын

    Nice ;D

  • @thealgomanxr
    @thealgomanxr3 жыл бұрын

    he bacc

  • @khimleshgajuddhur6892
    @khimleshgajuddhur68922 жыл бұрын

    nice video...but don't forget to record your cursor also xD :) 😁

  • @killer1o165
    @killer1o1653 жыл бұрын

    Can you make a video on controller input?

  • @JeanDeBussy
    @JeanDeBussy3 жыл бұрын

    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)

  • @fathurbadar4490
    @fathurbadar44902 жыл бұрын

    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
    @tunaan802 жыл бұрын

    But how would I make multiple saves with different names that the user(s) inputs?

  • @jeolnoel5288
    @jeolnoel52883 жыл бұрын

    could you make a Video about Sound effects in pygame?(pitching, etc..) it would help me a lot!

  • @mrdc3
    @mrdc32 жыл бұрын

    How would I implement this with your Mario style platformer?

  • @il_piruz
    @il_piruz3 жыл бұрын

    ( 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? 😅

  • @-_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?

  • @patcher14
    @patcher142 жыл бұрын

    Does this work on your ursa-craft?

  • @ClearCode

    @ClearCode

    2 жыл бұрын

    it is just another python module, it works with anything, including pygame and ursina.

  • @Mahmoud-kv1ir
    @Mahmoud-kv1ir3 жыл бұрын

    new vid!!!! any plans for more Godot tutorials?

  • @SKSam-bq6zt

    @SKSam-bq6zt

    3 жыл бұрын

    yeah Godot is really important for making games

  • @kahwigulum
    @kahwigulum2 жыл бұрын

    and here i thought json stood for 'just a series of numbers'

  • @SKSam-bq6zt
    @SKSam-bq6zt3 жыл бұрын

    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

  • @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?

  • @ZgavY
    @ZgavY2 жыл бұрын

    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

  • @pokegamerspoint6577
    @pokegamerspoint65773 жыл бұрын

    Hey! When's the new video coming?

  • @danigui8573
    @danigui85732 жыл бұрын

    Can you teach how to do this with sqlite3?

  • @arystokrates5772
    @arystokrates57722 жыл бұрын

    25:06 funny number :D

  • @ckthomas5756
    @ckthomas57563 жыл бұрын

    Can you teach us how to make multiplayer game

  • @rileylecaptain113
    @rileylecaptain1134 ай бұрын

    18:02, just saving so i can sleep :)

  • @nirmaltheprogrammer510
    @nirmaltheprogrammer5103 жыл бұрын

    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
    @aiyazm72783 жыл бұрын

    Hi I need your help

  • @aiyazm7278

    @aiyazm7278

    3 жыл бұрын

    I had a problem in Arduino UNO using python

  • @samuelkalteis8442
    @samuelkalteis84423 жыл бұрын

    can you code the floppy bird game with memory?

  • @allanimeworld2898
    @allanimeworld28983 жыл бұрын

    Sir if its possible please make games by kivy too

  • @sharadthecurioustardigrade1533
    @sharadthecurioustardigrade15333 жыл бұрын

    Kivy tuts pls

  • @thewyattclassroom
    @thewyattclassroom10 ай бұрын

    This guy keeps telling us to get rect, how rude! (This is a python joke)