WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

kingkururu/dodge_and_collect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dodge and Collect

A 2D dodge and collect game built with C++ and SFML, featuring dynamic sprite animations and simple gameplay mechanics.

GAME PLAY SCREENSHOTS

Gameplay Screenshot Gameplay Screenshot 2 Gameplay Screenshot 3

Objective

Collect as many coins as possible while avoiding falling rain and lightning bolts. You start with 5 hearts, and the challenge intensifies as the game progresses with decreasing spawn intervals!

How to Play

  • Movement: Use A key to move left, D key to move right
  • Goal: Collect coins (100 points each) while avoiding obstacles
  • Health System:
    • Start with 5 hearts
    • Rain hits: -1 heart
    • Lightning strikes: -3 hearts
  • Restart: Press B after game over to play again

Technical Features

  • Architecture: Object-oriented design with sprite animation system
  • Physics: Custom collision detection and entity management (AABB only)
  • Sprites: Animated character sprites with frame-based animation

Building & Running

Prerequisites

  • SFML 2.x library
  • C++ compiler (GCC/Clang)
  • Make

Installation

  1. Clone the repository:

    git clone https://github.com/kingkururu/dodge_and_collect
    cd dodge_and_collect (location will be different)
  2. Build the game:

    make
  3. Run the game:

    ./run

Alternative Setup (macOS with Homebrew)

  1. Install SFML:

    # Install Homebrew if not already installed
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
    # Install SFML
    brew install sfml@2
  2. Configure PATH (add to ~/.zshrc or ~/.bash_profile):

    export PATH="/opt/homebrew/bin:$PATH"
    export PATH="/opt/homebrew/opt/sfml@2/bin:$PATH"

Project Structure

dodge_and_collect_sfml_game/
├── assets/        # Game assets 
├── game/          # Core logics
├── main           # Entry point
├── .gitignore     
├── ReadMe         
└── Makefile       # Build configuration

Assets

Sprites

Sound Effects

Font

Key Learning Outcomes

  • Game development fundamentals with SFML
  • Object-oriented programming in C++
  • 2D graphics rendering and sprite management
  • Real-time input handling and game loops
  • Collision detection algorithms
  • Audio system integration
  • Sprite animation and frame management

About

Dodge and collect game built with SFML and C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published