Title Slide - Your First Game with Physics
Part 1: ~5 min
Share screen with a finished Pong game - glowing ball flying fast,
bouncing off walls and paddles, particles exploding
"Good evening everyone! Look at the screen. See that ball? It's flying. Not jumping between grid cells like our Snake - it's
actually flying."
"It hits the wall... bounces. It hits the paddle... changes direction. Do you see the little particle explosion? The
neon glow?"
"This is not a number game. This is not a grid game. This is a physics
game."
[Pause - let the word sink in]
"Today we're building Pong - the father of all computer games in
the world. And this time, we're doing it 2025-style: neon glow, particle explosions, and a
computer opponent that challenges us."
"But most importantly? Zero images from the internet. Everything
will be created from pure code - so the game will be smooth, fast, and perfect."
Static vs Dynamic - Types of Games
Dynamic games: The screen changes constantly, 60 times per second, even if you don't press anything. Pong - the ball flies on its own, the opponent moves on its own. The game "lives" continuously.
Open the clicker game from lesson 2 - click twice and stop
"Remember the clicker we built? Watch. I click - number goes up. I click - number goes up. But
the moment I don't click? Nothing happens. The screen is frozen."
"Snake too. Yes, the snake 'moves', but it jumps from cell to cell. It's not smooth movement -
it's more like chess."
Switch to the Pong game - let go of the mouse
"Now look at this. I put down the mouse. The ball keeps moving.
The opponent keeps moving. The game is alive without me."
"That's the difference between static and dynamic. A static game
works in turns. A dynamic game works in real-time."
Game Loop - The Heartbeat of the Game
Part 2: ~10 minEach "beat" of the loop: 1) Update positions (move the ball), 2) Check collisions (did it hit something?), 3) Redraw the screen.
This happens so fast that our eyes see smooth motion, just like in a movie.
"So how does the computer create this illusion? Game Loop - the
game loop."
"Think of it like a flipbook that you flip through really fast. Each page is a slightly
different drawing, and you flip through them so quickly it looks like motion."
"In our game, 60 times per second, the computer does this
process:"
"1. Update: Move the ball a little. Move the opponent a
little.
2. Check: Did the ball hit something?
3. Draw: Erase the screen and redraw everything in the new
positions."
"This happens so fast that our eyes can't detect the individual beats. We see smooth motion."
"And this is exactly what the AI will write for us in just a few seconds."
Prototype - The First Trial Version
In game development, you always start from a prototype: build the basic mechanics (ball moves, paddle responds) without worrying about colors and effects. Only after you see that the idea works - you start making it beautiful.
"Before we build a beautiful game with neon and particles, we need to talk about Prototype."
"It's the ugly first version. It's like an architect's sketch before they draw the detailed
blueprint."
"In game development, you always start simple: Does the idea
work? Does the ball move? Does the paddle respond? Is there collision?"
"Only after we see that the mechanics work - then we start painting, adding effects, and
turning it into something beautiful."
"So we'll do this in two stages: first a basic prototype, then
full polish."
The First Prompt - The Basic Engine
Part 3: ~10 minWe're not asking for design at this stage - just that the game works.
Open a new project in the IDE
"Everyone create a new project. Call it Pong or NeonPong."
"Our first prompt will build the basic engine. We're asking
for:"
"1. A classic Pong game - ball, two paddles.
2. The player controls the left paddle with the mouse (not
keyboard!).
3. The computer controls the right paddle automatically.
4. The ball bounces off walls and paddles.
5. There's a scoring system up to 5 points."
Paste the prompt, press Enter, wait for the code to be written
"Watch how the AI thinks. It knows it needs to create a physics engine. It writes variables
like ballX, ballY, velocityX, velocityY."
Click Preview when the code is done
"Let's check... There we go! We have a game. The ball moves, my paddle follows the mouse, the
opponent moves on its own."
"But look closely: it's ugly. Black and white, simple
rectangles. That's the prototype. And it works. That's what
matters at this stage."
Assets vs Procedural - Images or Code?
Procedural Graphics: The code draws everything itself. Want a glowing cyan circle? The code draws it. Want a red spark? The code draws it. Zero external files.
"Okay, the game works. Now we want it to look beautiful. And
here there are two paths:"
"Path 1 - Assets: We go to Google Images, search for 'pong ball
PNG', download an image, make sure it has a transparent background, resize it, import it into
the code. It works, but it's tedious."
"Path 2 - Procedural Graphics: We ask the AI to draw everything
in code. Want a round ball with a cyan glow? One line of code. Want paddles with a neon
effect? One line."
"Which path do we choose? Procedural. Why?"
"1. It's fast - no need to search for images.
2. It's clean - no annoying white backgrounds.
3. It's flexible - want to change the color? One word in the
prompt."
"Let's turn our prototype into a crazy neon game."
Collision Detection - How the Game "Feels" Collisions
Part 4: ~10 minIf yes - something happens: the ball bounces, the player gets a point, or a sound plays.
Without Collision Detection, the ball would pass through the walls like a ghost. This is what makes digital things feel tangible.
Play the game - demonstrate the moment the ball hits the paddle
"Watch what happens now. The ball is heading toward my paddle... Hit! And it bounced back."
"How does the computer know the ball hit? Collision Detection -
detecting collisions."
"Every frame, the code asks: 'Where's the ball? Where's the paddle? Are they in the same
place?' If yes - the ball changes direction."
"It's not magic. It's simple math: if the ball's X position equals the paddle's X position,
and the Y position overlaps - there's a collision."
"And here's the amazing part: the AI writes all these calculations for
us. We just ask 'make the ball bounce off the paddle,' and it knows how to do it."
"Now that the game works, let's turn it into cyberpunk."
Paste the design prompt, run it
"I'm asking for: black background, glowing cyan paddles, glowing magenta ball, and glow
effects on everything."
Click Preview
"Boom! Look at that. The exact same game, but now it looks like
it came straight out of Tron."
"And that's the power of Procedural Graphics. We changed four
words in the prompt, and the game completely transformed."
Juice & Polish - "Game Feel"
Polish is the final refinement - the small details that turn a good game into a great game.
"Our game now works and it's beautiful. But there's still something missing."
Play the game - demonstrate the ball hitting
"Watch. The ball hits the paddle... and that's it. It happens, but it doesn't feel like enough."
"In professional games, every action gives you feedback -
something that tells you 'yes, that happened, and it was awesome.'"
"This is called Juice. It's what turns a technical game into a
fun game."
"We'll add two things to our game that'll give it Juice: a subtle screen shake on every hit,
and a particle system that explodes."
Particle Systems - Particle Explosions
Part 5: ~10 minEach particle is a small object with position, direction, speed, and a lifespan. The engine needs to manage them all simultaneously - which makes it a technical challenge, but with AI it's simple.
"Now we're getting to the coolest part: Particle System -
particle systems."
"Imagine that every time the ball hits something, there's a small explosion of colorful sparks
scattering in all directions."
"That sounds complicated to program, right? Managing 20 particles, each moving in a different
direction, disappearing at different rates..."
"But for the AI, it's one line of instructions."
Paste the particles prompt, run it
"I'm asking: when the ball hits, generate 20 small particles that explode outward and
disappear."
Click Preview and play - demonstrate the explosion
"Look at that! Every hit now comes with a small explosion. It
doesn't change the rules of the game - but it feels 10 times
better."
"That's exactly what Juice means: we added sensation, satisfaction, visual feedback. The game
went from a game that works to a game that's fun to play."
AI Opponent - Teaching the Computer to Be a Rival
But a perfect opponent is boring - you can't win. So you need to add "intentional mistakes": reaction delay, speed limits, occasional bad decisions.
Play against the computer - try to win
"We have a small problem. Watch, I'm playing against the computer... it never misses."
"Why? Because the computer sees the exact position of the ball and just moves to it. It's not
fair - the computer is perfect."
"In the real world, opponents make mistakes. They're not perfect. If our opponent is perfect,
the game isn't fun."
"So we're going to teach the computer... to be worse. Sounds
backwards, right? But this is one of the most important concepts in game design."
Game Balance - Tuning the Difficulty
Part 6: ~10 minProper balance means: the player feels they can win if they play well, but they need to try hard.
"So how do we solve the problem? We add intentional
weaknesses to the computer."
Paste the balance prompt
"I'm asking the AI to do three things:"
"1. Reaction delay: The computer doesn't react instantly. It has
150 milliseconds of 'thinking time.'
2. Speed limit: Its paddle moves at 70% of my speed.
3. Random mistakes: In 10% of cases, it just moves to the wrong
spot."
Run Preview and play - this time you'll win
"Let's check... Yes! I won! The computer missed a few times, it
didn't get there in time."
"The game is now balanced. If I play well, I'll win. If I play
poorly, the computer wins. And that's exactly what we want."
"This is Game Balance: not too easy, not too hard, just right."
Summary and Homework
Part 7: ~5 minPrototype - Simple first version, functionality before beauty
Assets vs Procedural - External images vs code-generated graphics
Collision Detection - Detecting collisions between objects
Juice & Polish - The feel and satisfaction of the game
Particle Systems - Exploding particle effects
AI Opponent - A computer opponent that plays against you
Game Balance - Tuning difficulty so the game stays fun
FPS - Frames Per Second, how many times per second the screen redraws
Real-time - A game that keeps running even without player input
Stop screen sharing, switch back to full camera
"So what did we do today? We built a game with real physics -
not just numbers going up, not just grid-based jumps. A game that truly lives."
"We learned how to plan a game in stages: prototype first,
design later."
"We learned to use procedural graphics instead of downloading
images from the internet."
"And most importantly - we learned that balance is everything. A
good game isn't a perfect game, it's a game that challenges you in just the right way."
"Your homework: Take this Pong and play with the parameters. Try
changing:"
"- The ball speed (faster / slower)
- The paddle sizes (harder / easier)
- The colors (what if instead of cyan and magenta you use green and gold?)
- Add more effects (screen shakes? sounds?)"
"In the next lesson, we're going to go even deeper into physics and build a game with gravity and variable speed."
"Thank you all, see you in the next lesson!"