You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Matteo Benedetto d277baf9cb Add isometric game code 2 years ago
Effects nice 2 years ago
KnightBasic nice 2 years ago
Tiles/Base nice 2 years ago
Units nice 2 years ago
__pycache__ nice 2 years ago
kenney_tower-defense nice 2 years ago
.gitignore nice 2 years ago
Knight_Die_dir1.png nice 2 years ago
README.md Add isometric game code 2 years ago
arial.ttf nice 2 years ago
engine.py nice 2 years ago
exa.py nice 2 years ago
grass.png nice 2 years ago
hand.png nice 2 years ago
maze.json nice 2 years ago
maze.py nice 2 years ago
pygamez.py nice 2 years ago
sdl.py nice 2 years ago
solver.py nice 2 years ago
water.png nice 2 years ago

README.md

Isometric Game

This repository contains the code for an isometric game built using Python and the Tkinter library.

Description

The game includes a Knight class to represent a movable character and a Cell class to represent each tile in the game. The game map is represented using a 2D array of Cell objects, which can be either walkable or not.

The IsometricGame class handles the game logic and user interactions such as keyboard presses and mouse clicks.

Usage

To start the game, run the main.py file:

python3 main.py

Features

  • Isometric view: The game uses an isometric perspective, giving it a pseudo-3D look.
  • Keyboard controls: The view can be moved around using the arrow keys.
  • Mouse controls: Cells can be selected by left-clicking on them. Right-clicking on a cell will move the knight to that cell if it is walkable.
  • Editor mode: Pressing the 'Tab' key toggles editor mode, where additional information about each cell is displayed and cells can be edited.
  • Animations: The knight has walking and idle animations which change depending on the direction he is moving in.

File Structure

  • main.py: This is the main script that runs the game.
  • knight.py: Contains the Knight class, which represents the player-controlled character.
  • maze.json: A JSON file representing the initial state of the game map.
  • Tiles/: This directory contains PNG images used as tiles for the game map.
  • KnightBasic/: This directory contains GIF images used for the knight's animations.
  • Units/: This directory contains the units used in the game.
  • Effects/: This directory contains different effects used in the game.

Dependencies

  • Python 3
  • Tkinter
  • glob
  • os
  • json
  • time

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.