Title Slide - Head-to-Head Battle
00:00-03:00
Share screen with the finished game - two tanks, one firing and the projectile flying in a parabola and hitting
"Good evening everyone! Welcome to the final lesson of the course - the coolest lesson of them all."
"Do you see this? Two tanks. Each of you will control one tank. You'll choose an angle, choose power, and fire."
Demonstrate a shot - the projectile flies in a parabola, hits, explosion!
"Look at the projectile. It doesn't move in a straight line - it flies in a parabola. Just like in real life. Gravity pulls it down exactly like a ball being thrown."
"Today we're not just building a game. We're learning real physics."
"And at the end of the lesson? You'll play against each other. Tank vs Tank. One keyboard, two players, a real battle."
History - The First Game and Turn-based Battles
Tank Wars / Artillery Games (1980s) took the idea a step further: instead of fast reflexes, strategic thinking.
"Before we start building, let's talk about history for a moment."
"The first commercial game in history was Pong - 1972. Two players, paddles, a ball. Simple but revolutionary."
"Why? Because it was social. Two people next to one machine, competing. Not computer against person - person against person."
"The game we're building today belongs to a different genre: Artillery Games - cannon games. This genre started in the 80s with games like Tank Wars."
"Instead of fast reflexes, you need thinking. What angle? what power? If I make a mistake - my opponent takes advantage."
Local Multiplayer - Two Players, One Keyboard
03:00-08:00Online Multiplayer: two players on different devices over the internet. Complex - requires servers, synchronization, Netcode.
"There are two types of Multiplayer: Local and Online."
"Online - that's when everyone is on their own computer, connected via the internet. It's complicated. You need servers, synchronization, a lot of code."
"Local - it's simple. Two players, the same keyboard. One uses WASD, the other uses arrows. One sits on the left, the other on the right."
"And it's not just simple - it's also more fun. You see the expression on your opponent's face when they miss. You hear them shout when you hit."
"Local Multiplayer is much more than code - it's a social experience."
Input Handling - Managing Multiple Inputs
Player 1: W (Up), S (Down), D (Shoot)
Player 2: Arrow Up (Up), Arrow Down (Down), Arrow Right or SPACE (Shoot)
In code: we need to identify which key was pressed and update the correct player.
"When there are two players, there's a problem: two sets of keys."
"Player 1 uses WASD. Why? Because it's on the left side of the keyboard - convenient for someone sitting on the left."
"Player 2 uses arrows. Why? Because it's on the right side - convenient for someone sitting on the right."
"In code, we need to recognize: 'Wait, was W pressed or Arrow Up? If W - update the first player. If Arrow - update the second'."
"This is called Key Mapping. It's the basis for every local multiplayer game."
The First Prompt - Building the Engine
08:00-15:001. Two tanks - fixed position on the sides of the screen, with a moving barrel
2. Angle system - each tank can aim the barrel up/down
3. Power system - how strong the shot is (Power bar)
4. Parabolic projectile - flies according to the laws of physics
Open Antigravity, new project named TankDuel
"Everyone open Antigravity. New project. Call it TankDuel or BattleTanks."
"We're going to ask the agent to build the base. Two tanks, an aiming system, and real physics."
Type the prompt and press Generate
"Notice the instructions. I'm asking for real physics - 'realistic parabolic trajectory with gravity'."
"I'm also asking for a Power Meter. Why? Because the longer we hold the key, the stronger the shot will be. This adds a layer of skill."
Wait for completion and click Preview
"The agent finished. Let's see what we have..."
Demonstrate the game - change angle, fire, projectile flies
"Wow. look at this. We have two tanks. I press W - the barrel moves up. S - down. D - hits!"
"And look at the projectile. It doesn't move in a straight line. It makes an arc. This is a real mathematical parabola."
Projectile Motion - How It Moves
Horizontal (X): Constant speed (no air resistance in our game)
Vertical (Y): Starts with high speed upwards, but gravity slows it down until the projectile falls
The formulas:
vx = power * cos(angle) - horizontal velocityvy = power * sin(angle) - initial vertical velocityvy += gravity - gravity adds to vertical velocity every frame
"Let's understand what happens when the projectile flies. There's real physics here."
"When firing, the projectile gets velocity in two directions: X (side to side) and Y (up and down)."
"The horizontal velocity (X) remains constant. But the vertical velocity (Y)? It changes all the time because of gravity."
"At first, the projectile moves fast upwards. But gravity slows it down... slows it down... until it stops in the air for a moment, and then starts falling."
"It's exactly like throwing a ball up in real life. It goes up, stops, comes down. Same physics."
"Our agent wrote this math. It took the angle we chose, the power, and turned it into realistic movement."
Angle & Power - Mastery through Skill
15:00-22:00Power: How strong the shot is. 0% = the projectile falls next to the tank, 100% = it flies far away
Power Bar: Visual indicator that shows power in real-time - the longer you hold the key, the power increases.
"We have a small problem. Right now, the power is always the same. That's boring."
"Let's add a Power Bar - a meter that teaches the player control."
Type the improvement prompt
"I'm asking the agent: 'When I hold the fire key, show me a filling meter. The longer I hold - the power increases'."
Run the game with Power Bar
"Now look. I hold D... and the meter starts to fill. Green... yellow... red. Now I release - hits!"
"This adds a layer of skill. You need to know when to let go. Too much power - the projectile flies over the opponent. Too little - it falls short."
"That's the art of the game."
Turn-based Gameplay - Strategy First
Turn-based: Each player takes turns (Chess, Civilization, Worms)
Turn-based Benefits:
- Time to think and plan
- Less pressure, more strategy
- Ideal for playing with one keyboard
- Simple mechanism to implement
The Logic:
1. Player 1 fires → Projectile flies → Hit/Miss
2. currentPlayer = 2 (Switch turn)
3. Player 2 fires → Projectile flies → Hit/Miss
4. currentPlayer = 1 (Back to Player 1)
UI: Visual highlight of whose turn it is - the active tank glows, or there's text saying "PLAYER 1 TURN".
"Now let's talk about Turn-based Gameplay - turn-based play."
"Most games we've built so far have been Real-time - everything happens at once. In Snake, the snake moves constantly. In Flappy Bird, you have to jump fast."
"But in our game? One turn at a time. Player 1 fires. Then the turn passes to Player 2. Player 2 fires. Back to Player 1."
"Why is this good? Because it gives you time to think. You don't need fast reflexes. You need strategy."
"What angle will hit the opponent? Exactly how much power do I need? It's like chess - you plan your move."
"And the game tracks currentPlayer - a variable that says 'now it's Player 1's turn' or 'now it's Player 2's turn'."
Collision & Explosions - Drama on Impact
22:00-30:00The check:
if (projectileX >= tankX && projectileX <= tankX + tankWidth &&
projectileY >= tankY && projectileY <= tankY + tankHeight)If condition met → Hit! → Explosion + Point + Turn switch
1. Visual: A circle/ball that expands and fades (or a particle system)
2. Audio: Explosion sound (low-frequency Sawtooth wave)
3. Screen Shake: Slight camera tremor - moving the Canvas 2-3 pixels randomly for 200ms
"The game works, but it's missing something. Drama."
"When the projectile hits, it just... disappears. No feedback. No feeling of impact."
"Let's add an explosion!"
Type the prompt
"I'm asking the agent for three things:"
"1. Visual explosion - orange-red circle that grows and fades.
2. Explosion sound - low buzz using Web Audio.
3. Screen shake - slight Camera Shake."
Run the game and demonstrate a hit
"Now look... I fire... BOOM!"
[Let the explosion land]
"The screen shook for a moment! There was an explosion! There was sound! It feels like a real hit!"
Particle System - Visual Polish
Uses: Fire, smoke, explosions, sparks, rain, snow, magic
How it works:
1. Each particle = a small object with: position, velocity, color, size, lifespan
2. Every frame: update position, decrease lifespan, change opacity
3. When lifespan reaches 0 → delete the particle
"Our explosion looks good. But there's something that can be even more amazing."
"Instead of one circle that fades, what if we use a Particle System - a particle system?"
"That means: instead of one big object, dozens of small objects scattering in all directions."
Type the prompt
"I'm asking the agent to create 20-30 particles. Each flies in a random direction, random color (orange/yellow/red), and fades."
Run and demonstrate explosion with particles
"Now look... I fire... BOOM!!!"
[Let the explosion land]
"Look at that! Particles flying everywhere! It looks like a real explosion!"
"This is a Particle System - one of the most important tools for creating effects in games."
Polishing - Adding Game States
30:00-40:003 states in our game:
MENU: Start screen - "TANK DUEL", "Press SPACE to Start"
PLAYING: Game is active - shooting, turns, score
GAME_OVER: Someone won - "PLAYER X WINS!", "Press R to Restart"
"We have a working game. Now let's turn it into a complete product."
"A real game needs three things:"
"1. Start Menu - a screen that explains how to play.
2. Win Condition - first to reach 5 points wins.
3. Game Over screen - 'Player 1 Wins!' with an option to restart."
Type the prompt
"I'm asking the agent to add all this. And a bonus - Trajectory Preview - a dotted line showing where the projectile will fly."
Run the game, show menu
"Now when I open the game, there's a menu! 'TANK DUEL' in large. Instructions. Pressing Space..."
Play until victory
"The game starts. Player 1 fires... hit! 1-0. Player 2 fires... hit! 1-1..."
[Continue playing]
"5-3... PLAYER 1 WINS!"
"That's it. We have a complete game with a beginning, middle, and end. A real product."
Summary & The Journey Continues
40:00-50:00Input Handling - managing multiple inputs (WASD + arrows)
Key Mapping - assigning keys to players
Projectile Motion - projectile physics (parabola)
Angle & Power - aiming and strength system
Turn-based Gameplay - turn-by-turn play
Player Switching - logic for swapping active players
Hit Detection - collision logic
Particle System - for visual effects
Camera Shake - for impact feedback
Game States - Menu, Playing, Game Over
Win Condition - ending the game
Stop screen sharing, return to camera
"Friends, that's it. We've finished the last lesson."
"Let's stop for a moment and look at what we did today:"
"We built a game with real physics - projectiles flying in parabolas just like in nature."
"We learned Local Multiplayer - how two players play together on one device."
"We created a Particle System - effects that look like AAA games."
"And we built a complete game - with a menu, turns, victory, and restart."
"But this is not the end."
"It's just the beginning. In this course, you learned the foundations:"
"• How to talk to AI
• How to build games
• How to solve problems
• How to turn ideas into products"
"Now you can take this anywhere. Want to build a racing game? Build it. Want a card game? Build it. You have the tools."
"The final challenge: Take Tank Duel, and add something of your own. Wind that changes the projectile path? Destructible terrain? Special weapons? Be creative!"
"And if you wanted to learn more - we'll meet in the next course. We'll learn how to turn games into real apps, how to upload to an app store, and how to build games with neural networks."
"Thank you all for an amazing course. You are game developers now! 🎮"