Below is a complete, self-contained implementation of a simple Avatar: The Last Airbender-themed bending arcade game. I've chosen Python as the coding language because it's widely accessible, and I've used the built-in turtle module for graphics and input handling. The turtle module is part of Python's standard library, so no external installations or file uploads are needed—just copy-paste this code into a Python file (e.g., bending_game.py) and run it with Python 3.
This game doesn't rely on any external assets (images, sounds, etc.). All "assets" are created programmatically using Turtle's drawing commands:
- The player is a simple stick-figure airbender (inspired by Aang).
- Enemies are firebenders (drawn as red stick figures).
- Bending effects are animated shapes (e.g., swirling air blasts as blue circles/lines).
- Background is a basic arena with elemental symbols (drawn lines and shapes).
Game Concept
- Theme: You play as an airbender (like Aang) in an arcade-style survival shooter. Fire Nation enemies appear and shoot fire blasts at you. Use airbending to dodge and counter with air blasts to defeat them.
- Controls:
- Arrow keys: Move left/right/up/down.
- Spacebar: Shoot an air blast (bending projectile).
- Objective: Survive as long as possible, defeat enemies to score points. Game over if an enemy fire blast hits you.
- Mechanics: Simple collision detection, scoring, and respawning enemies. The game runs in a loop until you lose.
The game is kept simple for Turtle's capabilities—it's 2D, turn-based in animation, but feels arcade-like with real-time input.
Code
import turtle
import random
import time
# Set up the screen
screen = turtle.Screen()
screen.title("Avatar: The Last Airbender - Bending Arcade")
screen.bgcolor("lightblue") # Sky background for airbending theme
screen.setup(width=800, height=600)
screen.tracer(0) # Manual screen updates for smoother animation
# Draw simple background arena (elemental symbols, no external assets)
def draw_background():
bg = turtle.Turtle()
bg.hideturtle()
bg.penup()
bg.color("green")
# Earth symbol: square base
bg.goto(-300, -250)
bg.pendown()
for _ in range(4):
bg.forward(600)
bg.left(90)
bg.penup()
# Water waves: blue lines
bg.color("blue")
bg.goto(-200, -200)
bg.pendown()
for i in range(3):
bg.circle(50, 180)
bg.right(180)
bg.forward(100)
bg.penup()
# Fire symbol: red triangle flames
bg.color("red")
bg.goto(100, -200)
bg.pendown()
bg.goto(150, -150)
bg.goto(200, -200)
bg.goto(100, -200)
bg.penup()
# Air swirls: white curves
bg.color("white")
bg.goto(0, 200)
bg.pendown()
bg.circle(30)
bg.circle(-30)
bg.penup()
draw_background()
# Player (Airbender - simple stick figure)
player = turtle.Turtle()
player.shape("circle")
player.color("orange") # Aang's outfit color
player.penup()
player.speed(0)
player.goto(0, -200)
# Draw player details (staff and arrows - programmatic lines)
def draw_player():
player.clear() # Redraw to avoid trails
player.dot(20, "orange") # Head/body
# Arrows (air nomad tattoos)
player.color("blue")
player.goto(player.xcor(), player.ycor() + 10)
player.pendown()
player.goto(player.xcor() + 5, player.ycor() + 15)
player.penup()
player.goto(player.xcor(), player.ycor() - 10)
# Staff
player.color("brown")
player.goto(player.xcor() - 10, player.ycor() - 20)
player.pendown()
player.goto(player.xcor() + 20, player.ycor() - 40)
player.penup()
player.goto(0, -200) # Reset position
# Air blast projectile
class AirBlast(turtle.Turtle):
def __init__(self):
super().__init__()
self.shape("circle")
self.color("lightblue")
self.penup()
self.speed(0)
self.hideturtle()
def shoot(self, x, y):
self.goto(x, y)
self.showturtle()
self.dy = 10 # Speed upward
def move(self):
self.sety(self.ycor() + self.dy)
# Draw swirling effect (simple lines)
self.clear()
self.dot(10, "lightblue")
self.color("white")
self.pendown()
self.circle(5)
self.penup()
if self.ycor() > 300:
self.hideturtle()
# Enemy (Firebender - red stick figure)
class Enemy(turtle.Turtle):
def __init__(self):
super().__init__()
self.shape("circle")
self.color("red")
self.penup()
self.speed(0)
self.goto(random.randint(-300, 300), 250)
self.dy = -2 # Move down slowly
self.fire_blast = None
def draw_enemy(self):
self.clear()
self.dot(20, "red") # Body
# Flames on hands
self.color("orange")
self.goto(self.xcor() - 10, self.ycor() - 10)
self.pendown()
self.goto(self.xcor(), self.ycor() - 20)
self.penup()
def move(self):
self.sety(self.ycor() + self.dy)
self.draw_enemy()
# Randomly shoot fire blast
if random.random() < 0.02 and not self.fire_blast:
self.fire_blast = FireBlast()
self.fire_blast.shoot(self.xcor(), self.ycor() - 20)
def is_hit(self, blast):
return self.distance(blast) < 20
# Fire blast from enemy
class FireBlast(turtle.Turtle):
def __init__(self):
super().__init__()
self.shape("triangle")
self.color("orange")
self.penup()
self.speed(0)
self.hideturtle()
def shoot(self, x, y):
self.goto(x, y)
self.setheading(270) # Downward
self.showturtle()
self.dy = -5 # Speed downward
def move(self):
self.sety(self.ycor() + self.dy)
# Draw flame effect
self.clear()
self.color("orange")
self.dot(15)
self.color("yellow")
self.dot(5)
if self.ycor() < -300:
self.hideturtle()
# Game variables
air_blasts = []
enemies = [Enemy() for _ in range(3)] # Start with 3 enemies
fire_blasts = []
score = 0
game_over = False
# Score display
score_turtle = turtle.Turtle()
score_turtle.hideturtle()
score_turtle.penup()
score_turtle.goto(-350, 250)
score_turtle.color("black")
# Key bindings
screen.listen()
screen.onkey(lambda: player.setx(player.xcor() - 20), "Left")
screen.onkey(lambda: player.setx(player.xcor() + 20), "Right")
screen.onkey(lambda: player.sety(player.ycor() + 20), "Up")
screen.onkey(lambda: player.sety(player.ycor() - 20), "Down")
def shoot_air():
blast = AirBlast()
blast.shoot(player.xcor(), player.ycor() + 20)
air_blasts.append(blast)
screen.onkey(shoot_air, "space")
# Main game loop
while not game_over:
screen.update()
time.sleep(0.05) # Frame rate control
# Update score
score_turtle.clear()
score_turtle.write(f"Score: {score}", font=("Arial", 16, "normal"))
# Draw player
draw_player()
# Move and check air blasts
for blast in air_blasts[:]:
blast.move()
for enemy in enemies[:]:
if enemy.is_hit(blast):
enemy.hideturtle()
enemies.remove(enemy)
air_blasts.remove(blast)
blast.hideturtle()
score += 1
# Respawn enemy
enemies.append(Enemy())
break
# Move enemies and their fire blasts
for enemy in enemies:
enemy.move()
if enemy.fire_blast:
enemy.fire_blast.move()
fire_blasts.append(enemy.fire_blast)
enemy.fire_blast = None
for fb in fire_blasts[:]:
fb.move()
if fb.distance(player) < 20:
game_over = True
if fb.ycor() < -300:
fire_blasts.remove(fb)
fb.hideturtle()
# Boundary checks for player
if player.xcor() > 380:
player.setx(380)
if player.xcor() < -380:
player.setx(-380)
if player.ycor() > 280:
player.sety(280)
if player.ycor() < -280:
player.sety(-280)
# Game over screen
if game_over:
go = turtle.Turtle()
go.hideturtle()
go.color("red")
go.write("Game Over! Final Score: {}".format(score), align="center", font=("Arial", 24, "bold"))
screen.mainloop()
How to Run
- Ensure you have Python 3 installed (download from python.org if needed).
- Save the code to a file like
bending_game.py.
- Run it in a terminal/command prompt:
python bending_game.py.
- Use arrow keys to move, spacebar to bend (shoot air blasts).
Explanation of Assets and Design
- Player: A orange circle with blue arrow lines (tattoos) and a brown staff line—all drawn with
dot(), goto(), and circle().
- Enemies: Red circles with orange flame lines.
- Air Blast: Light blue dot with a white swirl circle for bending effect.
- Fire Blast: Orange/yellow dots in a triangle shape for flames.
- Background: Hand-drawn elemental symbols (square for earth, waves for water, triangle for fire, swirls for air) using basic Turtle shapes.
- Gameplay Balance: Enemies spawn/respawn randomly, shoot occasionally. Simple distance-based collision.
This is a basic arcade game—feel free to expand it (e.g., add more bending types by modifying classes). If you want it in another language (e.g., JavaScript with Canvas), let me know!