Code King
Code King
  • Видео 37
  • Просмотров 64 899
2024 Pygame Projects | Showcase
Here is the compilation of few of my projects I have made in 2024 using pygame. There were some more projects too, but most of them are unfinished or in-progress. Thanks for watching and Happy New Year!
Timestamps:
00:00 : Forest Fire
00:31 : Space Station Shooter
01:11 : Procedural Run Animation
01:49 : Custom Window Titlebar
02:23 : Rainy Ambience from Car
02:45 : Thanks for Watching
All projects can be found from my itch.io and github.
github: github.com/tank-king
itch.io: tank-king.itch.io
Song Credits:
Song: Faithful Mission
Composer: Artificial.Music
Website: ruclips.net/channel/UCC49uNuUk7pY77NoVMlNYDA
License: Creative Commons (BY 3.0) creativecommons.org/licenses/by/3.0/
Music powered by Breakin...
Просмотров: 695

Видео

Car Window Defogging with Rain Ambience - Pygame Tutorial
Просмотров 5916 месяцев назад
I tried to create a game ambience where the player views a scenery from the window of a moving car while it is raining. The window can be opened, which leads to more noise from outside coming in, but less fogging due to open area. Closing it does the opposite. The constant rain outside causes a foggy effect (using gaussian blur) on the window although the player can wipe the window to defog the...
2023 Pygame Projects | Showcase
Просмотров 1,1 тыс.Год назад
Here is the compilation of few of my projects I have made in 2023 using pygame (and godot). There were some more projects too, but most of them are unfinished or in-progress. Thanks for watching and Happy New Year! Timestamps: 00:00 : Intro 00:04 : Aqua Refresh 00:30 : MineSwept Islands 00:44 : Audio Visualizer 00:59 : Pygame-HTML 01:26 : PyRock2D 01:56 : Outro All projects can be found from my...
Create Beautiful Rocks with Dynamic Lighting using this App | PyRock2D
Просмотров 399Год назад
Introducing PyRock2D - A 2D rock generator with Real-Time Dynamic Lighting App Link: tank-king.itch.io/PyRock2D Song Used: Dorris Day - DJ Williams
Python Operator Size (Precedence) Comparison
Просмотров 395Год назад
Ever saw the Universe Size Comparison videos and wondered if someone would make one about python operators? No? Well, here is one anyway. The "size" of each operator is based on their precedence. Official list of precedence (python 3.12): docs.python.org/3/reference/expressions.html#operator-precedence While there is no official way to sort operators with same precedence, I ordered them in non-...
2022 #pygame Projects
Просмотров 7272 года назад
Hi Everyone! I am posting this video after a long time. This video is a collection of all the games and projects I made using pygame in the year 2022. Happy New Year to everyone! Discord Link: discord.gg/qh8XGWypvg Timestamps: 00:00 : Intro 00:06 : Bug Invaders 00:44 : BreakPong 00:55 : Defender Remastered 01:06 : Mutant Spaceship 01:18 : Dimension Beats 01:47 : Save The Crabs 02:03 : Water Sim...
Creating Flappy Bird (Landscaped Edition) in Python [Timelapse]
Просмотров 5292 года назад
Hi Everyone! This is a Timelapse Video of me making a Flappy Bird game in python using the pygame module. What's different than the usual Flappy Bird games is that this game does not have the standard portrait orientation used in mobile phones. Instead, it uses a 16:9 aspect ratio (landscape orientation), which enables it to be run in any standard PC monitor. The source code of the game can be ...
Program a Cool Water effect using #pygame in #python
Просмотров 6 тыс.2 года назад
Hi Everyone! This video is a showcase of a 2D water effect I made using python and pygame. Hope you all like it :) Code used in the video: github.com/tank-king/Tutorials/tree/20dbf647701d6e6c48eacb21d3285c19d9a93b91/Python Pygame/water In case of any queries, you can post them in the comments, or you can join my discord server. Discord Server Link: discord.gg/qh8XGWypvg Timestamps: 00:00 : Intr...
#Multiprocessing Demo in #Python and #Pygame | Multiple Screens and Displays Sync from One Process
Просмотров 1,3 тыс.2 года назад
Code used in the video: github.com/tank-king/Tutorials/tree/main/Python Pygame/multiple windows In case of any queries, you can post them in the comments, or you can join my discord server. Discord Server Link: discord.gg/qh8XGWypvg #python #pygame #multiprocessing #gamedev #programming
How to make a Loading Screen using #Multiprocessing in #Python and #Pygame
Просмотров 2,8 тыс.2 года назад
Hello Everyone! This is a video tutorial on how to make a loading screen using the multiprocessing and pygame modules in python. Code used in the video: github.com/tank-king/Tutorials/tree/main/Python Pygame/loading_screen In case of any queries, you can post them in the comments, or you can join my discord server. Discord Server Link: discord.gg/qh8XGWypvg TimeStamps: 00:00 : Intro 00:09 : Bas...
How to convert images to ASCII in #Python using #Pygame
Просмотров 1,8 тыс.2 года назад
Hello Everyone! This is a video tutorial on how to convert images to ASCII using the pygame module in python. Code used in the video: github.com/tank-king/Tutorials/tree/main/Python Pygame/image_to_ASCII In case of any queries, you can post them in the comments, or you can join my discord server. Discord Server Link: discord.gg/qh8XGWypvg TimeStamps: 00:00 : Intro 00:05 : Basic Setup 00:14 : Im...
How to program a Cool Smoke effect using #Pygame
Просмотров 5 тыс.2 года назад
Hello Everyone! This is a video tutorial on how to make a cool smoke effect using the pygame module in python. Code used in the video: github.com/tank-king/Tutorials/tree/main/Python Pygame/smoke_effect In case of any queries, you can post them in the comments, or you can join my discord server. Discord Server Link: discord.gg/qh8XGWypvg TimeStamps: 00:00 : Preview 00:12 : Basic Setup 00:29 : M...
#Defender Remastered Trailer
Просмотров 9342 года назад
Official Trailer for the Remaster of the 1981 classic I made in python using pygame. Get the classic retro experience, now featuring an online leaderboard, from: tank-king.itch.io/defender #python #gamedev #pygame #leaderboard
2021 Game Dev Projects
Просмотров 3303 года назад
This video is about some of my projects I made in 2021, or started in 2021 but still in development. Hope you enjoy this, and Happy New Year everyone! Timestamps: 00:00 : Intro 00:03 : Froggy and the Snake 00:16 : Monzilla 00:36 : Dicey 00:59 : Sudoku 01:16 : A Very Normal Game About A Bee 01:30 : Lighting Effects 01:35 : Particle Effects 01:43 : Numclic 01:58 : Bubbles 02:13 : Defender
Particle Effects | Pygame Community Discord Weekly Challenge 02 - Particles
Просмотров 9383 года назад
Particle Effects | Pygame Community Discord Weekly Challenge 02 - Particles
Lighting and Blending effects | Pygame Community Discord Weekly Challenge 01 - fog of war
Просмотров 3,2 тыс.3 года назад
Lighting and Blending effects | Pygame Community Discord Weekly Challenge 01 - fog of war
Durga Puja Animation with Pygame Flame Particle System
Просмотров 3493 года назад
Durga Puja Animation with Pygame Flame Particle System
How to make a flame in Python using Pygame
Просмотров 3,9 тыс.3 года назад
How to make a flame in Python using Pygame
A Very Normal Game About A Bee Trailer
Просмотров 1,5 тыс.3 года назад
A Very Normal Game About A Bee Trailer
Tempest Run Trailer
Просмотров 8363 года назад
Tempest Run Trailer
Python Turtle: Getting Text Input | Textbox with blinking cursor | Detect keys pressed by User
Просмотров 3,5 тыс.3 года назад
Python Turtle: Getting Text Input | Textbox with blinking cursor | Detect keys pressed by User
Froggy and the Snake Gameplay
Просмотров 1983 года назад
Froggy and the Snake Gameplay
The Food Machine Gameplay
Просмотров 1013 года назад
The Food Machine Gameplay
Pong Game Tutorial Python Turtle | Part 2 | Ball Movement and AI Implementation
Просмотров 8393 года назад
Pong Game Tutorial Python Turtle | Part 2 | Ball Movement and AI Implementation
Pong Game Tutorial Python Turtle | Part 1 | Basic Setup and Player Movement
Просмотров 1,5 тыс.4 года назад
Pong Game Tutorial Python Turtle | Part 1 | Basic Setup and Player Movement
Sudoku Generator and Solver | Python Turtle Graphics
Просмотров 1,8 тыс.4 года назад
Sudoku Generator and Solver | Python Turtle Graphics
Python Pygame Tutorial | Making a Stylish Analog Clock
Просмотров 3,1 тыс.4 года назад
Python Pygame Tutorial | Making a Stylish Analog Clock
Creating Buttons in Python Turtle | Rectangular and Circular Buttons
Просмотров 8 тыс.4 года назад
Creating Buttons in Python Turtle | Rectangular and Circular Buttons
Catch The Cake | Python Pygame | A simple falling objects game
Просмотров 2,5 тыс.4 года назад
Catch The Cake | Python Pygame | A simple falling objects game
Plant To Earn Game | Python Pygame | A simple gardening game
Просмотров 2754 года назад
Plant To Earn Game | Python Pygame | A simple gardening game

