So, after creating my first Godot game, I decided to clone pong. If you know pong, you probably know there’s not much to it. First, I set up an area2D node with a sprite and collider. I then programmed it to go up and down with keypresses by the player, set a max and min height and that’s it. Then, I added a ball. It spawns centered with my reset()-function and moves with a certain velocity. It was easy to mess up what comes after a collision detection. I’ve probably spent most of my time just coding when to invert x speed, y speed and when not to. Then, I copied the player scene, removed control code and instead coded a simple AI: If ball is above your y-coordinate, go up. else, go down. Now, the ball had to detect when it hit a side wall and send a signal to the main script, which displays the score. Easier said tan done with no prior experience, but It’d probably be easy for me to replicate it now. There’s just one question: what’s next?
Did you like this post? Tell us
Leave a comment
Log in with your itch.io account to leave a comment.