Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
dc37073
Added SFML to the project
Divyansh2045 Jun 17, 2024
3993f7a
Created a window with different parameters
Divyansh2045 Jun 18, 2024
69f50f1
Added blue screen
Divyansh2045 Jun 18, 2024
1ec8239
Added a circle on the game screen
Divyansh2045 Jun 19, 2024
2af19e4
added shapes to the project
Divyansh2045 Jun 19, 2024
e6b8ad7
Added the outscal sprite and a text on the window
Divyansh2045 Jun 19, 2024
8408e69
Merge pull request #1 from Divyansh2045/Feature-1-SFML-Setup
Divyansh2045 Jun 19, 2024
954ac82
Created Player class and added playerclass properties
Divyansh2045 Jun 19, 2024
bd7e9ad
added player movement and player sprite
Divyansh2045 Jun 20, 2024
6142b1a
used player.() inside main for proper code
Divyansh2045 Jun 20, 2024
ce6feb6
Added movement to the player sprite
Divyansh2045 Jun 20, 2024
effb2a5
Introduced the gameservice class and headerfile
Divyansh2045 Jun 21, 2024
add35ca
created an entry point for the game
Divyansh2045 Jun 21, 2024
f5bac5f
Servicelocator header file and source file made and code body made
Divyansh2045 Jun 21, 2024
13fc084
Merge branch 'Feature-2-OQP'
Divyansh2045 Jun 21, 2024
07a878e
merged main and some unsaved changes commit
Divyansh2045 Jun 24, 2024
6f441c7
created graphic service and game service
Divyansh2045 Jul 3, 2024
e82a549
Update main.cpp
Divyansh2045 Jul 3, 2024
e5a9fea
Added event service and updated main
Divyansh2045 Jul 4, 2024
0368a07
Merge branch 'main' into Feature-2-OQP
Divyansh2045 Jul 4, 2024
f48410d
Merge pull request #5 from Divyansh2045/Feature-2-OQP
Divyansh2045 Jul 4, 2024
d67a4a3
Revert "Merge branch 'main' into Feature-2-OQP"
Divyansh2045 Jul 10, 2024
91cf76c
Checked if all code were there to proceed further post reverting a co…
Divyansh2045 Jul 10, 2024
ee77b76
Merge pull request #6 from Divyansh2045/Feature-2-OQP
Divyansh2045 Jul 10, 2024
1548044
added code for player.h file
Divyansh2045 Jul 10, 2024
588d6b8
Implemented playerservice and linked it with servicelocator
Divyansh2045 Jul 11, 2024
3fcd1c2
Created TimeService and linked it with service locator
Divyansh2045 Jul 11, 2024
a3a8e80
Added delta time
Divyansh2045 Jul 11, 2024
d43a608
Changed gamewindow to gameWindow in some code
Divyansh2045 Jul 12, 2024
360fece
Merge pull request #7 from Divyansh2045/Feature3Player
Divyansh2045 Jul 12, 2024
f83491b
updated Timeservice .h and .cpp
Divyansh2045 Jul 12, 2024
1f3fbc5
coded for playermodel .h and ,cpp file
Divyansh2045 Jul 12, 2024
12eff23
Used enum for creating different player states
Divyansh2045 Jul 12, 2024
3a9e0df
created enum class to store different playerstates updated
Divyansh2045 Jul 12, 2024
2534241
Merge pull request #8 from Divyansh2045/Feature3Player
Divyansh2045 Jul 12, 2024
583515e
Coded for player model and view
Divyansh2045 Jul 15, 2024
662aa09
Completed the MVC architecture, linked controller to player servivce
Divyansh2045 Jul 17, 2024
27e68d3
Fixed all the errors and used forward declarations
Divyansh2045 Jul 17, 2024
95e058a
Created specific folders for each code bases
Divyansh2045 Jul 17, 2024
a9464cb
Merge pull request #9 from Divyansh2045/Feature3Player
Divyansh2045 Jul 17, 2024
4dc2dae
fixing includes
Divyansh2045 Jul 17, 2024
63203e2
Player movement now works
Divyansh2045 Jul 17, 2024
6219d15
Player moves and deleted cout states
Divyansh2045 Jul 17, 2024
8b1b5fe
Use Forward declarations and folder structure
Divyansh2045 Jul 18, 2024
a7fdd90
Created namespaces and committed to share errors
Divyansh2045 Jul 19, 2024
6e960fd
Solved namespace errors
Divyansh2045 Jul 20, 2024
b27594b
Merge pull request #10 from Divyansh2045/Feature3Player
Divyansh2045 Jul 20, 2024
61fc941
created gameState enum
Divyansh2045 Jul 20, 2024
2413e58
created UI service.h amd ,cpp
Divyansh2045 Jul 21, 2024
cc15332
Merge pull request #11 from Divyansh2045/Feature-4-Main-Menu
Divyansh2045 Jul 21, 2024
3ed1c3d
implemented mainMenuScreen
Divyansh2045 Jul 21, 2024
0ffa040
Mouse input from Player
Divyansh2045 Jul 21, 2024
5bc0f79
Merge pull request #12 from Divyansh2045/Feature-4-Main-Menu
Divyansh2045 Jul 21, 2024
43c340e
Now the mainScreen stops rendering when pressed the playButton. Playe…
Divyansh2045 Jul 22, 2024
b83e6b9
Merge pull request #13 from Divyansh2045/Feature-4-Main-Menu
Divyansh2045 Jul 22, 2024
acb9580
created enemy MVC.
Divyansh2045 Jul 23, 2024
0acf8e1
Enemy moves right down and left.
Divyansh2045 Jul 24, 2024
28db7d8
Merge pull request #14 from Divyansh2045/Feature-5-Enemies
Divyansh2045 Jul 24, 2024
ce545e1
multiple enemies now spawn in game
Divyansh2045 Jul 24, 2024
c5ccdbf
Merge pull request #15 from Divyansh2045/Feature-5-Enemies
Divyansh2045 Jul 24, 2024
d879ac8
Set up GameplayService and now the game has a bg
Divyansh2045 Jul 24, 2024
ae4f5e4
removed some extra code that wasnt needed
Divyansh2045 Jul 25, 2024
1c36732
Merge pull request #16 from Divyansh2045/Feature-5-Enemies
Divyansh2045 Jul 25, 2024
91fbc3b
created enemy folders
Divyansh2045 Jul 27, 2024
2a6b8c4
Implemented updated ENEMY MODEL AND IT WORKS
Divyansh2045 Jul 27, 2024
e4d5cfa
created .h and .cpp files for zapper and subzero
Divyansh2045 Jul 28, 2024
f227a31
EnemyMovement for Zapper and Subzero, updated enemyservice and contro…
Divyansh2045 Aug 4, 2024
e562419
fixed zapper movement
Divyansh2045 Aug 4, 2024
ced087e
Enemy 1 and 2 are done. tried enemy 3 still working
Divyansh2045 Aug 6, 2024
a0b1b41
thundersnake now works 90% the way I want it too
Divyansh2045 Aug 6, 2024
a5f67b9
Merge pull request #17 from Divyansh2045/Feature-5-Enemies
Divyansh2045 Aug 6, 2024
0c7c563
created element and bunker MVC
Divyansh2045 Aug 6, 2024
1f63c5f
Creating the bunker and MVC
Divyansh2045 Aug 7, 2024
9fe365c
Merge pull request #18 from Divyansh2045/Feature-6-Barriers-and-Sounds
Divyansh2045 Aug 7, 2024
047c6f9
Barriers or Bunkers implemented
Divyansh2045 Aug 7, 2024
30152d2
created path variables for all textures used in the game
Divyansh2045 Aug 7, 2024
d5ed423
created soundService
Divyansh2045 Aug 7, 2024
e24a709
Sound works
Divyansh2045 Aug 9, 2024
9159246
button sound and bg sound works
Divyansh2045 Aug 9, 2024
50713b2
Merge pull request #19 from Divyansh2045/Feature-6-Barriers-and-Sounds
Divyansh2045 Aug 9, 2024
58dbfab
added iprojectile files and bullet files
Divyansh2045 Aug 9, 2024
fef591d
Created blueprint for bullet and created MVC for bullet
Divyansh2045 Aug 10, 2024
7296237
created theMVC for bullet
Divyansh2045 Aug 10, 2024
b4c6d65
Update BulletView.cpp
Divyansh2045 Aug 10, 2024
ebe77aa
bullets controllers done
Divyansh2045 Aug 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Space-Invaders/HeaderFiles/Bullet/BulletConfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#pragma once

