Clear Code

Clear Code

I am making tutorials on coding, primarily in Python.

Breakout in python

Breakout in python

Cameras in Pygame

Cameras in Pygame

Understanding Pygame masks

Understanding Pygame masks

Debugging in Pygame

Debugging in Pygame

Customizing sublime text

Customizing sublime text

Пікірлер

  • @AndrePetermann62
    @AndrePetermann62Сағат бұрын

    Thank you for this great course. I spent more than 2 hours with your course on youtube. And I decided to buy your course on udemy. It's really valued for me.

  • @VexVex24
    @VexVex245 сағат бұрын

    Now, this is what every tutorial should look like.

  • @cd2028
    @cd202816 сағат бұрын

    Why don't i get type hints like you do at 6:02:20. It suggests the names of the animations for you. Mine does not.

  • @zoro_uchiha3027
    @zoro_uchiha302718 сағат бұрын

    self remainder: 32:07

  • @MrAdwok
    @MrAdwok20 сағат бұрын

    Thanks for the video bro, u deserve an award for it 👏

  • @tacticalairfryer1915
    @tacticalairfryer191521 сағат бұрын

    For myself and the algorythm: I am at 01:38:38

  • @mannb1023
    @mannb1023Күн бұрын

    amazing! thanks for taking everything step by step

  • @live_destin-3408
    @live_destin-3408Күн бұрын

    Personal timestamp - 48:45

  • @emperor8716
    @emperor8716Күн бұрын

    don't mind this, just a continue button for me: 1:33:20

  • @gallow_
    @gallow_Күн бұрын

    For anyone around 4:46:10 on the physics layers tilemap section, there's a little eye dropper tool beside paint that allows you to click on tiles without overwriting any collision data you've already drawn

  • @phucoan278
    @phucoan278Күн бұрын

    3:58:43 You're not cover the path that if you write the code that way, even if the first and second condiction are false, it stiil return true if the condiction after or are true By that i mean, if money > 80 and hungry or bored then return TRUE, but if money >150 (money = 100) and hungry or bored, its still return True My point is, you can use the brackets to isolated the condiction, because as mentionded about the flow early on, then you can use brackets to even more control

  • @kevcopo
    @kevcopoКүн бұрын

    This was an amazing video thank you for my first game

  • @CustAndCode
    @CustAndCodeКүн бұрын

    great overview! 🤗

  • @fisiax5460
    @fisiax54602 күн бұрын

    4:08:44

  • @cuervo_gaston
    @cuervo_gaston2 күн бұрын

    In godot 4+ the collision is func _physics_process(delta): var collision: KinematicCollision2D = move_and_collide(velocity * SPEED * delta) if collision: var reflect = collision.get_remainder().bounce(collision.get_normal()) velocity = velocity.bounce(collision.get_normal()) move_and_collide(reflect)

  • @fadedflame9953
    @fadedflame99532 күн бұрын

    this have no right to be free

  • @alializadeh8195
    @alializadeh81953 күн бұрын

    Thanks many many much more ,,,, ....

  • @sil5429
    @sil54293 күн бұрын

    The first tutorial that is actually beginner friendly, and not skipping important stuff just because of "you will find out later".

  • @sonu-jangir
    @sonu-jangir3 күн бұрын

    Thank you very much for this very useful tutorial, as you always do.❤❤ . One request, please reply. Can you tell me about your PC specifications and OS. Please...

  • @sonu-jangir
    @sonu-jangir3 күн бұрын

    I know my question is completely different from this tutorial but still I want to know.

  • @ClearCode
    @ClearCode3 күн бұрын

    @@sonu-jangir Windows 11, Ryzen 3800x, RTX 2070 super and 32gb RAM. Not sure why that matters though 😅

  • @sonu-jangir
    @sonu-jangir3 күн бұрын

    @@ClearCode I know, but still I want build a PC that meet your specifications. Please don't mind. I find all your videos premium, your style, your voice, everything, so I wanted to know about your specifications.☺️

  • @georgebrown1807
    @georgebrown18073 күн бұрын

    6:02:27 That's not what happens when I turn the visibility on for the Explosion. When I do that, the first frame of the Explosion animation displays on top of the blinking light. Then, once the Blinking animation finishes, the Explosion plays as expected. I was able to get the same result by turning off the visibility of the Explosion by default, but adding the line "$Explosion.visible = true" into the code for explode(). I'm curious as to what you did that allowed you to have the Explosion set to visible the whole time but to only have it display when the animation triggers.

  • @OHTASISAN
    @OHTASISAN3 күн бұрын

    Whats the song at the start of the video?

  • @Meechy37
    @Meechy373 күн бұрын

    I have to create a game in Python for a final project in college. I felt pretty lost until I found this video. It does a perfect job of highlighting the basic tools available through pygame and I learned more from this video than the last 3 weeks of class.

  • @ottofrank3445
    @ottofrank34453 күн бұрын

    So good lecture!! Finally someone made a great job. So many other python tutorials are just bunch of clowns showing their face and basically talking like a machine gun. I am so happy that i have found your channel. It was like looking for water in desert.

  • @another-niko-pfp-holder
    @another-niko-pfp-holder3 күн бұрын

    Hi, when I do import pygame I get this message: <frozen importlib._bootstrap>:488: RuntimeWarning: Your system is avx2 capable but pygame was not built with support for it. The performance of some of your blits could be adversely affected. Consider enabling compile time detection with environment variables like PYGAME_DETECT_AVX2=1 if you are compiling without cross compilation. What does this mean? I'm on Manjaro

  • @marcelltoth9737
    @marcelltoth97373 күн бұрын

    incredible value. bought the course as well. love your style, for me its hard to focus sometimes and your style of teaching is clear and to the point. maybe a course on streamlit one day? :)

  • @rorkeslayer3925
    @rorkeslayer39253 күн бұрын

    I'm going insane. For the timer at 1:30:49, I import the timer with "from .timer import Time" The VS Code highlights and functions indicate that the player.py file successfully located the module but for some strange reason it keeps shooting this error: "ImportError: attempted relative import with no known parent package" Please help I am going insane

  • @ClearCode
    @ClearCode3 күн бұрын

    inside of vs code open the entire project folder, not just the code one and then it should. Make sure to adjust the paths though (you just need to remove the "../' from them.

  • @rorkeslayer3925
    @rorkeslayer39253 күн бұрын

    @@ClearCode I've already had the entire project folder opened but it doesn't work. How do I adjust the paths? Also, "from timer import Timer" doesn't work. I have to always replace timer with .timer in to refer to the parent directory before it's referenced for some reason.

  • @rorkeslayer3925
    @rorkeslayer39253 күн бұрын

    @@ClearCode Okay, I got it to work. I just renamed the module to something other than timer and now I can access the class with ease. Thanks for helping

  • @slca
    @slca4 күн бұрын

    Why no one talk about publishing or packaging the game

  • @arid1ty507
    @arid1ty5074 күн бұрын

    53:45

  • @abdulwaasay8228
    @abdulwaasay82284 күн бұрын

    for people who got stuck on 39:00 min something due to move_and_slide() error, its because they changed it in godot4. now move_and_slide doesnt take any args but it does take velocity by default so you cant name your variable in the 6th line as velocity. just change it to something and remove args from move_and_slide(). dont forget to match the names in the if statement

  • @Lezduit586
    @Lezduit5864 күн бұрын

    Loving the video so far! I seem to have come across a problem that I am stuck with, I tried several methods to no avail. File "M:\skrivebord\Project\code\pythonProject1\player.py", line 130, in animate self.image = animation[int(self.frame_index)] IndexError: list index out of range

  • @ClearCode
    @ClearCode4 күн бұрын

    when you are importing the images something went wrong and there are no surfaces in animation. So check the imports :)

  • @Lezduit586
    @Lezduit5864 күн бұрын

    @@ClearCode You mean like the folders themselves? The png files? Sorry if stupid question, but this is my first time trying pygame!

  • @ClearCode
    @ClearCode4 күн бұрын

    @@Lezduit586 you might want to check out my introduction to it :) The error could have happened in your code or in the folders. Make sure to check if the names align and ideally print stuff while importing to make sure that you always get a return value. It's usually trial and error to find one line that has a minor typo

  • @Lezduit586
    @Lezduit5864 күн бұрын

    @@ClearCode Okay, thank you! I'll look into it.

  • @Lezduit586
    @Lezduit5864 күн бұрын

    @@ClearCode It worked! Turns out i wrote named the idle folders in reverse. Now the sprite won't move but I'll figure that out :)

  • @ClearCode
    @ClearCode4 күн бұрын

    If you like this kind of content please consider supporting me on Patreon <3 patreon.com/clearcode

  • @jmgpptt
    @jmgpptt5 күн бұрын

    Can I give you a bit of constructive criticism? (sorry) Just because this tutorial is AMAZING, so close to perfect. I just wish before each section you presented more clearly "we are trying to achieve this" because you say "let's make a grenade" but that is a general idea so then "now the grenade is moving towards right, but we are going to fix it and I don't know what are we trying to achieve? was moving right wrong? tell me what I am trying to do to know what we want to change before you do it instead of understanding what you are doing just when you are finishing it.

  • @QuentinVinger
    @QuentinVinger5 күн бұрын

    Hello guys, I don't understand how I can get the attribute "get_just_pressed". Someone can help me with that?

  • @ClearCode
    @ClearCode5 күн бұрын

    do you get an error when calling pygame.key.get_just_pressed? You need to give a few more details to get proper help

  • @QuentinVinger
    @QuentinVinger5 күн бұрын

    @@ClearCode Yes, I received the message: AttributeError: module 'pygame.key' has no attribute 'get_just_pressed'. Did you mean: 'get_pressed'? I'm actually using Pycharm-CE 3.12 with packages pip 24.0 and pygame 2.5.2

  • @QuentinVinger
    @QuentinVinger4 күн бұрын

    @@ClearCode Yes, I currently use Pycharm-ce 3.12 with packages pip 24..0 and pygame 2.5.2 and I get the eroor message telling AttributeError: module 'pygame.key' has no attribute 'get_just_pressed'. Did you mean: 'get_pressed'? Maybe it's a versionning issue

  • @ClearCode
    @ClearCode4 күн бұрын

    @@QuentinVinger Do you still have the old pygame installed? I think that is causing the issue. Basically uninstall both pygame and pygame-ce and then reinstall pygame-ce

  • @QuentinVinger
    @QuentinVinger4 күн бұрын

    @@ClearCode I will try this. I find a way to bypass this issue for the moment

  • @kimathimutegi
    @kimathimutegi5 күн бұрын

    what are alpha values

  • @Ethan-zt7ky
    @Ethan-zt7ky5 күн бұрын

    Useful notes for reference beyond just the section titles: 8:10:06 Global Variables

  • @kimathimutegi
    @kimathimutegi6 күн бұрын

    how do I download the ttf font

  • @zeratul11000
    @zeratul110006 күн бұрын

    it is really weird.. from 2:55:55 making apple and particle part, i can't see apple, and particles... i thought it was my fault first time, i found out Teacher's code from github has the same problem. it is really strange that apple shows when i play game first time, and when i kill tree, it crashes. after that, i can not see apples and there is no crash so weird... i gave up fixing this bug...

  • @ClearCode
    @ClearCode6 күн бұрын

    when the game crashes, what's the error message?

  • @zeratul11000
    @zeratul110005 күн бұрын

    @@ClearCode ​ @ClearCode omg! thank you for answering! i didn't expect u would answer! as far as i remember it was 'Player doesn't have method damage. did you mean image??' it was refered to 'use_tool' tree.damage() i guess after i turned off the computer for 2 hours, it doesn't crash although i didn't change any code. and i still can't see particle effects... crash reappeared when i deleted '_pycache_' files. does it related mainboard bios update..?? i updated few days ago.... i have no idea why it occured now, when i deleted '_pycache_' files, particle effects appears, but in second run, particle effects disappear it also happens same way on your code too. i put "print('particle effect')" in class Particle, def update, to check if it is running properly, it prints 'particle effect' at the first run, but not printing after first run really weird. it doesn't crash any more but still it doesn't work properly apple is appearing because i changed some code based on @boxlolly commend i think it is not the problem though.. because the same problem is occurring on your code to.. seems some people are experiencing the same problem with me this is changed code. ---------------------------------------------- [sprites.py] class Tree(Generic): def __init__(self, pos, surf, groups, all_sprites, name): # add all_sprites # apples: self.create_fruit(all_sprites) # pass all_sprites here def create_fruit(self, all_sprites): # add all_sprites parameter Generic( pos=(x, y), surf=self.apple_surf, groups=[self.apple_sprites, all_sprites], # use all_sprites directly [levels.py] def __init__(self): self.setup(all_sprites=self.all_sprites) # pass all_sprites here def setup(self, all_sprites): # add all_sprites parameter # trees for obj in tmx_data.get_layer_by_name('Trees'): Tree((obj.x, obj.y), obj.image, [self.all_sprites, self.collision_sprites, self.tree_sprites], all_sprites, obj.name) # add all_sprites parameter thank you for answering me sir! :)

  • @ClearCode
    @ClearCode5 күн бұрын

    @@zeratul11000 in your code, does the player have a damage method?

  • @zeratul11000
    @zeratul110005 күн бұрын

    @@ClearCode no it doesn't have. the word 'damage' is only used in 'use_tool 'method tree.damage() in line 57 it also happens the same way in the code you provide in github. particle effects only works on the first run, from the second run, it does not exist. when i delete _pycache_ file, it resets. works on only the first run, not work on second or more run (im explaining the error repeatedly because i think you are answering many questions at the same time from students, so might be confused. i have no intention to bother you) thank you for the respond teacher!

  • @quarkorion
    @quarkorion6 күн бұрын

    Nice video ;) ps. you say "forward slash", when it is a "backslash" fx at time 1:54:08 Info: google "forward and backslash"

  • @shiva.sharan
    @shiva.sharan6 күн бұрын

    Cant believe I went through the whole thing unscathed. This was just amazing. Thanks for teaching.

  • @MrMcCheeze
    @MrMcCheeze6 күн бұрын

    i am now making a game!

  • @ClearCode
    @ClearCode6 күн бұрын

    thank you so much, glad it helped :)

  • @vortexer
    @vortexer6 күн бұрын

    1:18:33 current place 5/11 1:48:52 current place 5/11

  • @letsplaywithgold8533
    @letsplaywithgold85336 күн бұрын

    Stopwatch don’t work after pressing the reset button😢

  • @owendufka972
    @owendufka9726 күн бұрын

    Wan gang!

  • @Pashaportino
    @Pashaportino6 күн бұрын

    after about 7 months of procrastinating i finally finished this part and i gotta say youre the goat fr this guide is really good and every minute feels like youre learning more and more, concepts are explained well and in good amount of detail, cant wait to finish the second part

  • @SI_Teriyaki
    @SI_Teriyaki6 күн бұрын

    hi there can anyone help me with this? i just wanna try out the game. i am using vs code Traceback (most recent call last): File "c:\Users\Administrator\Desktop\jl\code\main.py", line 48, in <module> game = Game() ^^^^^^ File "c:\Users\Administrator\Desktop\jl\code\main.py", line 19, in __init__ self.level = Level() ^^^^^^^ File "c:\Users\Administrator\Desktop\jl\code\level.py", line 23, in __init__ self.visible_sprites = YSortCameraGroup() ^^^^^^^^^^^^^^^^^^ File "c:\Users\Administrator\Desktop\jl\code\level.py", line 170, in __init__ self.floor_surf = pygame.image.load('../graphics/tilemap/ground.png').convert() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: No file '../graphics/tilemap/ground.png' found in working directory 'C:\Users\Administrator\Desktop\jl'.

  • @ProgrammingwithMichael
    @ProgrammingwithMichael6 күн бұрын

    🎉

  • @AmitYadav-jp5uz
    @AmitYadav-jp5uz7 күн бұрын

    Such an underrated video. Rooting for you, I'm sure this will get viral som day.

  • @jstinsane8309
    @jstinsane83097 күн бұрын

    Hmm, concept of self is wrongly explained. Self doesnt refer to class, it refers to the instance of the class, it changes values of variables linked with an object, not class variable values. I guess you meant to say the same thing as different state of class for different objects, but it wasnt much clear that way. You could have explained this with the following example while you were explaining dunder methods: class Monster: def __init__(self, name, health, energy): self.name = name self.health = health self.energy = energy def __str__(self): return self.__dict__.get("name") # This particular line clears the confusion I guess, as to how self works at a higher level.

  • @Martinko1006
    @Martinko10067 күн бұрын

    Delete key types random character