A Very Normal Game About A Bee Trailer

Поделиться
HTML-код
  • Опубликовано: 8 фев 2025
  • You can download the game at tank-king.itch...
    Trailer music by mrpoly from opengameart.or...
    This game is a very simple game which uses a transparent window in which a bee flies on the screen and you have to catch it by clicking 3 times. This project is meant to demonstrate the latest features of the sdl2 module of the pygame library, mainly shifting the screen coordinates during run-time.

Комментарии • 31

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

    Nice one gunking

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

    @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

  • @redplazma8030
    @redplazma8030 3 года назад +1

    Reminds me of those early 2000s viruses, hella ya dood

  • @Mircoludist
    @Mircoludist 3 года назад

    Incredible !!

  • @katanshin
    @katanshin 3 года назад

    Reminds me of that old Neko desktop pet that came with the Archimedes pc's :D Legend!

    • @codekingchannel
      @codekingchannel  3 года назад

      Oh wow I just searched that up, that one is awesome! Thanks for telling me about it!

  • @amagicmuffin1191
    @amagicmuffin1191 2 года назад

    oh this is so cool, reminds me of that desktop goose game. i dont see many of this kind of game where the window is transparent, its pretty cool.
    planning on looking through your code at some point to figure out how to make custom widgets with pygame, i got a clock app built and i want to make it transparent

    • @codekingchannel
      @codekingchannel  2 года назад

      Great! Would be cool to have transparent desktop clock! Do send me your app code or executable link once you have finished it :)

    • @amagicmuffin1191
      @amagicmuffin1191 2 года назад

      @@codekingchannel wip as you can tell

    • @codekingchannel
      @codekingchannel  2 года назад

      @@amagicmuffin1191 Hehe, yeah :D

    • @codekingchannel
      @codekingchannel  2 года назад

      Hey! It looks like you deleted your comment lol, but I could read up to the license part only. Which license do you want me to put in the game repo? Would be very nice if you could suggest me that :)
      Also what was the rest of the comment? XD

    • @amagicmuffin1191
      @amagicmuffin1191 2 года назад

      @@codekingchannel Oh what the heck if it's not you then youtube is deleting my comments lmfao. I'm pretty sure I had a github link in this thread but its gone too now. Hold on I'll just send a pull request

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

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

    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  Год назад +1

      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.

  • @skysurfer_kon1641
    @skysurfer_kon1641 3 года назад

    The game is awesome!! How did you make the transparent moving window??

    • @codekingchannel
      @codekingchannel  3 года назад

      I used the win32api from the pywin32 python package to make the transparent window. And to move it, I used the ._sdl2 module from pygame package. You can find the code in the itch.io page of the game (linked in description) :)

    • @skysurfer_kon1641
      @skysurfer_kon1641 3 года назад +1

      @@codekingchannel Whoa! Thanks!

    • @codekingchannel
      @codekingchannel  3 года назад

      :)))

    • @pcb5135
      @pcb5135 2 года назад

      @@codekingchannel i have a question didnt win32api requires admin rights to use? I have similar idea for program i made transparent screen tried to compile it and it requires admin rights. WHy?

    • @codekingchannel
      @codekingchannel  2 года назад

      @@pcb5135 There is a possibility that win32api requires admin rights to use. But it may also depend on what functions you are using and what permissions you have set up in your windows OS. For example, if you have ransomware protection enabled, then you will need admin rights for even creating a file. So it is best to use admin permissions for using the win32api.

  • @thewhiteprogrammer9633
    @thewhiteprogrammer9633 3 года назад

    how u maked window transperrent

    • @codekingchannel
      @codekingchannel  3 года назад

      I mainly used the win32api module (from pywin32 package) to get the transparent background. You can find the source code from the game's itch.io page [given in the video description].

  • @minkazistherealone1828
    @minkazistherealone1828 2 года назад

    is it possible to create a transparent window on windows 64?

    • @codekingchannel
      @codekingchannel  2 года назад

      Do you mean 64-bit windows? If yes, then definitely it is possible to do that. I have also used windows 10 64-bit version for the game. But this currently works only in the windows operating system, not in mac or linux.

    • @ThisIsGreenRoom
      @ThisIsGreenRoom 2 года назад

      @@codekingchannel Have you used the 3.9 version of python?

    • @codekingchannel
      @codekingchannel  2 года назад

      @@ThisIsGreenRoom I think so, yeah.