Sokoban

Sokoban is a classic puzzle game developed with Godot 4.4, featuring multiple levels of increasing difficulty for players to push boxes onto target spaces. It includes high score tracking, dynamic level layouts defined in JSON, and various GDScript components for game management, level design, and user experience enhancement.

Developed using Godot 4.4

Overview

Sokoban is a classic puzzle game where the player pushes boxes onto designated target spaces within a bounded area. The goal is to move all the boxes to their target locations while minimizing the number of moves. The project implements key gameplay mechanics, level design, and score management tailored for an engaging user experience.

Features

  • Multiple Levels: The game includes various levels with increasing difficulty, each designed with specific layouts of floors, walls, boxes, and targets.
  • High Score Tracking: Players can save their scores and track their progress across different levels.
  • Dynamic Level Layouts: Each level’s configuration, including the placements of walls, boxes, targets, and the starting position of the player, is defined via a JSON file, allowing for easy updates and new level designs without modifying the codebase.

Technical Details

The Sokoban game is developed using the Godot Engine, leveraging GDScript for scripting various game components. Key scripts include:

  • HighScoresResource.gd: Manages player score data, saving and retrieving the best scores for levels. It employs a dictionary structure to hold scores against level names, ensuring that players can see their best achievements.

  • LevelLayout.gd: Defines the layout of each level, handles the placement of tiles for various layer types such as floors, walls, and boxes. It utilizes vector mathematics to manage positions on the grid.

  • TileLayers.gd: Represents different layers of tiles, enabling organized management of various elements in the game environment. This includes categorization into floors, walls, boxes, and target boxes.

  • GameManager.gd: Orchestrates game flow, including scene transitions between the main menu and individual levels, and manages the loading of high score data.

  • LevelData.gd: Responsible for loading and interpreting level data from a JSON file, converting it into usable game layouts.

Skills

  • Game Design Principles: Understanding of how to design levels that provide both challenge and enjoyment.

  • Data Management: Utilizing dictionaries and JSON parsing for managing game state and level design.

  • Object-oriented Programming: Use of classes and GDScript extends to represent game objects logically, encapsulating behavior and data.

  • Game State Management: Handling transitions between menus and gameplay, including managing inputs and responses.

  • Debugging and Problem Solving: Implementing features to track high scores required algorithmic thinking to ensure accuracy and efficiency.

  • User Interface Interaction: Designing user interactions, such as scene transitions and input handling, that facilitate a seamless player experience.