Skip to content

PyxelCraft-2D

Game Overview

Mini 2D sandbox game built with Python and Pyxel.

The project demonstrates: - player movement - camera systems - simple AI - world rendering - tile maps - design patterns in game development


Features

  • 2D tile-based world
  • Grass, Stone, Water and Lava tiles
  • Player movement with camera follow
  • Cat AI that runs away from the player
  • Zombie AI that follows and attacks the player
  • HP and score system
  • Camera follow modes
  • Pyxel rendering system
  • Design Patterns:
  • Flyweight
  • Factory
  • Observer

Controls

Key Action
W A S D Move player
C Follow cat
R Follow player
ESC Exit game

Technologies

  • Python
  • Pyxel
  • OOP
  • Design Patterns

Installation

Install dependencies:

pip install -r requirements.txt

Run

python main.py

Project Structure

PyxelCraft-2D/
│
├── main.py
├── player.py
├── cat.py
├── zombie.py
├── world_map.py
├── renderer.py
├── camera.py
├── rules.py
│
├── patterns/
│   ├── flyweight.py
│   ├── factory.py
│   └── observer.py
│
├── assets/
│   └── truc.pyxres
│
├── requirements.txt
└── README.md

Design Patterns Used

Flyweight

Used to share tile and object data efficiently.

Factory

Used to create game objects cleanly.

Observer

Used for event and state updates between objects.


Goal

This project was created to practice:

  • game architecture
  • Python OOP
  • rendering systems
  • camera logic
  • simple AI behaviors
  • software design patterns

Requirements

pyxel

Result

A small but complete 2D sandbox-style game project using Python and Pyxel.

Liens


Auteur

Ahmad Abo-Alola — Student Project (AI Developer Training)