Skip to content

The repository for the final project of my CS-1004 Object Oriented Programming course, a street-fighter 2d clone made with raylib in cpp

License

Notifications You must be signed in to change notification settings

Draco1js/OOP-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OOP Project: 2D Fighting Game with Raylib

This is the repository for the final project of my CS-1004 Object Oriented Programming course, a street-fighter 2d clone made with raylib in cpp. This project was completed and presented on the 13th of May 2025.

Personal Objectives Set

  • Implement a 2D arcade fighter using Raylib.
  • Demonstrate OOP concepts by creating reusable Player, Loader and Game classes.
  • Achieve cross-platform compatibility (Windows, Linux, macOS).
  • Set up CI/CD for automated builds and releases.

Group Members and Work Division

  • Aayan Sultan (24K-2015)
    • Setup player mechanics
    • Setup hitboxes
    • Setup Physics
    • Setup Fighting mechanics
    • CI/CD pipeline
  • Zumair Shamsi (24K-2040)
    • Game Loop
    • Game Scenes
    • Window Creation
    • Main class architecture
  • Devish Kumar (24K-2022)
    • Setup movement controls
    • Setup Fonts and Menus
    • VSCode configurations

Media

  • The main menu

    • Game Menu
  • Start Timer

    • Starting timer
  • Main level/arena

    • Level
  • Debug mode

    • Debug Menu
  • Demo Clip

Recording.mov

UML Diagram:

classDiagram
    direction LR

    Main --> Game : creates
    Game *-- Player : contains 2
    Game --> GameState : uses
    Player --> State : has

    class Main {
        +int main()
    }

    class Game {
        -GameState currentState
        -bool exitGame
        -Player player1, player2
        -int winner
        -float gameOverDelay
        -const float GAME_OVER_DELAY
        -Rectangle playButton, exitButton
        -int selectedButton
        -Texture2D backgroundTexture
        -Rectangle player1HealthBar, player2HealthBar

        +Game()
        +~Game()
        +void Update()
        +void Draw()
        +bool IsExitGame()
        +GameState GetCurrentState()
        +void SetCurrentState(GameState)
        -void UpdateMenu()
        -void UpdateGameplay()
        -void UpdateGameOver()
        -void DrawMenu()
        -void DrawGameplay()
        -void DrawGameOver()
        -void CheckAttackCollisions()
        -void ResetGameplay()
        -void DrawHealthBars()
    }

    class GameState {
        <<enumeration>>
        MENU
        GAMEPLAY
        GAMEOVER
    }

    class Player {
        -Rectangle rect
        -Color color
        -float speed
        -int health
        -bool isBlocking, isCrouching
        -bool isAttacking, isFacingRight
        -Rectangle attackHitbox
        -int attackCooldown, attackDuration
        -int attackTimer, playerNumber
        -State currentState
        -float specialMeter
        -std::string characterName

        +Player(float x, float y, bool isPlayer1)
        +void Update()
        +void Draw()
        +void Move(float direction)
        +void Jump(), Duck(bool), Block()
        +void Punch(), Kick(), SpecialAttack()
        +Rectangle GetRect() const
        +Rectangle GetAttackHitbox() const
        +int GetHealth() const
        +float GetWidth() const
        +bool IsAttacking(), IsBlocking()
        +bool IsFacingRight() const
        +State GetCurrentState() const
        +void TakeDamage(int, bool attackFromRight)
        +void SetCharacter(const std::string&)
        +std::string GetCharacterName() const
        +std::string GetAnimationKey() const
        -void HandleInput()
        -void UpdateAttack()
        -void UpdatePosition()
    }

    class State {
        <<enumeration>>
        IDLE
        WALKING
        JUMPING
        DUCKING
        BLOCKING
        PUNCHING
        KICKING
        SPECIAL_ATTACK
        HURT
    }

    class Main {
        +int main()
    }

    Game --> GameState
    Game *-- "2" Player : contains
    Game ..> Rectangle : uses
    Player --> State
    Main ..> Game : creates
Loading

About

The repository for the final project of my CS-1004 Object Oriented Programming course, a street-fighter 2d clone made with raylib in cpp

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages