About 1,030 results
Open links in new tab
  1. Python game examples
    Python-based game examples showcasing diverse genres and coding challenges for learning and entertainment
    Guess the Number
    Simple guessing game
    Rock Paper Scissors
    Classic hand game
    Tic Tac Toe
    Grid-based strategy
    Quiz
    Knowledge testing
    Hangman
    Word guessing game
    Blackjack
    Card game challenge
    Turtle Racing Game
    Graphical racing game
    Snake Game
    Classic arcade game
    Tetris
    Falling block puzzle
    Pong
    Ball and paddle
    Breakout
    Brick-breaking game
    Connect Four
    Disc arrangement game
    Flappy Bird Clone
    Endless flying game
    Sudoku
    Number puzzle game
    Checkers
    Strategic board game
    Wordle Clone
    Word guessing game
    Platformer 2D
    Side-scrolling adventure
    Role Playing Game
    Character-driven adventure
    • Work Report
    • Email
    • Rewrite
    • Speech
    • Title Generator
    • Smart Reply
    • Poem
    • Essay
    • Joke
    • Instagram Post
    • X Post
    • Facebook Post
    • Story
    • Cover Letter
    • Resume
    • Job Description
    • Recommendation Letter
    • Resignation Letter
    • Invitation Letter
    • Greeting Message
    • Try more templates
  1. Below is a simple Python program to create a Snake Game using the turtle module. This game is beginner-friendly and demonstrates basic game development concepts.

    import turtle
    import time
    import random

    # Screen setup
    screen = turtle.Screen()
    screen.title("Snake Game")
    screen.bgcolor("black")
    screen.setup(width=600, height=600)
    screen.tracer(0) # Turns off screen updates for smoother animation

    # Snake head
    head = turtle.Turtle()
    head.shape("square")
    head.color("green")
    head.penup()
    head.goto(0, 0)
    head.direction = "Stop"

    # Food
    food = turtle.Turtle()
    food.shape("circle")
    food.color("red")
    food.penup()
    food.goto(0, 100)

    # Snake body segments
    segments = []

    # Score variables
    score = 0
    high_score = 0

    # Display score
    pen = turtle.Turtle()
    pen.speed(0)
    pen.color("white")
    pen.penup()
    pen.hideturtle()
    pen.goto(0, 260)
    pen.write("Score: 0 High Score: 0", align="center", font=("Courier", 24, "normal"))

    # Functions to move the snake
    def move():
    if head.direction == "up":
    y = head.ycor()
    head.sety(y + 20)
    if head.direction == "down":
    y = head.ycor()
    head.sety(y - 20)
    if head.direction == "left":
    x = head.xcor()
    head.setx(x - 20)
    if head.direction == "right":
    x = head.xcor()
    head.setx(x + 20)

    def go_up():
    if head.direction != "down":
    head.direction = "up"

    def go_down():
    if head.direction != "up":
    head.direction = "down"

    def go_left():
    if head.direction != "right":
    head.direction = "left"

    def go_right():
    if head.direction != "left":
    head.direction = "right"

    # Keyboard bindings
    screen.listen()
    screen.onkey(go_up, "Up")
    screen.onkey(go_down, "Down")
    screen.onkey(go_left, "Left")
    screen.onkey(go_right, "Right")

    # Main game loop
    while True:
    screen.update()

    # Check for collision with borders
    if (head.xcor() > 290 or head.xcor() < -290 or
    head.ycor() > 290 or head.ycor() < -290):
    time.sleep(1)
    head.goto(0, 0)
    head.direction = "Stop"

    # Reset segments and score
    for segment in segments:
    segment.goto(1000, 1000)
    segments.clear()

    score = 0
    pen.clear()
    pen.write(f"Score: {score} High Score: {high_score}", align="center", font=("Courier", 24, "normal"))

    # Check for collision with food
    if head.distance(food) < 20:
    x = random.randint(-290, 290)
    y = random.randint(-290, 290)
    food.goto(x, y)

    # Add a new segment to the snake body
    new_segment = turtle.Turtle()
    new_segment.speed(0)
    new_segment.shape("square")
    new_segment.color("grey")
    new_segment.penup()
    segments.append(new_segment)

    # Update score
    score += 10
    if score > high_score:
    high_score = score

    pen.clear()
    pen.write(f"Score: {score} High Score: {high_score}", align="center", font=("Courier", 24, "normal"))

    # Move the end segments first in reverse order
    for index in range(len(segments) - 1, 0, -1):
    x = segments[index - 1].xcor()
    y = segments[index - 1].ycor()
    segments[index].goto(x, y)

    # Move segment at index 0 to where the head is
    if len(segments) > 0:
    x = head.xcor()
    y = head.ycor()
    segments[0].goto(x, y)

    move()

    # Check for collision with body segments
    for segment in segments:
    if segment.distance(head) < 20:
    time.sleep(1)
    head.goto(0, 0)
    head.direction = "Stop"

    # Reset segments and score
    for segment in segments:
    segment.goto(1000, 1000)
    segments.clear()

    score = 0
    pen.clear()
    pen.write(f"Score: {score} High Score: {high_score}", align="center", font=("Courier", 24, "normal"))

    time.sleep(0.1)

    turtle.done()
    Copied!
    Feedback
  2. Easy Games in Python - AskPython

    Most of us have heard about the famous pong game. Many of us love playing it. Today lets learn how to code this classic game using the python programming language! Bef…
    A Quiz Game in Python

    This is a very simple text-based game in python. It a small quiz which you can make for yourself as well or your friends. We do not need to import any modules for this game which makes it easier! Try it yourself 😉 Here are use: 1. if-else statement– For ch…

  3. 9 Easy Games to Make in Python (And Starter Code for Beginners) - iD …

    • See More

    We’ll explore some easy yet exciting games kids can create with Python. And while the end goal is something fun and cool, doing so helps practice fundamental programming concepts like loops, …

  4. Free Python Games — Free Python Games 2.5.3 …

    Free Python Games is an Apache2 licensed collection of free Python games intended for education and fun. The games are written in simple Python code …

  5. Pygame: A Primer on Game Programming in Python

    • See More

    Sep 16, 2019 · In this step-by-step tutorial, you'll learn how to use Pygame. This library allows you to create games and rich multimedia programs in Python. You'll learn how to draw items on your screen, …

  6. Python Games Collection - GitHub

    This project contains implementations of classic games in Python, using Pygame for an interactive and fun experience. Each game is contained within its own folder, complete with the main game code, unit …

  7. PyGame Tutorial - GeeksforGeeks

    Jul 23, 2025 · From classic games like Snake and Tic Tac Toe to cool effects like snowfall and color breezing, you’ll build real applications using Pygame. You’ll also explore how to visualize algorithms …

  8. Easy Games to Code in Python - CodeRivers

    Apr 22, 2025 · Whether you're a budding programmer looking to dip your toes into game development or an experienced coder seeking a quick and fun project, Python offers a plethora of easy-to-code games.

  9. Program Arcade Games With Python And Pygame

    Useful when creating games like tic-tac-toe, minesweeper, memory-match, connect-four, etc. Display one or more pages of instruction before the game starts. Plays background music. When the music is …

  10. Games with Python with complete source code

    Nov 19, 2025 · Collection of Different types of games built using python programming language. Here you will get various types of games with their explanation.

  11. Game Development Tutorials - The Python Code

    Discover how to craft a Pong game with Python and Pygame through a comprehensive tutorial, gaining hands-on game development skills. …