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
Tag: pygame
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
How add different images for enemies in a python game?
I currently have 6 enemies spawning, but they are all the same image. This is the relevant code: I want to have a different enemy image for each of the 6 enemies but don’t know what to google. Answer Just create a list with 6 file names:
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
collision issue with pygame in python3 using tiled
im working on a litle game using pygame in python3. Im using tiled for the map and pyscroll for the camera and i don’t know how to solve this issue: i made detection collision that work using object layer in tiled and a litle bit of code. the detection work pretty well but when it come to say to the
how can i remove the black bg color of an image with no alpha layer
So i started doing a game to pass the time and i don’t know how to solve this issue: my player is a part of a sprite sheet, the sprite sheet has a alpha layer so its transparent but when i divide my sprite sheet into small sprite, this alpha layer disapear and i have a black bg instead… I
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.
How to handle vector based movement and x axis tile map collisions in pygame
I have a problem with my pygame script in which the way I check for collisions doesn’t seem to work with the x axis and presents some very frustrating and downright stupid errors. The way it works is I first check for movement in the axis of choice, here is an example in the y axis. I then get a
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
Pygame is a bit laggy. Is it because of the many calculations?
I know it is written really badly but I’m learning. The game is really laggy and I was wondering how I can make it run faster and smoother. Also is the lag created from the many calculations or am I just dumb? The lag comes when there are a lot of enemies on the map and they shoot at the