namespace Bullet
{

enum class MovementDirection
{
UP,
DOWN
};

enum class BulletType
{
LASERBULLET,
FROSTBULLET,
TORPEDO
};
}
42 changes: 42 additions & 0 deletions Space-Invaders/HeaderFiles/Bullet/BulletController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#pragma once

#include "../../HeaderFiles/Bullet/BulletConfig.h"
#include "../../HeaderFiles/Projectiles/IProjectile.h"

namespace Bullet
{

enum class BulletType;
class BulletModel;
class BulletView;

class BulletController : public Projectile::IProjectile
{
protected:

BulletModel* bulletModel;
BulletView * bulletView;

void updateProjectilePosition() override;

void moveUp();
void moveDown();

void handleOutOfBounds();

public:

BulletController(BulletType type);
virtual ~BulletController() override;

void initialize(sf::Vector2f position, Bullet::MovementDirection direction) override;
void update() override;
void render() override ;

sf::Vector2f getProjectilePosition();
BulletType getBulletType();



};
}
40 changes: 40 additions & 0 deletions Space-Invaders/HeaderFiles/Bullet/BulletModel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#pragma once
#include <SFML/Graphics.hpp>

namespace Bullet
{

enum class BulletType;
enum class MovementDirection;

class BulletModel
{
private:

float movementSpeed = 300.0f;
sf::Vector2f bulletPosition;

BulletType bulletType;
MovementDirection movementDirection;

public:

BulletModel(BulletType type);
~BulletModel();

void initialize(sf::Vector2f position, MovementDirection direction);
void update();
void destroy();
void render();


MovementDirection getMovementDirection();
void setMovementDirection(MovementDirection direction);

BulletType getBulletType();
void setBulletType(BulletType type);

float getMovementSpeed();
void setMovementSpeed(float speed);
};
}
11 changes: 11 additions & 0 deletions Space-Invaders/HeaderFiles/Bullet/BulletService.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#pragma once

class BulletService
{
private:

void initialize();
void update();
void render();
void destroy();
};
45 changes: 45 additions & 0 deletions Space-Invaders/HeaderFiles/Bullet/BulletView.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#pragma once
#include <SFML/Graphics.hpp>



namespace Bullet
{
enum class BulletType;
class BulletController;

class BulletView
{

private:

sf::Sprite bulletSprite;
sf::Texture bulletTexture;

sf::RenderWindow* window;

const float bulletSpriteHeight = 18.0f;
const float bulletSpriteWidth = 18.0f;

BulletController* bulletController;

void initializeBulletSprite(BulletType type);
void scaleBulletSprite();

public:

BulletView();
~BulletView();

void initialize(BulletController* controller);

void update();

void render();





};
}
23 changes: 23 additions & 0 deletions Space-Invaders/HeaderFiles/Bullet/Controllers/FrostBullet.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#pragma once
#include "../../HeaderFiles/Bullet/BulletController.h"

namespace Bullet
{
namespace BulletControllers
{
class FrostBullet : public BulletController
{
private:

const float frostbulletMovementSpeed = 500.0f;

public:

FrostBullet(BulletType type);

~FrostBullet();

void initialize(sf::Vector2f position, MovementDirection direction);
};
}
}
24 changes: 24 additions & 0 deletions Space-Invaders/HeaderFiles/Bullet/Controllers/LaserBullet.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#pragma once
#include <SFML/Graphics.hpp>
#include "../../HeaderFiles/Bullet/BulletController.h"

namespace Bullet
{
namespace BulletControllers
{

class LaserBullet: public BulletController
{
private:


public:

LaserBullet(BulletType type);
~LaserBullet();

void initialize(sf::Vector2f position, MovementDirection direction) override;

};
}
}
22 changes: 22 additions & 0 deletions Space-Invaders/HeaderFiles/Bullet/Controllers/TorpedoController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#pragma once
#include "../../HeaderFiles/Bullet/BulletController.h"

namespace Bullet
{
namespace BulletControllers
{
class Torpedo : public BulletController
{
private:

const float torpedoMovementSpeed = 200.0f;

public:

void initialize(sf::Vector2f position, MovementDirection direction) override;

Torpedo(BulletType type);
~Torpedo();
};
}
}
34 changes: 34 additions & 0 deletions Space-Invaders/HeaderFiles/Element/Bunker/BunkerController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#pragma once
#include <SFML/Graphics.hpp>
#include "../../HeaderFiles/Element/Bunker/BunkerModel.h"

namespace Element
{

namespace Bunker
{
class BunkerView;

class BunkerController

{
private:

BunkerData bunkerData;
BunkerView* bunkerView;

public:

BunkerController();
~BunkerController();

void update();
void initialize(BunkerData data);
void render();

sf::Vector2f getBunkerPosition();


};
}
}
21 changes: 21 additions & 0 deletions Space-Invaders/HeaderFiles/Element/Bunker/BunkerModel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#pragma once
#include <SFML/Graphics.hpp>

namespace Element
{
namespace Bunker
{




struct BunkerData
{

sf::Vector2f position;
BunkerData(sf::Vector2f position);
BunkerData();
};
}
}

42 changes: 42 additions & 0 deletions Space-Invaders/HeaderFiles/Element/Bunker/BunkerView.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#pragma once
#include <SFML/Graphics.hpp>
#include "../../HeaderFiles/Element/Bunker/BunkerModel.h"


namespace Element
{

namespace Bunker
{
class BunkerController;

class BunkerView
{
private:

const float bunkerSpriteWidth = 80.0f;
const float bunkerSpriteHeight = 80.0f;

const sf::String bunker_texture_path = "assets/textures/bunker.png";

BunkerController* bunkerController;
sf::RenderWindow *gameWindow;

void initializeBunkerSprite();
void scaleBunkerSprite();

sf::Sprite bunkerSprite;
sf::Texture bunkerTexture;


public:
BunkerView();
~BunkerView();

void initialize(BunkerController * controller);
void update();
void render();
};
}
}

32 changes: 32 additions & 0 deletions Space-Invaders/HeaderFiles/Element/ElementService.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#pragma once
#include <vector>
#include <SFML/System/Vector2.hpp>
#include "../../HeaderFiles/Element/Bunker/BunkerController.h"
#include"../../HeaderFiles/Element/Bunker/BunkerModel.h"
namespace Element
{
class ElementService
{
private:

const std::vector<Bunker::BunkerData> bunkerDataList = {
Bunker::BunkerData(sf::Vector2f(130.0f,800.0f)),
Bunker::BunkerData(sf::Vector2f(430.0f,800.0f)),
Bunker::BunkerData(sf::Vector2f(730.0f, 800.f)),
Bunker::BunkerData(sf::Vector2f(1130.0f, 800.f)),
Bunker::BunkerData(sf::Vector2f(1430.0f, 800.f)),
Bunker::BunkerData(sf::Vector2f(1730.0f, 800.f)) };

std::vector<Bunker::BunkerController*> bunkerList;

void destroy();

public:
ElementService();
~ElementService();
void initialize();
void update();
void render();

};
}
28 changes: 28 additions & 0 deletions Space-Invaders/HeaderFiles/Enemy/Controllers/EnemyConfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#pragma once

namespace Enemy
{
enum class EnemyState
{
ALIVE,
DEAD,
PATROLLING
};

enum class EnemyType
{
ZAPPER,
SUBZERO,
//UFO,
THUNDERSNAKE
};

enum class MovementDirection
{
DOWN,
UP,
RIGHT,
LEFT
};

}
Loading