Комментарии

  • @cleanmess1400
    @cleanmess1400 5 дней назад

    Nice

  • @thefirstcoatline
    @thefirstcoatline 25 дней назад

    My favorite is the car window one. That's sick!

    • @codekingchannel
      @codekingchannel 25 дней назад

      Thank You! I have a video on the car window implementation in details in my channel if interested 😄

  • @damus8057
    @damus8057 Месяц назад

    Those were very cool projects! I played the ISS destroyer myself this summer. It would be cool if you redirected the fire to another project, that and the lightning looked sick :) The custom window is cool, and it's a fun coincidence because I did the same thing inside my ui library MILI UI (mili.CustomWindowBorders). I also added resizing and some API fine tuning so you might want to check it out :)

    • @codekingchannel
      @codekingchannel 29 дней назад

      Thanks! I will try to redirect the fire to another project, however without shaders, it is hard to have enough particles without impacting performance, so I need to think of another way. Ooh I did not know you added it to MILI UI! I had been following the project for some time but did not catch up on it recently. So I will definitely check it out :)

  • @Hyperphant
    @Hyperphant Месяц назад

    thanks I was looking for this and I just subscribed. Can you pls make a tutorial on normal mapping in pygame?

    • @codekingchannel
      @codekingchannel Месяц назад

      Thank You! You asked for normal mapping in a very good time, because recently I have been looking at implementing them in pygame. However I have not yet implemented one. Also, given pygame's performance, it is better to stick to pixel art for normal maps. But if we do stick to pixel art, I feel we can use a heightmap instead of a normal map to reduce complexity. I will let you know if I implement it in pygame. Thanks for the suggestion :)

  • @W12-K50BML
    @W12-K50BML Месяц назад

    Nice one gunking

  • @1werse
    @1werse 3 месяца назад

    I'm tacky664 btw. Why can't i open the pygame file?

    • @codekingchannel
      @codekingchannel 3 месяца назад

      You need to run it with python, and run main.py with all requirements installed.

  • @1werse
    @1werse 3 месяца назад

    YO GUNKING on bf! i see a lot:) btw im tacky664:}

  • @ChoiVibess
    @ChoiVibess 5 месяцев назад

    bitcraft tutorial pls

    • @codekingchannel
      @codekingchannel 5 месяцев назад

      Hi, Sorry for the late reply. It is a little difficult for me to make a tutorial now, but bitcraft version is basically using a raycast and detecting the collisions. You can read more on raycasting algorithms on the internet for this. Also look into line-rect collision. For further details you can look into how bitcraft implemented their algorithm here: github.com/pygame-community/LegacyWeeklyChallenges/blob/master/01-fog-of-war/bitcraft/main.py

    • @ChoiVibess
      @ChoiVibess 5 месяцев назад

      @@codekingchannel thnks

  • @noTmeDev
    @noTmeDev 6 месяцев назад

    Sick

  • @ISKOBR
    @ISKOBR 6 месяцев назад

    this is so sick!

  • @lioninaboxgames
    @lioninaboxgames 6 месяцев назад

    Very cool effect!

  • @paheaccount1388
    @paheaccount1388 7 месяцев назад

    Amazing! Really raising the bar of what can be done with pygame.

    • @codekingchannel
      @codekingchannel 7 месяцев назад

      Thanks! That was my objective, and I am glad you feel the same :)

  • @samueldavies646
    @samueldavies646 7 месяцев назад

    super chill video, and amazing pixel art!! super underated.

    • @codekingchannel
      @codekingchannel 7 месяцев назад

      Thanks, but the pixel art is not mine 😅 I used the wonderful assets from craftpix.net (linked in description)

    • @samueldavies646
      @samueldavies646 7 месяцев назад

      @@codekingchannel ah still impressive, I remember I watched your video on the bee game

    • @codekingchannel
      @codekingchannel 7 месяцев назад

      @@samueldavies646 😊😊😊

  • @maqabayker
    @maqabayker 7 месяцев назад

    Wow, it looks so magnificent 🤩. Good job bro!

  • @idiedlastmonth
    @idiedlastmonth 7 месяцев назад

    So nice!

  • @pkgaming8741
    @pkgaming8741 7 месяцев назад

    Hi bro

    • @codekingchannel
      @codekingchannel 7 месяцев назад

      Hello! 👋👋👋

    • @pkgaming8741
      @pkgaming8741 6 месяцев назад

      @@codekingchannel how can i learn this

    • @codekingchannel
      @codekingchannel 6 месяцев назад

      Well I would suggest you to try thinking freely when approaching different problems. Instead of doing it the right way, try to first do a hacky way, like faking it. Then try to do the actual thing. For example let's say u want to make a flappy bird game. The correct way to do it is add a camera, spawn pipes and move the camera along the world. However, one simple way is to keep the bird fixed and move pipes towards it. Of course this is not perfect solution but atleast it works. With more practice you will eventually figure out better ways. And after a certain point of time you will realise how you should approach any problem and make any feature. Also keep reading through documentation of libraries, they can help a lot. Also you can try asking chatgpt fot solutions and it will give an approach to do the same.

  • @lioninaboxgames
    @lioninaboxgames 8 месяцев назад

    You're amazing with all the projects you keep concocting together!

  • @pierre-louis4519
    @pierre-louis4519 8 месяцев назад

    Such mastery is unhealthy. You should be punished and prohibited from broadcasting. 😤😭 Many thanks sir, (python discoverer) I am fighting against the machine for doing 1/10th of what you show in this video (multiprocessing with a pygame window). Let's have a look to your code and I'll see if I can extract its substantial essence. 🙂 Anyway, you have a new fan in your subscribers.

    • @codekingchannel
      @codekingchannel 8 месяцев назад

      Thank you very much sir for the kind words. I hope you have been able to extract some useful info from my code. If you need further assistance, kindly let me know here (or my discord server) 😃

    • @pierre-louis4519
      @pierre-louis4519 8 месяцев назад

      @@codekingchannelLet's go to the server :)

    • @codekingchannel
      @codekingchannel 8 месяцев назад

      @@pierre-louis4519 :)))

  • @dancal31
    @dancal31 9 месяцев назад

    Really nice, simple and efficient. Thanks.

  • @PeterRichardsandYoureNot
    @PeterRichardsandYoureNot Год назад

    Thanks. This is exactly what I;y what I need to do scores above enemy players when they get killed that will fade up and away/

    • @codekingchannel
      @codekingchannel Год назад

      That is a really cool scenario to use the smoke effect!

  • @justinbos8567
    @justinbos8567 Год назад

    I was looking to see if multiprocessing works well together with pygame. This definitely proves my point. It looks amazing, really well done!

    • @codekingchannel
      @codekingchannel Год назад

      Thanks, it does work well with pygame. I have another video on multiprocessing using pygame (mostly for implementing a loading screen without impacting performance) which you can see for a further example. Btw, this video was made before launch of pygame-ce. Since then, they have exposed the SDL2 window API which can help you create the same thing as this video in 1 single process!

  • @Scyther-ow8wy
    @Scyther-ow8wy Год назад

    I tried using the flag BELDN_RGB_MULT to try and make a flashlight however the beam of the flashlight went invisible and the transparent part went black went I used the blit function. Can someone help me?

  • @Mircoludist
    @Mircoludist Год назад

    TankKING!!! we back ! amazing work !!

  • @Xplouding
    @Xplouding Год назад

    Good stuff!!! I really like the audio visualizer project!!

    • @codekingchannel
      @codekingchannel Год назад

      Thanks! I am working on it still, and going to make it better :)

  • @ammarshahzad9627
    @ammarshahzad9627 Год назад

    man you are under rated, Keep up the good work

  • @RoboMarchello
    @RoboMarchello Год назад

    Nice projects! Keep it up! The pygame-HTML project is interesting, it would be cool if it could run a simplified version of Wikipedia or something

    • @codekingchannel
      @codekingchannel Год назад

      Thanks a lot @RoboMarchello ! The pygame-HTML project can definitely modified to run a simplified version of Wikipedia. The current limitations are: [1] No JavaScript support [2] Limited CSS support [3] Uses basic HTML rendering, no fancy GUI layout like flexbox etc. [4] Limited alignment horizontally and vertically However, the advantage is that you can integrate it with python and pygame, and therefore use it for GUI rendering in pygame. You can even bind hyperlinks to some action in pygame.

  • @Stentric_bald
    @Stentric_bald Год назад

    Absolutely amazing tutorial and code! It is clean and smooth. Best one I've seen by far. The only struggle I'm having is that whenever I run the code, it states self.tk.call((self._w, 'delete') + args) _tkinter.TclError: invalid command name ".!canvas" I canot find a fix ANYWHERE, and I really need to fix it. I don't know if you will respond because this was posted 2 years ago, but if you do happen to see it, it would help so much if you could help me fix it. Either way, the code is still great, and will help me a lot!

    • @Stentric_bald
      @Stentric_bald Год назад

      Also, may you provide the code for getting the text the player inputted as a variable you can use. If you are able to, that would help me a lot :)

    • @codekingchannel
      @codekingchannel Год назад

      Hey! I am still active on the channel lol (even though my posting frequency has reduced temporarily). Thank you for the lovely comments! Are you using the exact code I am using? And which version of python are you using? Did you make any adjustments to the original code? If so, what are they? I am asking so that I can help debug the issue further :D

    • @codekingchannel
      @codekingchannel Год назад

      Once you make the textbox object (let us name it t_obj), you can access it's text property any time for getting the net user input at that instant. So in this case you would do <t_obj>.text to access the text.

    • @Stentric_bald
      @Stentric_bald Год назад

      @@codekingchannel I have copied the code from github, and have made sure that it has not been adjusted at all, and I am using Python 3.12. If the version is the problem, then I'll try to find a way around it. Also thanks a lot for the explanation for the text input. :)

    • @Stentric_bald
      @Stentric_bald Год назад

      I believe I have just found the issue. On my version of Python, it sometimes accidentally uses one of the text procedures before it is called. I have swapped around the order of the procedures and it is working for now. I will let you know if it is still a problem. Either way, thank you so much for providing the code, and explanation, and being really helpful overall. I believe I can get it to keep working by making sure that the procedures are defined just before they are called. That way it won't matter if it accidentally gets used before it is called, because it would have been called anyway. I have fixed the issue for now. Sorry for the bother, just it being glitchy. Either way, thank you so much for responding and helping to resolve it. Have a wonderful day, and thank you :)

  • @TitaniumNitro
    @TitaniumNitro Год назад

    @codek1ng Hey! I'm trying to make a similar game with pygame too, I need some help on the transparent windows however as I installed pywin32 on my PC and imported the module into my project with this code: import win32. What do I do now? Importing it like this (I seperate each import code to the next line): import win32api, import win32con, win32gui, hasn't worked correctly, leading to an error in the workspace.

    • @codekingchannel
      @codekingchannel Год назад

      Hi, can you please elaborate on what the error message is? Does copy pasting my exact code work properly for you? It should work theoretically, although I know of 1 potential issue that could have arisen due to minor change in the pygame.Window API. Also, can you tell me which version of pygame are you using? Btw, I would recommend you to switch to pygame-ce if you haven't already :D

  • @nerdyturkey312
    @nerdyturkey312 Год назад

    Very cool!!

    • @codekingchannel
      @codekingchannel Год назад

      Thank You! Good to see you @nerdyturkey312 after a long time :)

  • @maqabayker
    @maqabayker Год назад

    Wooow. Amazing! You finally did it, hah! Great work bro👍👏

  • @philtoa334
    @philtoa334 Год назад

    Nice .

  • @saveuyghurmuslims2354
    @saveuyghurmuslims2354 Год назад

    what the fuck have i watched Xdddddd AWSOME MAN

  • @r3d570n3
    @r3d570n3 Год назад

    That's so cool!

  • @Goji41
    @Goji41 Год назад

    The code is more bug in sublimetext

    • @codekingchannel
      @codekingchannel Год назад

      Can you please elaborate? What specific bugs are you getting?

  • @waynewestlake8120
    @waynewestlake8120 Год назад

    As a budding Pythoner and Pygamer I'd love a tutorial on how you coded this (the base game - not interested in the leaderboard part). I know you put a lot of time and effort into this so I would be more than willing to purchase the tutorial. Keep it in mind!

    • @codekingchannel
      @codekingchannel Год назад

      Thank you for the offer. The original code for this is slightly unorganized, but I can put together a organized tutorial for the game. I will also put up the logic of implementing everything, and optimizations I used (there are too many particles during smartbombing so needed to optimize). Let me know if you have any way of reaching out to you individually, like discord or reddit.

    • @codekingchannel
      @codekingchannel Год назад

      btw my discord is: discord.com/invite/qh8XGWypvg

  • @baloon-mm5km
    @baloon-mm5km Год назад

    how can you store the input

    • @codekingchannel
      @codekingchannel Год назад

      The textbox object has a 'text' attribute for storing text. You can use that for referencing it wherever you want.

  • @JohnMitchellCalif
    @JohnMitchellCalif Год назад

    very clear! Subscribed

  • @jorgesoto7991
    @jorgesoto7991 Год назад

    I was waiting the particles xD But the particles were in the text.

    • @codekingchannel
      @codekingchannel Год назад

      XD Also there are particles in the background, although not very noticeable

    • @jorgesoto7991
      @jorgesoto7991 Год назад

      @@codekingchannel That's why my monitor is with brightness low.

    • @codekingchannel
      @codekingchannel Год назад

      Ah I see

  • @playlistplug
    @playlistplug Год назад

    my bro you earned a sub for this

  • @xevalro
    @xevalro Год назад

    Whenever I try to blit an image with the transparent window, it creates a ugly purple outline. How were you able to blit the bee png onto the display surface without this happening?

    • @codekingchannel
      @codekingchannel Год назад

      Interesting Question, because from your description it seems like your picture has a smooth outline. My image is pixelated, i.e. very distinct pixels are colored. Your image is probably anti-aliased, meaning there is a smooth effect. So if you have a black smooth outline (for example), then it will slowly fade from (0, 0, 0, 255) to (0, 0, 0, 0). The intermediate values here do not equate to the colorkey background set in the window. Try using a fine pixel art image and see if it works or not. If it does work, then you need to change the transparency of the image.

  • @StormwreckerOfficial
    @StormwreckerOfficial Год назад

    Wow! This is really cool (and intimidating to look at code-wise). Two quick questions: How did you figure out that you needed SCRALPHA? How does the flame affect pygame's performance? Again, thanks for showing how to make this awesome effect!

    • @codekingchannel
      @codekingchannel Год назад

      Thank You!!! - SRCALPHA was needed because direct drawing on main display using alpha (transparent) values is not supported. Therefore, I first create an SRCALPHA surface, draw transparent circle on it, and then render it to main display. - Flame is pretty optimized and gives over 1000 FPS for me in a 600 X 600 window. On my old PC, it gave about 500 FPS, and could handle 30-40 flames at 60 FPS Once again, thank you :)

    • @StormwreckerOfficial
      @StormwreckerOfficial Год назад

      @@codekingchannel Thanks for getting back to me! That makes sense why you need SRCALPHA. I've always wondered why the alpha argument in the variable 'color' never did anything. In my game, I've added some torches using your effect, and it does slow the game down a lot (old PC), but that was fairly easy to fix. Everything now runs fine, and the torch adds a lot of good aesthetic. Thank you!

    • @codekingchannel
      @codekingchannel Год назад

      Glad that it is working :) Also you can try to cache the results to improve performance. That should increase FPS quite a bit.

    • @StormwreckerOfficial
      @StormwreckerOfficial Год назад

      @@codekingchannelHow would you implement that exactly? I've struggled with slow FPS before, but the solution I used was to update and draw on-screen objects instead of all the objects in the whole level. But, I have never heard of caching. It would be interesting to see how that would be done.

    • @codekingchannel
      @codekingchannel Год назад

      @@StormwreckerOfficialWhat you did is a good approach, but caching can indeed enhance the performance by a lot, specially if there are repetitive draw calls. You can use the lru_cache functions for this or design your own caching mechanism. Below is a source code modification of the original flame code where I used lru_cache to cache the results. On my PC, rendering 40 flames without caching took 75 FPS approx. But with caching, I improved it to more than 200 FPS. So you can see the FPS boost is more than 2 times. You can check out the code here: pastebin.com/hedPwgEe

  • @gpb0817
    @gpb0817 Год назад

    Where do you get the clamp function??

    • @codekingchannel
      @codekingchannel Год назад

      You can use `pygame.math.clamp` or make your custom clamp function.

  • @theXenduck
    @theXenduck Год назад

    So i have been using this game (very epic btw) as a reference point to try and code a similar sprite over the desktop program. I have got my sprite displayed with an invisible window on top of the desktop, but I cant find in your code how you keep it on top of all the other windows, apart from 'Window.from_display_module().focus()' which I have no idea where comes from...

    • @codekingchannel
      @codekingchannel Год назад

      Ah, that line is from pygame._sdl2. That is not the correct way to use Window module. You need to use window = Window.frojm_display_module() and reuse it later. I did not know about this when I made the game. This is just a temporary fix to constantly focus the window so that it is always on top. I remember someone on reddit made a modification to my game and added features. If I find that, I will post it here. For now, you can use that line per frame to keep the window on top. That should work.

  • @saveuyghurmuslims2354
    @saveuyghurmuslims2354 Год назад

    man ur skills are greater then any pygame dev on youtube you should make big tutorials

    • @codekingchannel
      @codekingchannel Год назад

      Thanks man, but there are many other pro pygame devs on RUclips too hehe. I am indeed planning on making bigger tutorials. Thank you for the suggestion :)

    • @saveuyghurmuslims2354
      @saveuyghurmuslims2354 Год назад

      @@codekingchannel no no ur better in term in detail ur video help to get complex things many tutorials are in term of the simplicity and they do that very well but as for people like me who want to go out of beginners things ur way better

    • @codekingchannel
      @codekingchannel Год назад

      @@saveuyghurmuslims2354 Thanks a lot!!! That was the original intention of the channel - to make advanced content for those who want to go beyond beginners. Thanks for the compliments ❤❤❤

  • @overratedprogrammer
    @overratedprogrammer Год назад

    Blending surfaces always confused me. I see some people using rgb add and rgb sub(tract). But if I understand you're not using that here? Just making a surface on top of the display surface, bliting a circle, am then blit the light surface blend mult on the display surface?

    • @codekingchannel
      @codekingchannel Год назад

      Yes u r right. I can use ADD or SUB too if needed, but the reason I use a new surface is because I don't want to remove the original data below that surface.

  • @SDZeeAy
    @SDZeeAy Год назад

    Great job! The flames look absolutely amazing!

  • @philtoa334
    @philtoa334 Год назад

    Very Nice.

  • @philtoa334
    @philtoa334 Год назад

    👍👍

  • @philtoa334
    @philtoa334 Год назад

    GOOOD.

  • @philtoa334
    @philtoa334 Год назад

    Great video.