Skip to content
Advertisement

Tag: pygame

Adding an outline around a snake in snake game

Im making a snake game and I thought that it would realy cool if there was an outline to the snake. But just drawing a box around each body part in the snake looks bad. So I want to add an outline to only the edges of the snake, but im lost on how one would do/start it. The body

I am having trouble with enemies in pygame

I have been trying to create an enemy class for my snake game that I can execute in my pygame loop, but my fill_screen() function keeps it so that either one enemy is on the screen at a time, or no enemies are on the screen. I hope someone can help me with this issue, because I have been working

Converting scroll bar coordinates to mouse coordinates

I’m trying to make a scroll bar and at the moment, the scroll works by changing the coordinates when blitting (as opposed to changing the actual rect coordinates). This means that rect collisions for buttons do not work when they are moved. I am attempting to combat this by calculating the percentage that the scroll bar has scrolled, converting that

Flip sprite when changing the direction of movement

Today I started to learn pygame and python to eventually remake the simple game “Graphwar”. As my first project I chose to make a really simple 2d car game while following a tutorial, now I want to try something on my own. That is to make my cars to visually change direction by using pygame.transform.flip() when pressing A or D.

Pygame delete non sprite objects

So Im trying to make an upward scrolling platformer, and I need a way to delete the score counter and hide the death screen when a player dies and restarts. However, those objects aren’t sprites. Is there still a way to delete them? Answer this is just an example because you have not provided any code :'( you have to

Advertisement