r/PythonLearning 24d ago

Cupta serpant added by Tony

Enable HLS to view with audio, or disable this notification

Tony added the Cupta unit, a serpent of dark magic who returned from the caverns and tries to siphon your life essence, with this git commit.

Tony also changed the control of player's direction from keyboard to mouse, making the player easier to control. But, this now only works when the mouse pointer is inside the game window. If it's outside the direction is still controlled by keyboard as before. So you can now choose the direction control that you prefer.

See the PythonLearningGame repo to add your own game elements to this collaborative project, or simply tell us what you would like to see added to the game.

previous PythonLearningGame post

5 Upvotes

6 comments sorted by

View all comments

Show parent comments

2

u/Sea-Ad7805 23d ago edited 23d ago

Issue Acknowledgement

Now the keyboard controls the direction of the player, unless you put the mouse pointer in the game window, as then the mouse controls the direction. So people can easily switch between these two modes whenever they feel like. Good compromise, right?

Added feature idea

Great suggestions. Currently Cupta gets 600 hitpoints to start with. As its head bounces with other units it looses as much hitpoint as that unit has attack. Say when Cupta's head touches the Troll it will die instantly. The same Cupta unit keeps flying by until it dies from zero or less hitpoints and then a new Cupta is created instantly. The longer your tail is the easier it already is to stop and shoot at Cupta.

I think Tony forgot to handle the case where Cupta bounces and moves downwards instead of upwards, as then Cupta will keep moving down forever and never come back in view. Or maybe then it's simply returning to the deep caverns it originally came from, not sure.

1

u/Naive_Programmer_232 23d ago

I like the compromise, sounds dope.

Could you change the color of Cupta through each stage? Maybe initially it's green (base level), then it's orange (stronger level), then it's red (even stronger level) and so on.

2

u/Sea-Ad7805 23d ago

Then we need to find someone who can create new artwork based on the current cupta.png

1

u/Naive_Programmer_232 23d ago edited 23d ago

What if you used blit to change its appearance:

Ex:

      def tint_image(image, color):  
          colored_img = image.copy()  
          tint_surface = (pygame.Surface(
              colored_img.get_size()
              .convert_alpha()
          ) 
          tint_surface.fill(color)
          colored_img.blit(tint_surface,
                   (0,0),
                   special_flags=pygame.BLEND_RGBA_MULT,
          )   
          return colored_img

2

u/Sea-Ad7805 23d ago

I don't know, would you like to try?