Skip to content

FrancoisSestier/CppND-Capstone-Shooter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CPPND: Capstone Shooter game

This is my sumbition for udacity capstone project in c++. it's a simple shooter game made with sdl. your goal is to have the highest score possible. my personal best is 62. each time you kill an ennemy. 2 ennemies will spawn

Controls

  • arrow keys to move and change shooting direction while moving.
  • hold space to charge your shot. release space to shoot.
  • press r to restart

image

Project structure

.
├── assets                # folder containing resources 
│   ├── fonts             # 
│   └── texture           #
├── cmake                 # build tools
└── src                   # src code
    ├── bot               # bot behaviour encapsulation
    ├── bullet            # bullet physics, rendering
    ├── camera            # camera following player
    ├── collidable        # interface ICollidable used for collision detection 
    ├── constants         # some game contants, folder and file path...
    ├── drawable          # interface IDrawable used for rendering
    ├── event_dispatcher  # 
    ├── font              # wrapper around SDL_font* + some utility method
    ├── game              # class containging all game simulation
    ├── input             # input key definitions
    ├── main              # creating game and running it
    ├── physics           # collision detection betweenn 2 ICollidable
    ├── player            # player behaviour
    ├── prop_generator    # procedural world generation (grass and dirt)
    ├── prop              # simple Drawanle wrapper around a texture 
    ├── renderer          # rendering functionalities 
    ├── spawner           # bot and bullet spawner using CTRP
    ├── spritesheet       # logic around spritesheets
    ├── targerable        # Itargetable interface used by camera and bots to track player
    ├── texture           # wrapper around SDL_Texture pointer
    ├── thread_pool       # pool of thread executing aynchronous tasks
    ├── time              # time functionalites 
    └── vec2              # vector with 2 components and some helper functionalites

Dependencies for Running Locally

Basic Build Instructions

  1. Clone this repo.
  2. Make a build directory in the top level directory: mkdir build && cd build
  3. Compile: cmake .. && make
  4. Run it: ./game.

Loops Function I/O

criteria status commentary
C++ functions and control structures. ✔️
The project reads data from a file and process the data, or the program writes data to a file. ✔️ loading textures and font and rendering it
The project accepts user input and processes the input. ✔️ user input is accesesd through sdl event system then dispatch then processed by player & game class through my own event system

Object Oriented Programming

criteria status
The project uses Object Oriented Programming techniques. ✔️
Classes use appropriate access specifiers for class members. ✔️
Class constructors utilize member initialization lists. ✔️
Classes abstract implementation details from their interfaces. ✔️
Classes encapsulate behavior. ✔️
Classes follow an appropriate inheritance hierarchy. & Derived class functions override virtual base class functions. ✔️
Overloaded functions allow the same function to operate on different parameters. ✔️
Templates generalize functions in the project. ✔️

Memory Management

criteria status
The project makes use of references in function declarations. ✔️
The project uses destructors appropriately. ✔️
The project uses scope / Resource Acquisition Is Initialization (RAII) where appropriate. ✔️
The project follows the Rule of 5. ✔️
The project uses move semantics to move data, instead of copying it, where possible. ✔️
The project uses smart pointers instead of raw pointers. ✔️

Concurrency

criteria status
The project uses multithreading. ✔️
A promise and future is used in the project. ✔️
A mutex or lock is used in the project. ✔️
A condition variable is used in the project. ✔️

multithreading is used for infinite procedural props generation. It's done asynchrounously when the camera reveal space where prop. A procedural world generation task is then pushed to the thread pool managing all thread synchronisation mechanism.

Assets

Free assets by penusbmic and ansimuz

CC Attribution-ShareAlike 4.0 International

Shield: CC BY-SA 4.0

The source code is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

CC BY-SA 4.0

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published