# data[].attributes.body
•Not getting stuck on the walls

•Changed font on game over screen

•Added message when you set a new high score

•Fixed turning glitches

•draw_text improvements

# data[].attributes.body
•A quit button

• One-player mode

# data[].attributes.body
•A fullscreen button

# data[].attributes.body
•A message saying to press space

•Pick course screen

•Playing multiple times

# data[].attributes.body
•A second course!!!

•No more driving over the walls!

•better acceleration

•driving backwards

# data[].attributes.body
•A countdown at the start to be sure everyone starts at the same time.

•A finish line!

•Improved collision detection

# data[].attributes.body
I improved the function I use to draw text on the screen.

Before:

def draw_text(text, font, text_col, x, y):

text_img = font.render(text, True, text_col)

screen.blit(text_img, (x, y))

After:

def draw_text(text, font, text_col, x, y, transparent=True, topleft=False, surface=screen): if transparent == True: text_img = font.render(text, True, text_col) else: text_img = font.render(text, True, text_col, BG) blitloc = text_img.get_rect() if topleft: blitloc.topleft = (x, y) else: blitloc.center = (x, y) surface.blit(text_img, blitloc)

Now, I can choose whether or not to give the coordinates for the center or give the coordinates for the top left. This helped me make the game end screen a lot neater.

# data[].attributes.body
I am adding a timer to see how long it took you to finish. To do this, I create a variable called speed. Then I set the variable to the current time minus the time when the countdown finished. Then I round this to the nearest tenth of a second and print it onto the screen.

# data[].attributes.attachment_link.title
Displaying Text on The Screen In Pygame - Beginner Tutorial

# data[].attributes.headline
I am using pygame to make my game in python

# data[].attributes.subject
I am using pygame to make my game in python

# data[].attributes.headline
I was going to add a background like this, but then I changed my mind.

# data[].attributes.subject
I was going to add a background like this, but then I changed my mind.

# data[].attributes.body
I might add it again later, but it isn't a priority

# data[].attributes.attachment_link.title
PyGame Beginner Tutorial in Python - Infinite Scrolling Background

# data[].attributes.attachment_link.title
Creating and Moving Rectangles In Pygame - Beginner Tutorial

# data[].attributes.headline
Collisions are when you check whether two rectangles are touching. 

# data[].attributes.subject
Collisions are when you check whether two rectangles are touching. 

# data[].attributes.body
This is very important for most video games, including mine.

# data[].attributes.attachment_link.title
Collisions in Pygame - Beginner Tutorial

# data[].attributes.headline
In pygame, you can use masks to check for collisions in images with transparent backgrounds.

# data[].attributes.subject
In pygame, you can use masks to check for collisions in images with transparent backgrounds.

# data[].attributes.attachment_link.title
How to Use Pygame Masks for Pixel Perfect Collision

# data[].attributes.body
How can I make a video game in python? How easy is it to make a video game? How long will it take to make a video game? Is python a good language?

# data[].attributes.body
You used to be able to cross over to the other player's side and just press the button to go forward. You wouldn't have to steer, because the game only checks for collisions on your side. I fixed this by adding an invisible barrier in the middle, so no one can cross over.

# data[].attributes.attachment_caption
I finished in 23.7 seconds. The new timer tells you how long you took to finish!

# data[].attributes.body
•A timer!

•Background music

•Middle barrier to reduce cheating

•Saving the high score!

# data[].attributes.body
I wanted the game to save the high score even when you close and reopen the game. This meant I couldn't just make a variable, because that would reset each time you play the game. Instead, what I did was save it to a plain text file that would be accessed each time the program was run. Also, whenever the game ends, it will check if the current score is better than the old high score. If it is, it will save it to the file.

# data[].attributes.body
•Turning the car

•A new course

•Updated it so I can add bigger courses later.

# data[].attributes.body
31.9

# data[].attributes.body
•The message saying who won now takes up the entire screen, instead of a bar at the top.

•The course is now longer

# data[].attributes.body
Much easier than the first course! In the future I am planning to add even more.

# data[].attributes.body
Now, you slowly accelerate instead of speeding up all at once. You can also control your speed and drive in reverse.

# data[].attributes.body
Often when people are playing my game, they don't know that they need to press space to start the countdown. I added a message that appears before the countdown starts that says to press space.

# data[].attributes.body
I have had two courses to race on for a few weeks, but this week, I added a screen where you can pick which you want to use. This opens every time I run the code.

# data[].attributes.body
It was annoying to quit and rerun the code each time I wanted to play the game again. So now, you can play multiple times!

# data[].attributes.attachment_caption
The AI player (Sorry for the low quality, but Padlet wouldn't let me upload the original file because it was too big)

# data[].attributes.body
What it does, is it checks if it can move forward. If it can, it does. If it can't, it checks if it can go left; if it can, it does go left. Otherwise, it goes right.

# data[].attributes.body
It shows each number, and waits 1 second after displaying it on the screen.

# data[].attributes.body
You can now turn the actual car! This is a big improvement over the car just moving sideways, which looked weird. I originally tried to rotate the image in the code with pygame.transform.rotate, but that only works when rotating in 90º increments. Otherwise, it completely glitches. So what I had to do instead was make a different image for each way that it rotates and have it switch between the images whenever you press the button.

# data[].attributes.body
I finished everything!

# data[].attributes.body
The game end screen looked messy and off-center, so I wanted to improve it. Before, I had an image that said:

Player 1 wins!

Time: seconds

High score: seconds

Then, I would draw the text inside pygame, but only the numbers. Now I write all the text inside pygame, which makes it look so much neater! The reason I was able to center the text is the improvements I made to the draw_text function (see previous post) so I provided the center coordinates instead of top left, like before.

# data[].attributes.body
I zoomed out the courses to 0.8 so you could see what's coming next, but some people like it better zoomed in, so I made a settings menu so you could change the zoom level. I used the same animated button as the OK button on the game end screen for Save, but with different text drawn on it.

# data[].attributes.body
Originally, the menu at the top of the screen was just different images. Now, I am changing all the buttons throughout my program to rectangles in pygame instead of separate images. This will make it easier to edit them.

# data[].attributes.body
High scores are saved in a text file. I made 3 different text files, so each course could have it's own high score.

# data[].attributes.body
In pygame, there are a few types of keyboard input:

• get_pressed: This is just true or false depending on whether a certain key is being pressed.

• pygame.TEXTINPUT: This is used for typing something into a text field. I don't use this in my game.

• pygame.KEYDOWN: This is true or false depending on weather a key was pressed in that frame.

I made turning the car use pygame.KEYDOWN instead of get_pressed. This means that now each time you press the turn button you turn, instead of having to hold it down for a few seconds.

# data[].attributes.body
https://docs.google.com/document/d/1K9wrC7fG8RfWtaXw1slf2e_NOgPbqZuAD7IK5X1Mu6E/edit?usp=sharing

1984 lines!

# data[].attributes.body
• Better keyboard input

• Fixed more bugs!

# data[].attributes.body
• Separate high scores for each course

• Updated menu

• Various bug fixes

# data[].attributes.body
• A new course

• Mud patches

• Settings menu

• Save settings