Can I code Pong?

Опубликовано: 24 Июль 2026
на канале: The Coding Train
299,789
4.7k

In this challenge, I attempt (emphasis on the word "attempt") to program the classic video game Pong in Processing (Java). Code: https://thecodingtrain.com/challenges...

🕹️ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/s...

🎥 Previous video:    • Coding Challenge #66: JavaScript Countdown...  
🎥 Next video:    • Coding Challenge #68: Breadth-First Search...  
🎥 All videos:    • Coding Challenges  

References:
🗄 Pong on Wikipedia: https://en.wikipedia.org/wiki/Pong
🏓 Paddle angles drawing: https://i1.wp.com/zekechan.net/wp-con...

Videos:
🚂 My Video on Polar Coordinates:    • 3.4 Polar Coordinates - The Nature of Code  
🎥 Video Games track: https://thecodingtrain.com/tracks/games
🔴 Coding Train Live 87:    • Coding Train Live 87: Timer in JavaScript,...  

Timestamps:
0:00 Introduction
2:05 Elements of Pong
5:07 Puck class
10:17 Paddle class
15:15 Move the paddles
20:29 Check if puck hits paddle
27:08 Check puck direction
40:56 Add score
42:30 Add sound
48:05 Constrain angle
57:05 Map the angle

Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound

🚂 Website: http://thecodingtrain.com/
👾 Share Your Creation! https://thecodingtrain.com/guides/pas...
🚩 Suggest Topics: https://github.com/CodingTrain/Sugges...
💡 GitHub: https://github.com/CodingTrain
💬 Discord: https://thecodingtrain.com/discord
💖 Membership: http://youtube.com/thecodingtrain/join
🛒 Store: https://standard.tv/codingtrain
🖋️ Twitter:   / thecodingtrain  
📸 Instagram:   / the.coding.train  

🎥 Coding Challenges:    • Coding Challenges  
🎥 Intro to Programming:    • Start learning here!  

🔗 p5.js: https://p5js.org
🔗 p5.js Web Editor: https://editor.p5js.org/
🔗 Processing: https://processing.org

📄 Code of Conduct: https://github.com/CodingTrain/Code-o...

This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecod...

#pongvideogame #polarcoordinates #processing