Pong
- 5 Devlogs
- 20 Total hours
I'm following the Bevy pong tutorial from TaitedCoders and adding my own personal touches and bug fixes, like randomised bounces and adaptive AI.
I'm following the Bevy pong tutorial from TaitedCoders and adding my own personal touches and bug fixes, like randomised bounces and adaptive AI.
This devlog marks the nearing of the end of this project. I made these changes a week ago, but was unable to find time to write a devlog before I went off-grid.
Here are the main changes:
I added an end screen with a randomised end message based off of who won (9 messages each) and a Restart button that uses a lot of the same code as the start screen. I also realised that 10 goals was a lot and quite slow, so I dropped it down to 5.
I fixed the colour palette by finally swapping the background colour to something within the grand palette.
Hopefully, this is the last collision issue. If the ball hit the top/bottom of a paddle while the paddle had the same v_y direction as the ball, the ball would still swap v_y direction and go DOWN/UP, so this is hopefully taken care of. It doesn’t matter how fast the ball goes because if it hits the top/bottom of a paddle, the point is already lost.
The next devlog will probably be with all the build files and such.
Time Delay, Adaptive AI, and Bevy Update
Here’s what I’ve done:
The AI previously would only move if the ball was a minimum distance away, and it would outpace the ball, stop, the ball would get away, it would outpace it again, and so on because the adaptive AI was increasing speeds. Now it only changes it’s velocity every 0.1s
The adaptive AI was also mediocre, so I dropped it and raised the paddle speed. It was really just an AI nerf.
I upgraded from Bevy 0.18.1 to 0.19.0
This came with some changes to text and layouts
0.18.1:
let font = asset_server.load("fonts/PixelifySans-Regular.ttf");
let label = (
Text::new("Start"),
TextFont {
font,
font_size: 40.,
..default()
},
TextColor(Color::BLACK),
);
0.19.0:
let font = asset_server.load("fonts/PixelifySans-Regular.ttf");
let label = (
Text::new("Start"),
TextFont {
font: FontSource::Handle(font),
font_size: FontSize::Px(40.),
..default()
},
TextColor(Color::BLACK),
);
among others.
Added a Start Screen and did some Debugging!
So I’ve continued improving pong, and here’s what I’ve done since the last devlog.
There are only two more things I need to do before shipping!
[] Make the AI a time delay instead of a space delay
[] Make an end and restart screen
Finished the tutorial and working on my own mods!
I started this as a way to learn how to use the basics of 2D game dev with Bevy before I make my Chrome Dino clone Gleebo Run (I know, so original). Continuing this project will help me grasp more of the basics.
I Added:
To Add
To Fix
I finished step 17 of the tutorial!