Пікірлер
@josefelamin9792
@josefelamin9792 2 күн бұрын
I know this comment is a year old but this video was great help and solved the issue i was dealing with for hours. Thank youuu!
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 2 күн бұрын
I'm so glad it helped! Thank you for commenting! 😊
@Winwin12480e
@Winwin12480e 5 күн бұрын
thanks a lot <3
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 5 күн бұрын
You're very welcome! I'm so glad if it was helpful. 😊
@Chdal
@Chdal 19 күн бұрын
thank you so much
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 19 күн бұрын
You're so welcome! 😊 I'm glad it was helpful.
@anthonydrakefordshadow
@anthonydrakefordshadow 22 күн бұрын
This is what I am looking for but it’s not connected to any key press events like player movement would be, I will keep hunting though. Lot of GREAT material by the way, you really don’t get as many likes as you deserve ❤
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 22 күн бұрын
I think this might be the video you want, and possibly the videos that come after it. Let me know if you're looking for something else and I've misunderstood. 🙂 kzbin.info/www/bejne/bZXQfap_ZsScidE
@anthonydrakefordshadow
@anthonydrakefordshadow 22 күн бұрын
@@DesignCodeDebugRepeat Not quite lol I watched it a few times last night though. The animation here is the rotation which is linked to character input but doesn’t cycle through using mod like a walk animation would if that makes sense.
@anthonydrakefordshadow
@anthonydrakefordshadow 22 күн бұрын
@@DesignCodeDebugRepeat I can connect them via copy/paste chat gpt query but I was looking for one of your explanations in hopes that it would help me understand what I was doing and why so that I could stop having to reference the process and just recreate it at will.
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 21 күн бұрын
@@anthonydrakefordshadow How about the penguin game? It has an animation when the penguin jumps, I think. The animation is counter-based, so you would only update the counter when the character is moving. So you would have a field in the sprite that lets you know whether it's moving (or maybe what direction), and then in the update method check that field (if moving, e.g.) before updating the counter and checking if the sprite image needs to be moved along.
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 21 күн бұрын
See if the penguin video (I think the penguin in its ice castle would be on the thumbnail, probably lesson 10 or 11) has what you need. :)
@ronboprime
@ronboprime 23 күн бұрын
where'd you learn to code? did you go to school? this has that... rigorous training, feel, to it. it's seriously some of the nicest, most professional code, I've ever seen. granted I don't get around much... I'm still a newb. but this code feels like.... industrial strength! people say when they're teaching in tutorials, they give that excuse of... well this is just to show you a concept... but then everything else they write, looks the same way. no polish. if they don't teach the right way... then people don't learn the right way. then you get a buncha idiots, sitting in high places, thinkin they know what they know what their doing, because all they've ever known, is the wrong way, of something. wow that was a tangent, and a half...
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 23 күн бұрын
That's funny! I did go to school, yes -- so much theory. 😁 Undergraduate and graduate degrees in computer science. (And I teach introductory programming courses -- most of the videos on this channel are from the courses I teach. Some are for fun!) Sometimes hobbyist programmers don't communicate difficult topics or appropriate context, but I think there's a place for it! If you're only programming for yourself, you can't do much harm (although I think you can quickly run into trouble when your system becomes complex) and maybe it sparks some excitement and the willingness to push through learning the harder topics. 🙃 Thank you for the kind tangent! 😆 (Oh, and good for you if you can notice when code is a little lazy!!)
@ronboprime
@ronboprime 23 күн бұрын
@@DesignCodeDebugRepeat I know a couple welders, and I know a lot of guys, that drive welding trucks. I'm starting to see, the same trend, in the world of coding. talent is easy to see, and hard to find, because, it doesn't have to advertise itself, but there's so many other people, teaching garbage, and the bare minimums.... or maybe the totality, of what they know. the problem, is those two, are easily mistaken. That goes back to my original point, but, when you see a master at work, you just know it. Once you get passed the inevitable Dunning Kreuger phase, of, pretty much, whatever trade, you're talking about, at the time. it's the little differences. the details. I've just done so many different things, I'm acutely aware of that effect, and to me seems universal. have a good one!
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 23 күн бұрын
@@ronboprime I know what you mean!! It's such a pleasure to watch an expert at work -- sometimes I will watch channels with content I'm not even very interested in, simply because you can detect that calm confidence and knowledge in a person with years of reflective experience. Well, I do plenty of things I'm not an expert at, too, and it's okay to do things you're bad at for pleasure. 🙃 Thanks for the conversation! 😊
@anthonydrakefordshadow
@anthonydrakefordshadow 29 күн бұрын
Hello Maggie ❤
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 28 күн бұрын
Hello 😊
@anthonydrakefordshadow
@anthonydrakefordshadow 25 күн бұрын
@@DesignCodeDebugRepeat FINALLY have the time to sit back and watch this, thank you for the content 🤗
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 25 күн бұрын
@@anthonydrakefordshadow Life is busy! The videos aren't going anywhere. 😊 Enjoy!! 🙃
@anthonydrakefordshadow
@anthonydrakefordshadow 25 күн бұрын
@@DesignCodeDebugRepeat​​⁠ I really liked all of the suggested uses like the timed gate and energy meter but I especially would like to see the walking animation reference connected to the keydown events if you do not already have a video for it 😇
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 25 күн бұрын
@@anthonydrakefordshadow Hi Anthony! So I'm sorry, because you may have mentioned this before -- how exactly do you want to see the walking animation related to keydown events? I'm sure I could provide code and an explanation for that if I don't have a video like that. I think I do have videos where the character motion is controlled with the arrow keys, if that's what you're looking for. I'm not sure if that's the focus of the video. But tell me what you're interested in and I'll look.
@paulramasco6769
@paulramasco6769 Ай бұрын
Very awesome video. One area where I've used mod a lot in various areas is when trying to find some angle offset. I used to work for a test and evaluation command so I would place sensors off the line of fire. Before I learned about transforms I could calulate the distance and position of a sensor using standard geometry. So if I wanted to know the x and y position of a sensor, using the local coordinate system, it would be something like X_desired = distance * (cosine(90-line of fire) mod 360))+X_current, Y_desired = distance * (sine(90-line of fire) mod 360))+Y_current.
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat Ай бұрын
Very cool!! Thank you for the real-world example! I'd describe your use case as constraining your result to within 360 degrees, do I understand you correctly? Thank you for the comment! 😁
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat Ай бұрын
I just noticed an error in the code in the video that I wanted to point out -- I'll fix the code in github. In the namespace example, the roll_die function takes a parameter num_sides, and then doesn't use it! The random call within the function should be random.randint(1, num_sides). Ugh!!!
@anthonydrakefordshadow
@anthonydrakefordshadow Ай бұрын
@@DesignCodeDebugRepeat I wanted to pick up a paperback copy of your book but I can only find electronically. Any advice?
@anthonydrakefordshadow
@anthonydrakefordshadow Ай бұрын
Good morning Maggie ❤
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat Ай бұрын
Good morning, Anthony!! 😊
@french-coding4286
@french-coding4286 Ай бұрын
Thanks Maggy, another well-run lesson! It would have great to see the final demonstration on screen. It is necessary to clear the buffer if and only if you read a string after having read a type number seems to me to summarize the matter simply.
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat Ай бұрын
Thank you for commenting! That is a great summary! What I have found, though, teaching Java for over 25 years, is that it isn't enough. I have students who often reverse it -- they remember they need an extra read, but they can't remember where, so they put it after a nextLine, resulting in more chaos! For me, at least, understanding why I have to do something really helps me remember how to do the thing. I am sorry I omitted showing something you thought would complete the video -- I'm often trying to keep the length down but I will remember that for future! You can download the code from my github repo if you want to run it yourself. 🙂There's a link in the description. Thank you for commenting and I apologize for the delay in response -- for some reason this comment was "held for review." Makes no sense! 🙃
@JohnMontana-m4d
@JohnMontana-m4d Ай бұрын
Ryan Courts
@french-coding4286
@french-coding4286 2 ай бұрын
Hello Maggie, here is another version of the loop based on your example: int i = 0; while (text.length() > i) { if (text.charAt(i) == ',') { i++; } else if (text.charAt(i) == ' ') { System.out.println(); } else { System.out.print(text.charAt(i)); } i++; } Thanks for teaching us how to think and not just applying recipes. Keep on making these wondeful videos.
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 2 ай бұрын
Hey there! I'm so sorry I didn't reply sooner -- for some reason your comment was "held for review." I wonder if the algorithm is wary of code! Yes, your code is easy to read and looks like it should work -- very nice! 🙂Thank you for posting it. And thank you for your kind comment. 😊
@alhabib_o
@alhabib_o 2 ай бұрын
I hope this helps. # Why 'while True' Loops Are Bad Practice and How to Replace Them """ [1] Understanding 'while True' Loops: - A 'while True' loop is an infinite loop that continues to execute until explicitly broken. - It's often used when the exit condition is complex or unpredictable. - Even Though it is simple, this structure can lead to a code that's hard to read and maintain. [2] Problems with 'while True' Loops: - Readability : It's not immediately clear what condition will end the loop. - Maintainability: The exit condition is often buried within the loop body. - Error-prone : Easy to create infinite loops if the break condition is missed. - Performance : In some cases, it can be less efficient than alternatives. [3] Alternatives to 'while True' Loops: a) Using a condition in the while statement. b) Using a validation function to encapsulate the loop condition. ==> Better for multiple inputs [4] Best Practices for while Loops: - Make the loop condition clear and explicit. - Keep the loop body as simple as possible. - Use meaningful variable names that explain the purpose of the loop. - Consider using functions to encapsulate complex logic. [5] When to Use 'while True' Loops: - In rare cases where an infinite loop is actually desired (e.g., in some game loops or server programs). - When the exit condition is truly unpredictable and can only be determined within the loop body. - Even in these cases, consider if there's a clearer way to express the logic. [6] The `assert` statement: - The `assert` statement is often used to catch programming errors or unexpected conditions. - If the condition inside the assert evaluates to False, it raises an AssertionError. - It helps in debugging by ensuring that the input validation logic is working correctly. - If you are confident the input will always be valid, you can remove the assert statement. [7] Notes for Studying: - It is better to only loop if the input is incorrect. - When validating user input, it's better to start with a priming read (initial input). - Use functions like (`valid_input`, `valid_password`, `correct_guess`, etc.) to validate input. - Functions improve code reusability and can be tested separately. """ # Example 1: Basic input validation loop # a. Using a while True loop (not recommended) while True: # 1. Start a `while True` loop. input_value = int(input("Please enter a number between 1 and 10: ")) # 2. Ask for input. if 1 <= input_value <= 10: # 3. `if good_input`: break # ===> break print(f"You entered: {input_value}") # b. Without using a `while True` loop. input_value = int(input("Enter a number between 1 and 10: ")) # 1. Ask for input. while (input_value < 1) or (input_value > 10): # 2. start a `While bad_input` loop. print("The number must be between 1 and 10!") # ===> A warning message. (optional) input_value = int(input("Enter a number between 1 and 10: ")) # ===> Ask again. print(f"You entered: {input_value}") # c. Better approach: Using a validation function. def valid_input(value): # 1. Write an input validation function. return (1 <= value) and (value <= 10) # <== return the good input. input_value = int(input("Please enter a number between 1 and 10: ")) # 2. Ask for input. while not valid_input(input_value): # 3. Start a `while not valid_input` loop. print("That number must be between 1 and 10!") # ==> A warning message. (optional) input_value = int(input("Please enter a number between 1 and 10: ")) # ==> Ask again. print(f"You entered: {input_value}") # NOTE: We only enter the loop if that user-input is wrong or not valid.
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 2 ай бұрын
Great summary!! This is a wonderful resource. 🙂 I'm going to pin this.
@alhabib_o
@alhabib_o 2 ай бұрын
Thank you so much. You forgot to leave the video link 7:07 though..
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 2 ай бұрын
Oh gosh, I'm sorry! I'll put that in, and here it is: kzbin.info/www/bejne/gqSUm35qn817Y5o I've created a new video about while true and also break inside loops in my introductory Java series. That's being released Saturday. Thank you for pointing out the missing link!! 🙃
@alhabib_o
@alhabib_o 2 ай бұрын
@@DesignCodeDebugRepeat You're very welcome! 😊 Thank you for sharing the link and the heads-up about the new video. I am looking forward to it! Your lessons have been super helpful.
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 2 ай бұрын
@@alhabib_o I'm so glad! The new video touches a little more on why it's bad. I decided it just needs to be part of my courses. 😁 Thank you again for pointing out the mistake! When I edited the video, there was a marker at 7:10 but the linked video was an error. Not sure what happened! 🙃
@anthonydrakefordshadow
@anthonydrakefordshadow 2 ай бұрын
Thank you Madam Magnificent 🤗great resource 😎
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 2 ай бұрын
lol, you are most welcome, Anthony!😊
@st6nned
@st6nned 2 ай бұрын
Thank you so much
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 2 ай бұрын
You're welcome! Happy to help! 😊
@ronboprime
@ronboprime 2 ай бұрын
thanks :D... J saun(a). lol. that was very cool! thanks for the shoutout! look forward to the next.
@IOSALive
@IOSALive 2 ай бұрын
DesignCodeDebugRepeat, cool video keep it up dude
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 2 ай бұрын
Thank you! 😊
@anthonydrakefordshadow
@anthonydrakefordshadow 2 ай бұрын
Happy holiday weekend Maggie ❤
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 2 ай бұрын
You too, Anthony!! 🙂
@StephenCerezo
@StephenCerezo 2 ай бұрын
ty it helps
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 2 ай бұрын
You're very welcome, and I'm so glad it helped! 😊
@animatnetic2545
@animatnetic2545 2 ай бұрын
Thank you, this helped me programme a grenade throwable system for my game!
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 2 ай бұрын
Oh, awesome, I'm so glad! 😊
@MrFalcoFTW
@MrFalcoFTW 3 ай бұрын
Great tutorial! Didn't know this was a feature. Any tips on how to do this with two rects instead of images?
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 3 ай бұрын
Can you give me a little more info on what you're thinking or wanting to do? Maybe I'll have a suggestion. 🙂
@MrFalcoFTW
@MrFalcoFTW 3 ай бұрын
​@@DesignCodeDebugRepeat Thanks! I really appreciate it! I have one big rect with a smaller rect on top of it. The smaller rect can move up or down. I am trying to figure out how to make it so the only part of the smaller rect that is visible is the part overlapping with the big rect. (in CSS I would probably use overflow:hidden or something) (What I have been doing so far is just drawing a new rectangle matching the background color of the screen and placing it above and below the big rect, which gives the appearance of the smaller one vanishing when moving outside the big rect xD) Any tips would be appreciated, I haven't been able to find much documentation/examples about this one :)
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 3 ай бұрын
@@MrFalcoFTW Are you blitting them separately? Can you blit the larger rect, set the clipping region to the larger rect, and then blit the smaller rect? That way, any part of the smaller rect that falls outside of the larger rect wouldn't blit.
@ronboprime
@ronboprime 3 ай бұрын
have you done one, about saving a character to file? with json? it's hard to find good explanatory videos. about how to do that, and maintain cohesion and coupling.
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 3 ай бұрын
I have not done one about saving a character to a file with json. I will put that on the list, but it may not be very quick before I get that up as I'm trying to get videos up that I'm going to be using in the fall semester. Thank you for the suggestion! I like to be able to create videos that are of interest to people. 🙂
@ronboprime
@ronboprime 3 ай бұрын
Nice! thanks!
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 3 ай бұрын
You're very welcome! Thank you for commenting! 😊
@ronboprime
@ronboprime 3 ай бұрын
@@DesignCodeDebugRepeat happy to. you should get more attention.
@ronboprime
@ronboprime 3 ай бұрын
to help out the algorithm
@ronboprime
@ronboprime 3 ай бұрын
@@DesignCodeDebugRepeat I will!
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 3 ай бұрын
@@ronboprime Thank you! I think for any content it needs to reach the right audience. I started to email community college faculty, but then I stopped. Self-promotion is really uncomfortable for me! 🙃 I do appreciate your kind comment. 😊
@anthonydrakefordshadow
@anthonydrakefordshadow 3 ай бұрын
Hi there, Maggie the magnificent 🎉
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 3 ай бұрын
lol, hello, Anthony! 😁
@muhammadameenbhatti7983
@muhammadameenbhatti7983 3 ай бұрын
very nice end to the chapter. Nicely explained.. Stars were too time-consuming to fill, so I just filled with car headlights and cleared the screen after the screen filled.
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 3 ай бұрын
Thank you! I'm glad you found it helpful and found a way to make it work for you. 😊It's soooo much fun once you can start programming with graphics and events!
@muhammadameenbhatti7983
@muhammadameenbhatti7983 3 ай бұрын
@@DesignCodeDebugRepeat True. the graphics are a fun way to learn coding. I'm also simultaneously looking to learn automation in spreadsheets using python, just to start utilizing the knowledge in real work.
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 3 ай бұрын
@@muhammadameenbhatti7983 Oh, excellent idea! I think one of the best ways to learn is to have something you want to do and figure out how to do it! It can be frustrating, but if you have enough knowledge to do that, it's motivating, it's so satisfying, and it will propel your knowledge forward! 🙂
@muhammadameenbhatti7983
@muhammadameenbhatti7983 3 ай бұрын
@@DesignCodeDebugRepeat absolutely true. part of the satisfaction comes from facing some frustrating errors and then figuring out the reasons and finally solving them. that's just so satisfying.😊
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 3 ай бұрын
@@muhammadameenbhatti7983 YES! I think engineers all have that mindset in common. 😁
@anthonydrakefordshadow
@anthonydrakefordshadow 3 ай бұрын
Thank you so much, you 100% nailed it. So equipment should blited as parallel list while masking would be better suited for equipment color customization. Thanks for clearing that up! Presenting the concepts in contrast really helped to see the distinction between bliting the pixels we see as equipment, no different than anything else we are able to visualize on the screen, and masking where we track pixels with specific collision or in this case appearance conditions. You are an amazing instructor!!!
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 3 ай бұрын
Well, to me this distinction makes sense! With equipment, you would blit in an order from what's behind to what's in front to get the appearance correct. The masks, I think, can be really fun for color or texture changes to something that's already in the image. Thank YOU for the idea for the video, because I had a lot of fun making it! I'm glad you found it helpful! 😊
@muhammadameenbhatti7983
@muhammadameenbhatti7983 3 ай бұрын
nicely explained. As soon as the image appeared on screen, I was like: ah yes!
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 3 ай бұрын
Oh, awesome! I'm so happy to assist with an "ah ha" moment! 😊
@mariacristinavitielloA
@mariacristinavitielloA 3 ай бұрын
Hello Professor, Is there a video in your channel of programs demonstrating polymorphic behavior? I am reading about polymorphism and I am sure that one of your videos would be a great tool in helping me understand this concept!
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 3 ай бұрын
Hi Cristina! Yes, this program demonstrates polymorphic behavior, actually. 🙂 In the class Library, there is an ArrayList of LibraryItem. The variable items (of type ArrayList<LibraryItem>) is a polymorphic variable because the LibraryItem objects that we put in items could be of type Book or of type DVD or of type LibraryItem -- they can be any subclass of LibraryItem or a LibraryItem. We can send any message to the objects in this ArrayList that we can send to a LibraryItem, and because a Book and a DVD "isa" LibraryItem (extends/inherits/is a child of/is a subclass of -- all ways of saying that), each will be able to respond to that message. If Book or DVD has overridden the method, then that is an example of dynamic binding, meaning that we don't know what exact code will run (the method in LibraryItem or the override method in the subclass) until run-time. Dynamic binding is a sort of byproduct of polymorphism. I probably could do more examples on this! There might be examples in Python, as well -- I can't remember but I probably did some in the Objects and Games with Python playlist. That might be confusing, though, since you're working with Java right now. I hope that's at least a little bit helpful. 😊
@mariacristinavitielloA
@mariacristinavitielloA 3 ай бұрын
@@DesignCodeDebugRepeat Very interesting! Thank you so much!🙂
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 3 ай бұрын
@@mariacristinavitielloA It will make sense -- it's one of the trickier concepts. And no doubt I could do more videos on this topic! I need to get through the introductory Java videos but I'll see if I can do one diving into polymorphism and dynamic binding a little more.
@mariacristinavitielloA
@mariacristinavitielloA 3 ай бұрын
It would be fantastic if could post more videos about this concept!! I must admit, it has really caught my attention! It can be challenging but interesting! I remember that in class we did something very similar in one of the assignments: We were asked to fill up an arrayList of a superclass type with objects of its subclasses! I didn’t know that we were using polymorphism! That’s amazing! Thank you again, Professor!
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 3 ай бұрын
@@mariacristinavitielloA Well clearly I do need to do a little more with the concept! Yes -- it's very cool because it allows you to extend a system in the future... as long as you correctly anticipate the ways it will need to be extended. In the library example, you can add different kinds of materials to check out (e.g. our library now has a "library of things") and the whole system will still work. A great example of this is graphical user interfaces. They generally provide a framework of widgets and event handling, and every time somebody writes an application, they extend the widgets and the system still works -- the widgets can get and handle events, even though the new objects didn't exist when they wrote the framework. 😃
@Six4One
@Six4One 3 ай бұрын
Thanks, this was helpful.
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 3 ай бұрын
You're welcome! I'm glad it was helpful. 🙂
@anthonydrakefordshadow
@anthonydrakefordshadow 4 ай бұрын
Hi, I have a mask question. Can masks be used for player cosmetic choices and if they can, would this remove the processing burden associated with masks if the mask was not responsible for detecting collisions at all?
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 4 ай бұрын
Now that's a cool use! 😃You want to use it as a sort of clipping region for blitting. Right? So yes, you can -- I'd want to look into the best way. (I haven't found a great way yet -- have you tried it? Maybe I'm looking and you've already found a built-in that will do it.) And if you're only using the masks to render the character but not for detecting collisions, then it should remove that processing burden from using the masks in the collision detection. I'm not sure if the masks are the best solution, though -- if you have the cosmetic choices as pngs with transparency, can you just blit them over your character? I guess maybe it depends on the cosmetics?
@anthonydrakefordshadow
@anthonydrakefordshadow 4 ай бұрын
@@DesignCodeDebugRepeat thanks 🙏 I am still new to pygame and was just curious. I was looking for a way change the appearance of the characters when they pick up armor without having to redraw every frame of the character’s actions and movements. It sounds like bliting over the existing character is how it is done from your response? Also, thank you for taking the time to provide an answer❤️
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 3 ай бұрын
@@anthonydrakefordshadow I think you would have sprite sheets for the character and the armor, and you would blit the correct orientation of the armor over the character. So there would be the up-front work of drawing the armor so it looks right on the character in the different positions the character can be in. When the character puts armor on, you'd then blit the armor over the character, drawing from the same location in the sprite sheet each time for animations (you'd read the sprite sheets into a list). i.e. if we're on index 0 of the sprite, we'd blit index 0 of the armor over the sprite, using transparency in the image so it only draws the armor. I think transparency is the way to get a mask effect in blitting. You're welcome -- I think it's a cool idea. 🙂
@anthonydrakefordshadow
@anthonydrakefordshadow 3 ай бұрын
@@DesignCodeDebugRepeat would you be interested in making a video about it? It would be cool to see and would make a lot more sense for me a noob. I understand sprite sheets, list, and bliting but I haven’t done anything with transparency yet. Seeing it all put together would really help it click for me 😇
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 3 ай бұрын
@@anthonydrakefordshadow Yes, absolutely! I don't know if I can get it done for this Saturday because of other obligations, but I'll try to put it together for next Saturday at the latest. Thank you for the suggestion! 😁
@muhammadameenbhatti7983
@muhammadameenbhatti7983 4 ай бұрын
first day starting python. was stuck in this.. thanks.. it was helpful
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 4 ай бұрын
Oooh, exciting! Good luck with your journey! Figuring out what data type various variables were was very frustrating for me when I first learned Python! It's a really fun language, though -- like everything, it just takes some practice and experience. 🙂
@muhammadameenbhatti7983
@muhammadameenbhatti7983 4 ай бұрын
yeah, it was optional for me on my first program.. but I just couldn't move on without solving this..
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 4 ай бұрын
@@muhammadameenbhatti7983 If you get stuck again and can't find a video, drop a comment! I might already have a video on the subject or can probably point you in the right direction. 🙂
@muhammadameenbhatti7983
@muhammadameenbhatti7983 4 ай бұрын
​Thanks.. will keep that in mind. Me getting stuck is almost a sure thing anyway😅
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 4 ай бұрын
@@muhammadameenbhatti7983 😁 Then you're a true programmer. 😁
@mariacristinavitielloA
@mariacristinavitielloA 4 ай бұрын
Thank you for sharing your knowledge, Professor! This video was very helpful when reviewing the concepts of Inheritance and Polymorphism in Java. I used it in addition to reading chapter 10 in the book “STARTING OUT WITH JAVA, from Control Structures through Data Structures” (by Tony Gaddis and Godfrey Muganda)!
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 4 ай бұрын
I'm so glad you found it helpful, Cristina! Thank you for your kind comment. 😊
@kamalkumar5534
@kamalkumar5534 4 ай бұрын
Thankyou for this video. This helped me a lot to run java program in eclipse. I was facing the same issue.
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 4 ай бұрын
You're so welcome! I think it's a common problem for people just starting out with Eclipse, which is why I made the video! 🙂
@divers-tissement7008
@divers-tissement7008 4 ай бұрын
Excellent as always. The last example with printf is a nice trick. Is it possible to post at least 2 lessons per week ? Maybe it could help the yt algorithm :) Have a nice day 💛
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 4 ай бұрын
Thank you! Yes, I think that's a great use for the ternary operator! I'm sorry -- it's not possible to post more frequently. I have a job and these videos take a lot of time to make. I wish I could make them faster! I just want you to know that this comment, and I think your last one, got flagged again! :( I don't know why. I found it in "held for review." Speaking of YT algorithm -- it isn't very smart, is it!! I approve your comments every time but they still go there. I hope you have a lovely day as well. :)
@divers-tissement7008
@divers-tissement7008 4 ай бұрын
@@DesignCodeDebugRepeat As soon asI clicked on your videos, i smash the like button (knowing the value of the content in advance) and I'm pretty sure it must be considered a suspicious activity of some random bot...
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 4 ай бұрын
@@divers-tissement7008 Thank you for the vote of confidence!! 😊That's so kind, and I'm sorry if it makes the algorithm think you're a bot! 🤖
@MaZaKeRaL
@MaZaKeRaL 4 ай бұрын
Wonderful videos!! I'm re-learning a lot of concepts, so thank you so much! However, here is where I need to pay careful attention and understand how looping mechanisms work properly, as I burnt out and gave up last time when I couldn't understand nested loops. Some may call it the definition of insanity, repeating something and expecting a different result (no pun intended of course 🤣).
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 4 ай бұрын
I'm so glad you're finding them helpful! Loops are one of the harder concepts for people to learn. Lecture 5 in this chapter is on nested loops. There's a great tool -- pythontutor.com -- you can paste any code in and watch it execute step by step, and see how memory changes as it executes. That might help with learning loops and nested loops. Please feel free to ask questions about anything that isn't completely making sense -- I'll guide you if I can. 😊
@MaZaKeRaL
@MaZaKeRaL 4 ай бұрын
@@DesignCodeDebugRepeat Thank you soo much! this is the best channel on programming that I found in a long time! Keep up the fantastic work! 🙂
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 4 ай бұрын
@@MaZaKeRaL Thank you! I'm so pleased you're finding it helpful. 😊
@adenlahmar8822
@adenlahmar8822 4 ай бұрын
thanks
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 4 ай бұрын
You're welcome! Have fun with it. 😁
@MaZaKeRaL
@MaZaKeRaL 4 ай бұрын
Very helpful! Thank you so much!!
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 4 ай бұрын
You're welcome!
@DYNAMAX_D
@DYNAMAX_D 5 ай бұрын
thankyou kind teacher for teaching out the conctp of pygame.vector2 , nowhere in the internet had i found that the vector2 uses top left of pygame.screen as 0 , 0(i could not read through all the documentation for this ) thankyou for explaining it in detail using animations ♥
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 5 ай бұрын
You are most welcome! Thank you for your kind comment, and I'm so glad it was helpful. 😊
@hashbangbinbash8829
@hashbangbinbash8829 5 ай бұрын
Thank you so much! It is exactly what I’m looking to achieve in my backgammon game 👍 Great keyboard noises btw! Very ASMR ✌️
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 5 ай бұрын
I'm so glad you found it helpful, 🙂and what a great project! (I love backgammon!) And I'm so glad my video can help you relax and maybe sleep, lol!! 😴Now that I have better editing software, I speed up most of my typing, so it doesn't have that same slow rainfall sort of sound. 🙃
@anthonydrakefordshadow
@anthonydrakefordshadow 5 ай бұрын
I have been watching all of your pygame videos ❤ No other content creators annotate their variables, can you explain why this is done?
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 5 ай бұрын
Thank you for watching! 😊 Sure, I can tell you about variable annotation. (Yikes, I just sounded like ChatGPT there. ) The TL;DR is for readability. Despite that Python checks the syntax of your annotations and then ignores them, there are other tools that you can run on your code to do some type-checking before you end up with an error at run-time. The annotations are stored in a dictionary by Python. The longer version (my perspective) As you probably know, some languages require that you declare your variables. Python is dynamically typed, meaning the type of a variable is determined at run time. A variable is really just a name that points to a place in memory that's storing a value. It can point to any space like this, so at one time it can point to a space representing an integer, at another a string, at another, an object of another type. This makes Python code hard to read! When I first learned Python (almost fifteen years ago), I was learning Python and pygame at the same time, and it was confusing! (There were no annotations, in fact that was Python 2.7, and annotations didn't appear until 3.6.) I'd see a return from a pygame method assigned to a variable, but reading the code, I didn't know what data type that variable was. If you don't know what type a variable is, you don't know what you can do with it. 🤷‍♀ So the annotations are really for readability -- it's easier to use a function or method if you can immediately see the data type of the parameters you need to pass in and the type(s) it's going to return. (In fact, before variable annotations, the documentation recommendations (PEP 8) were to put in the docstring comment what a function returned.) That's the main reason, I'd say. One of the cool things about Python is you can read about the design decisions made for the language in the PEP documents. I was going to do a video on annotations / type hints but that is a rabbit warren of PEP documents to read through, so I haven't gotten around to it yet!! I hope that's helpful. 😁 (I don't know why other content creators don't annotate their variables, but it does add a lot of bulk to a program, particularly since you can't annotate many of the same type on one line. I love how lean Python code is without the annotations, but I don't love trying to read that code and if I'm teaching, I should be sharing the data type of every variable!)
@paulramasco6769
@paulramasco6769 5 ай бұрын
This was a very awesome video and idea, thank you for creating and sharing.
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 5 ай бұрын
Thank you! 😊 You're so welcome. 🏳‍🌈
@blitzcreegzero8807
@blitzcreegzero8807 5 ай бұрын
wish I could like this as many times as ive used it haha
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 5 ай бұрын
Well, I'm so glad!! 😊 These are the errors I see my students making most often -- I guess they're pretty common! Thank you for commenting. I like to know when people find my content useful! 😁
@anthonydrakefordshadow
@anthonydrakefordshadow 6 ай бұрын
Nice breakdown, thank you. This felt a lot more like learning how to think than the bargain barrel monkey see monkey do follow along tutorial.
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 6 ай бұрын
Thank you for taking the time to write your kind comment! 😊I'm a teacher, so I aim to be a little more than bargain barrel monkey see monkey do. 😁 (I love that description!) I'm sure I don't always succeed, but I try!
@Joao-nr8rr
@Joao-nr8rr 6 ай бұрын
OMFG thank you so much i was struggling to get my sprite rotating and no of the other videos i watched were this helpfull 🙏SÓ AGRADECE🙏
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 6 ай бұрын
I'm so glad it was helpful! 😊 Thank you for commenting to let me know, and good luck with your game!! 👍
@mariacristinavitielloA
@mariacristinavitielloA 6 ай бұрын
That was very helpful! Thank you!
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 6 ай бұрын
Oooh, you're welcome, Cristina! I'm so glad! 😁
@onenabeable
@onenabeable 6 ай бұрын
thanks
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 6 ай бұрын
You're welcome! 😊
@andresalarcon3303
@andresalarcon3303 6 ай бұрын
thanks for sharing your knowledge, just in this moment i'm learning java
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 6 ай бұрын
That's wonderful! I'm glad if you're finding my videos helpful. 😊 These new videos are for my introductory Java class. There will be one a week (with possibly a few interruptions for Python/pygame and other videos) until I've completed them through classes / objects and arrays / arraylists, and then if you're still with me, you can proceed to the older java videos, which are already here and which I use in my advanced class. 😁
@KarlSchmitt-u2y
@KarlSchmitt-u2y 6 ай бұрын
Very nice, I am allready a fan.
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 6 ай бұрын
Well, I'm glad if it's useful! Thank you for the kind comment and welcome! 😊
@ojasjain843
@ojasjain843 7 ай бұрын
the most overpowered module in the whole world is pygame.math module. now I can finally make the enemies move towards the player in my game. thank you for making this video.
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 6 ай бұрын
I don't know why youtube hid this comment from me! Thank you for commenting! You're welcome and I'm glad you found the video helpful!
@ojasjain843
@ojasjain843 6 ай бұрын
First time a youtuber is replying to me
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 6 ай бұрын
It could be because your comments are held for review for some reason. I didn't see this one, either. :( I certainly don't see anything wrong with your comments! You might see if you can find out from youtube what the issue is.
@coding_with_ojas
@coding_with_ojas 4 ай бұрын
@@DesignCodeDebugRepeat ok
@DesignCodeDebugRepeat
@DesignCodeDebugRepeat 4 ай бұрын
@@coding_with_ojas This comment came up immediately! Maybe whatever it was has been solved!