Skip to content

AKumarOfficial/Timberman_Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿช“ Timberman

A fast-paced tree-chopping arcade game built with C++17 and SFML 2.5.
Chop as many logs as you can before the timer runs out โ€” but watch out for branches!


๐ŸŽฎ Gameplay

Key Action
Enter Start / Restart game
โ† Left Arrow Chop left side
โ†’ Right Arrow Chop right side
Escape Quit
  • Each chop adds to your score and grants a small time bonus.
  • A branch on your side when you chop kills you instantly.
  • The time bar depletes continuously โ€” keep chopping!

๐Ÿ—‚๏ธ Project Structure

timberman/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ main.cpp        # Entry point
โ”‚   โ””โ”€โ”€ Game.cpp        # Core game logic
โ”œโ”€โ”€ include/
โ”‚   โ””โ”€โ”€ Game.hpp        # Game class declaration
โ”œโ”€โ”€ graphics/           # PNG assets (included)
โ”œโ”€โ”€ fonts/              # TTF fonts (included)
โ”œโ”€โ”€ sound/              # WAV sound effects (included)
โ”œโ”€โ”€ CMakeLists.txt      # CMake build script
โ””โ”€โ”€ README.md

๐Ÿ”ง Prerequisites

Dependency Version
C++ compiler (GCC / Clang / MSVC) C++17 or later
SFML 2.5.x
CMake 3.16+

๐Ÿš€ Build & Run

๐Ÿง Linux (Ubuntu / Debian)

1. Install dependencies

sudo apt install libsfml-dev cmake build-essential

2. Clone and build

git clone https://github.com/AKumarOfficial/timberman.git
cd timberman
cmake -S . -B build
cmake --build build

3. Run

./build/Timberman

๐ŸชŸ Windows (MinGW)

1. Install prerequisites

2. Clone the repository

git clone https://github.com/AKumarOfficial/timberman.git
cd timberman

3. Configure and build

cmake -S . -B build -G "MinGW Makefiles" -DSFML_DIR="C:/SFML-2.5.1/lib/cmake/SFML"
cmake --build build

Replace C:/SFML-2.5.1 with your actual SFML extraction path.

4. Copy SFML DLLs (required on Windows so the .exe can find them)

copy "C:\SFML-2.5.1\bin\*.dll" build\

5. Run

build\Timberman.exe

๐ŸชŸ Windows (Visual Studio)

1. Install prerequisites

  • Visual Studio 2019 or later with the "Desktop development with C++" workload
  • CMake โ†’ cmake.org/download
  • SFML 2.5.1 โ†’ sfml-dev.org/download.php (pick the "Visual C++ 15 (2017) 64-bit" build)
    Extract to e.g. C:\SFML-2.5.1

2. Clone the repository

git clone https://github.com/AKumarOfficial/timberman.git
cd timberman

3. Configure and build

cmake -S . -B build -DSFML_DIR="C:/SFML-2.5.1/lib/cmake/SFML"
cmake --build build --config Release

4. Copy SFML DLLs

copy "C:\SFML-2.5.1\bin\*.dll" build\Release\

5. Run

build\Release\Timberman.exe

๐ŸŽ macOS (Homebrew)

1. Install dependencies

brew install sfml cmake

2. Clone and build

git clone https://github.com/AKumarOfficial/timberman.git
cd timberman
cmake -S . -B build
cmake --build build

3. Run

./build/Timberman

๐Ÿ› ๏ธ Common Errors

Error Fix
SFML not found Set -DSFML_DIR to the correct path
Failed to load texture: graphics/... Make sure asset folders are inside the project root
.dll not found on Windows Copy all DLLs from SFML/bin/ next to the .exe
mingw32-make not found Add MinGW bin/ folder to your system PATH

๐Ÿ“ Assets

All assets are included in the repository โ€” no additional downloads needed.

graphics/
โ”œโ”€โ”€ background.png
โ”œโ”€โ”€ tree.png
โ”œโ”€โ”€ branch.png
โ”œโ”€โ”€ player.png
โ”œโ”€โ”€ axe.png
โ”œโ”€โ”€ log.png
โ”œโ”€โ”€ rip.png
โ”œโ”€โ”€ bee.png
โ”œโ”€โ”€ cloud.png
โ””โ”€โ”€ bird.png

fonts/
โ””โ”€โ”€ KOMIKAP_.ttf

sound/
โ”œโ”€โ”€ chop.wav
โ”œโ”€โ”€ death.wav
โ””โ”€โ”€ out_of_time.wav

๐Ÿ—๏ธ Architecture

The project is structured around a single Game class following the classic game loop pattern:

Game::run()
 โ”œโ”€โ”€ processEvents()   โ€” keyboard / window events
 โ”œโ”€โ”€ update(dt)        โ€” physics, AI, collision, timer
 โ””โ”€โ”€ render()          โ€” clear โ†’ draw โ†’ display

All state is encapsulated in Game; main.cpp is purely an entry point with error handling.


๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/awesome-thing)
  3. Commit your changes (git commit -m "Add awesome thing")
  4. Push to the branch (git push origin feature/awesome-thing)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License โ€” see LICENSE for details.

About

๐Ÿช“ A fast-paced 2D arcade game built with C++ and SFML. Play as a lumberjack chopping a tree dodge branches, race against the clock, and beat your high score!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors