diff --git a/Animation.h b/Animation.h
index 2f91428..7afce77 100644
--- a/Animation.h
+++ b/Animation.h
@@ -26,23 +26,23 @@ class Animation
SDL_Rect& GetCurrentFrame()
{
current_frame += speed;
- if(current_frame >= last_frame)
- current_frame = 0;
+ if (current_frame >= last_frame)
+ {
+ current_frame = (loop) ? 0.0f : last_frame - 1;
+ loops++;
+ }
return frames[(int)current_frame];
}
- SDL_Rect& GetCurrentFrameNotCycling(int lastframe)
+ bool Finished() const
{
- if (current_frame < lastframe) {
- current_frame += speed;
- }
- return frames[(int)current_frame];
+ return loops > 0;
}
- void reset_currentFrame() {
+ void Reset()
+ {
current_frame = 0;
- frames[0];
}
bool islastframe() {
@@ -53,16 +53,6 @@ class Animation
return false;
}
}
-
- bool Finished() const
- {
- return loops > 0;
- }
-
-
-
-
-
};
#endif
\ No newline at end of file
diff --git a/Application.cpp b/Application.cpp
index 40dd168..00f8a33 100644
--- a/Application.cpp
+++ b/Application.cpp
@@ -21,14 +21,14 @@ Application::Application()
modules[2] = input = new ModuleInput();
modules[3] = textures = new ModuleTextures();
modules[4] = audio = new ModuleAudio();
- modules[12] = player = new ModulePlayer();
- modules[11] = particles = new ModuleParticles();
- modules[10] = enemy = new ModuleEnemy();
modules[8] = scene_MainMenu = new ModuleSceneMainMenu();
modules[9] = scene_choosePlayer = new ModuleSceneChoosePlayer();
modules[7] = scene_stage1 = new ModuleSceneStage1();
modules[6] = scene_stage2 = new ModuleSceneStage2();
modules[5] = scene_congrats = new ModuleSceneCongrats();
+ modules[12] = player = new ModulePlayer();
+ modules[11] = particles = new ModuleParticles();
+ modules[10] = enemy = new ModuleEnemy();
modules[13] = fade = new ModuleFadeToBlack();//Must be after all scenes
}
@@ -51,7 +51,6 @@ bool Application::Init()
player->Disable();
enemy->Disable();
- particles->Disable();
for(int i = 0; i < NUM_MODULES && ret == true; ++i)
diff --git a/Module.h b/Module.h
index bf335cf..bf1feea 100644
--- a/Module.h
+++ b/Module.h
@@ -1,8 +1,6 @@
#ifndef __MODULE_H__
#define __MODULE_H__
-#include "Globals.h"
-
class Module
{
private:
@@ -11,12 +9,12 @@ class Module
public:
virtual ~Module() {}
- virtual bool Init() { return true; }
- virtual bool Start() { return true; }
- virtual update_status PreUpdate() { return update_status::UPDATE_CONTINUE; }
- virtual update_status Update() { return update_status::UPDATE_CONTINUE; }
- virtual update_status PostUpdate() { return update_status::UPDATE_CONTINUE; }
- virtual bool CleanUp() { return true; }
+ virtual bool Init() { return true; }
+ virtual bool Start() { return true; }
+ virtual update_status PreUpdate() { return update_status::UPDATE_CONTINUE; }
+ virtual update_status Update() { return update_status::UPDATE_CONTINUE; }
+ virtual update_status PostUpdate() { return update_status::UPDATE_CONTINUE; }
+ virtual bool CleanUp() { return true; }
bool IsEnabled() const { return enabled; }
@@ -31,7 +29,6 @@ class Module
void Disable()
{
- // TODO 0: Call CleanUp() for disabling a module
if (enabled == true)
{
enabled = false;
diff --git a/ModuleInput.cpp b/ModuleInput.cpp
index 12c25d1..7be6c5e 100644
--- a/ModuleInput.cpp
+++ b/ModuleInput.cpp
@@ -32,18 +32,29 @@ update_status ModuleInput::PreUpdate()
{
SDL_PumpEvents();
- keyboard = SDL_GetKeyboardState(NULL);
+ const Uint8* keys = SDL_GetKeyboardState(NULL);
- if(keyboard[SDL_SCANCODE_ESCAPE])
- return update_status::UPDATE_STOP;
-
- while (SDL_PollEvent(&Events))
+ for (int i = 0; i < MAX_KEYS; ++i)
{
- if (Events.type == SDL_QUIT) {
- return update_status::UPDATE_STOP;
+ if (keys[i] == 1)
+ {
+ if (keyboard[i] == KEY_IDLE)
+ keyboard[i] = KEY_DOWN;
+ else
+ keyboard[i] = KEY_REPEAT;
+ }
+ else
+ {
+ if (keyboard[i] == KEY_REPEAT || keyboard[i] == KEY_DOWN)
+ keyboard[i] = KEY_UP;
+ else
+ keyboard[i] = KEY_IDLE;
}
}
+ if(keyboard[SDL_SCANCODE_ESCAPE])
+ return update_status::UPDATE_STOP;
+
return update_status::UPDATE_CONTINUE;
}
diff --git a/ModuleInput.h b/ModuleInput.h
index 7783c64..a900940 100644
--- a/ModuleInput.h
+++ b/ModuleInput.h
@@ -8,6 +8,16 @@
typedef unsigned char Uint8;
+#define MAX_KEYS 300
+
+enum KEY_STATE
+{
+ KEY_IDLE = 0,
+ KEY_DOWN,
+ KEY_REPEAT,
+ KEY_UP
+};
+
class ModuleInput : public Module
{
public:
@@ -20,8 +30,7 @@ class ModuleInput : public Module
bool CleanUp();
public:
- const Uint8 *keyboard = nullptr;
- SDL_Event Events;
+ KEY_STATE keyboard[MAX_KEYS];
};
#endif // __ModuleInput_H__
\ No newline at end of file
diff --git a/ModuleParticles.cpp b/ModuleParticles.cpp
index 965e409..c194e25 100644
--- a/ModuleParticles.cpp
+++ b/ModuleParticles.cpp
@@ -1,26 +1,19 @@
#include "Globals.h"
#include "Application.h"
#include "ModuleParticles.h"
-#include "ModuleEnemy.h"
-#include "ModulePlayer.h"
-#include "ModuleInput.h"
#include "ModuleAudio.h"
-#include "SDL/include/SDL.h"
#include "ModuleTextures.h"
#include "ModuleRender.h"
+#include "SDL/include/SDL.h"
+#include "SDL/include/SDL_timer.h"
+
ModuleParticles::ModuleParticles() : Module() {
for (uint i = 0; i < MAX_ACTIVE_PARTICLES; ++i)
active[i] = nullptr;
-
-
}
-// Destructor
-
-
-
ModuleParticles::~ModuleParticles() {}
// Called before render is available
@@ -28,131 +21,65 @@ bool ModuleParticles::Start()
{
bool ret = true;
-
LOG("Loading player textures");
-
shoot.common_fx = App->audio->LoadS("Assets/Audio Files/SFX in WAV/xmultipl-114.wav");
graphics = App->textures->Load("Assets/Player.png"); // arcade version
shoot.anim.PushBack({ 64, 30, 17, 18});
- shoot.anim.speed = 0.1f;
- return ret;
-}
+ shoot.anim.loop = false;
+ shoot.anim.speed = 3.0f;
-// Called every draw update
-update_status ModuleParticles::Update()
-{
-
-player = App->player;
-
-
-
-
-
- start_time = (Uint32 *)SDL_GetTicks();
-
- //Rectangle Movement
-
- if (App->input->keyboard[SDL_SCANCODE_SPACE] == 1) {
- if (start_time - shooting_delay > 250) {
- for (int i = 0; i < 10 && (start_time - shooting_delay > 250); ++i) {
- if (shoot.bullet == nullptr) {
- shooting_delay = start_time;
- shoot.bullet = new SDL_Rect{ player->position.x + 15, player->position.y };
- App->audio->PlaySound(shoot.common_fx);
- shoot.position.x = App->player->position.x;
- shoot.position.y = App->player->position.y;
- break;
- }
- }
- }
- }
- /*
- /*
- //Check Collisions
- for (int i = 0; i < 10; ++i) {
- for (int j = 0; j < 30; ++j) {
- if (bullets[i].bullet != nullptr && App->enemy->enemies[j].collision != nullptr) {
- if (checkCollision(bullets[i].bullet, App->enemy->enemies[j].collision)) {
- bullets[i].bullet = nullptr;
- App->enemy->enemies[j].collision = nullptr;
- break;
- }
- }
- }
- }
- */
- for (int i = 0; i < 10; ++i) {
- if (shoot.bullet != nullptr) {
- if (shoot.position.x > SCREEN_WIDTH) {
- shoot.bullet = nullptr;
- }
- else {
- shoot.position.x += 2;
- App->render->Blit(graphics, shoot.position.x, shoot.position.y - 15, shoot.bullet);
- }
- }
- }
- ;
- return update_status::UPDATE_CONTINUE;
+ return ret;
}
-// Called before quitting
+// Unload assets
bool ModuleParticles::CleanUp()
{
-
- for (int i = 0; i < 10; ++i) {
- shoot.bullet = nullptr;
- }
- player = nullptr;
-
+ LOG("Unloading particles");
App->textures->Unload(graphics);
App->audio->UnloadS(shoot.common_fx);
- return true;
-}
-bool ModuleParticles::checkCollision(SDL_Rect* bullet, SDL_Rect* enemy) {
- //The sides of the rectangles
- int leftA, leftB;
- int rightA, rightB;
- int topA, topB;
- int bottomA, bottomB;
-
- //Calculate the sides of rect A
- leftA = bullet->x;
- rightA = bullet->x + bullet->w;
- topA = bullet->y;
- bottomA = bullet->y + bullet->h;
-
- //Calculate the sides of rect B
- leftB = enemy->x;
- rightB = enemy->x + enemy->w;
- topB = enemy->y;
- bottomB = enemy->y + enemy->h;
-
- //If any of the sides from A are outside of B
- if (bottomA <= topB)
+ for (uint i = 0; i < MAX_ACTIVE_PARTICLES; ++i)
{
- return false;
+ if (active[i] != nullptr)
+ {
+ delete active[i];
+ active[i] = nullptr;
+ }
}
- if (topA >= bottomB)
- {
- return false;
- }
+ return true;
+}
- if (rightA <= leftB)
+// Update: draw background
+update_status ModuleParticles::Update()
+{
+ for (uint i = 0; i < MAX_ACTIVE_PARTICLES; ++i)
{
- return false;
- }
+ Particle* p = active[i];
- if (leftA >= rightB)
- {
- return false;
+ if (p == nullptr)
+ continue;
+
+ if (p->Update() == false)
+ {
+ delete p;
+ active[i] = nullptr;
+ }
+ else if (SDL_GetTicks() >= p->born)
+ {
+ App->render->Blit(graphics, p->position.x, p->position.y, &(p->anim.GetCurrentFrame()));
+ if (p->fx_played == false)
+ {
+ p->fx_played = true;
+ p->speed.x = 2;
+ App->audio->PlaySound(shoot.common_fx);
+ // Play particle fx here
+ }
+ }
}
- //If none of the sides from A are outside B
- return true;
+ return UPDATE_CONTINUE;
}
void ModuleParticles::AddParticle(const Particle& particle, int x, int y, Uint32 delay)
@@ -161,7 +88,7 @@ void ModuleParticles::AddParticle(const Particle& particle, int x, int y, Uint32
p->born = SDL_GetTicks() + delay;
p->position.x = x;
p->position.y = y;
-
+ p->life = 1000;
active[last_particle++] = p;
}
diff --git a/ModuleParticles.h b/ModuleParticles.h
index 1992d53..c3159d5 100644
--- a/ModuleParticles.h
+++ b/ModuleParticles.h
@@ -14,20 +14,21 @@ struct SDL_Rect;
struct SDL_Texture;
struct Mix_Chunk;
-typedef unsigned int Uint32;
-
struct Particle {
SDL_Rect* bullet;
- iPoint position;
+
Animation anim;
uint fx = 0;
+ iPoint position;
iPoint speed;
Uint32 born = 0;
Uint32 life = 0;
bool fx_played = false;
+
Particle();
Particle(const Particle& p);
bool Update();
+
Mix_Chunk* common_fx = nullptr;
};
@@ -42,19 +43,12 @@ class ModuleParticles : public Module
bool Start();
update_status Update();
bool CleanUp();
- bool checkCollision(SDL_Rect* bullet, SDL_Rect* enemy);
+
void AddParticle(const Particle& particle, int x, int y, Uint32 delay = 0);
public:
-
- ModulePlayer* player;
-
-
- Uint32* start_time = 0;
+ Uint32 * start_time = 0;
Uint32* shooting_delay;
-
-public:
-
Particle shoot;
private:
diff --git a/ModulePlayer.cpp b/ModulePlayer.cpp
index 53358f5..bf24f5c 100644
--- a/ModulePlayer.cpp
+++ b/ModulePlayer.cpp
@@ -4,6 +4,7 @@
#include "ModuleInput.h"
#include "ModuleRender.h"
#include "ModulePlayer.h"
+#include "ModuleParticles.h"
#include "SDL/include/SDL.h"
@@ -20,29 +21,36 @@ ModulePlayer::ModulePlayer()
// idle animation (arcade sprite sheet)
idle.PushBack({ 97, 0, 48, 16 });
+ idle.loop = true;
idle.speed = 0.1f;
forward.PushBack({ 97, 0, 48, 16 });
+ forward.loop = false;
forward.speed = 0.1f;
backward.PushBack({ 97, 0, 48, 16 });
+ backward.loop = false;
backward.speed = 0.1f;
upward.PushBack({ 49 , 0 , 48 , 16 });
upward.PushBack({ 0, 0, 48 , 16 });
+ upward.loop = false;
upward.speed = 0.075f;
upwardreturn.PushBack({ 49 , 0 , 48 , 16 });
upwardreturn.PushBack({ 97, 0, 48, 16 });
+ upwardreturn.loop = false;
upwardreturn.speed = 0.075f;
downward.PushBack({ 145, 0, 48, 16 });
downward.PushBack({ 193, 0, 48, 16 });
+ downward.loop = false;
downward.speed = 0.075f;
downwardreturn.PushBack({ 145, 0, 48, 16 });
downwardreturn.PushBack({ 97, 0, 48, 16 });
+ downwardreturn.loop = false;
downwardreturn.speed = 0.075f;
current_animation = &idle;
@@ -65,55 +73,52 @@ update_status ModulePlayer::Update()
{
int speed = 1;
//position.x += speed; //uncomment when camera moves
- if (App->input->keyboard[SDL_SCANCODE_D] == 1)
+ if (App->input->keyboard[SDL_SCANCODE_D] == KEY_STATE::KEY_REPEAT)
{
position.x += speed;
}
- if (App->input->keyboard[SDL_SCANCODE_A] == 1)
+ if (App->input->keyboard[SDL_SCANCODE_A] == KEY_STATE::KEY_REPEAT)
{
position.x -= speed;
}
- if (App->input->keyboard[SDL_SCANCODE_W] == 1)
+ if (App->input->keyboard[SDL_SCANCODE_W] == KEY_STATE::KEY_REPEAT)
{
position.y -= speed;
current_animation = &upward;
- r = current_animation->GetCurrentFrameNotCycling(1);
- upwardreturn.reset_currentFrame();
}
- else if (App->input->keyboard[SDL_SCANCODE_W] == 0) {
+ if (App->input->keyboard[SDL_SCANCODE_W] == KEY_STATE::KEY_UP) {
if (current_animation == &upward || current_animation == &upwardreturn) {
current_animation = &upwardreturn;
- r = current_animation->GetCurrentFrameNotCycling(2);
- upward.reset_currentFrame();
- if (current_animation->islastframe()) {
- current_animation = &idle;
- }
+ current_animation->Reset();
}
}
- if (App->input->keyboard[SDL_SCANCODE_S] == 1)
+ if (App->input->keyboard[SDL_SCANCODE_S] == KEY_STATE::KEY_REPEAT)
{
position.y += speed;
current_animation = &downward;
- r = current_animation->GetCurrentFrameNotCycling(1);
- downwardreturn.reset_currentFrame();
}
- else if (App->input->keyboard[SDL_SCANCODE_S] == 0) {
+ if (App->input->keyboard[SDL_SCANCODE_S] == KEY_STATE::KEY_UP) {
if (current_animation == &downward || current_animation == &downwardreturn) {
current_animation = &downwardreturn;
- r = current_animation->GetCurrentFrameNotCycling(2);
- downward.reset_currentFrame();
- if (current_animation->islastframe()) {
- current_animation = &idle;
- }
+ current_animation->Reset();
}
}
- if (current_animation == &idle) {
- r = current_animation->GetCurrentFrame();
+ if (App->input->keyboard[SDL_SCANCODE_SPACE] == KEY_STATE::KEY_DOWN) {
+ //if (start_time - SDL_GetTicks() > 250) {
+ //start_time = SDL_GetTicks();
+ App->particles->AddParticle(App->particles->shoot, position.x+40, position.y-18);
+ //}
}
+ if (App->input->keyboard[SDL_SCANCODE_S] == KEY_STATE::KEY_IDLE
+ && App->input->keyboard[SDL_SCANCODE_W] == KEY_STATE::KEY_IDLE && (downwardreturn.islastframe() && upwardreturn.islastframe()))
+ current_animation = &idle;
+
+ r = current_animation->GetCurrentFrame();
+
// Draw everything --------------------------------------
App->render->Blit(graphics, position.x, position.y - r.h, &r);
@@ -127,4 +132,100 @@ bool ModulePlayer::CleanUp()
position.x = 100;
position.y = 130;
return true;
-}
\ No newline at end of file
+}
+
+
+/*
+start_time = (Uint32 *)SDL_GetTicks();
+
+//Rectangle Movement
+
+if (App->input->keyboard[SDL_SCANCODE_SPACE] == 1) {
+if (start_time - shooting_delay > 250) {
+for (int i = 0; i < 10 && (start_time - shooting_delay > 250); ++i) {
+if (shoot.bullet == nullptr) {
+shooting_delay = start_time;
+shoot.bullet = new SDL_Rect{ player->position.x + 15, player->position.y, shoot.anim.h };
+App->audio->PlaySound(shoot.common_fx);
+shoot.position.x = App->player->position.x;
+shoot.position.y = App->player->position.y;
+break;
+}
+}
+}
+}
+//Check Collisions
+for (int i = 0; i < 10; ++i) {
+for (int j = 0; j < 30; ++j) {
+if (bullets[i].bullet != nullptr && App->enemy->enemies[j].collision != nullptr) {
+if (checkCollision(bullets[i].bullet, App->enemy->enemies[j].collision)) {
+bullets[i].bullet = nullptr;
+App->enemy->enemies[j].collision = nullptr;
+break;
+}
+}
+}
+}
+
+;
+return update_status::UPDATE_CONTINUE;
+}
+
+// Called before quitting
+bool ModuleParticles::CleanUp()
+{
+
+for (int i = 0; i < 10; ++i) {
+shoot.bullet = nullptr;
+}
+player = nullptr;
+
+App->textures->Unload(graphics);
+App->audio->UnloadS(shoot.common_fx);
+return true;
+}
+
+bool ModuleParticles::checkCollision(SDL_Rect* bullet, SDL_Rect* enemy) {
+//The sides of the rectangles
+int leftA, leftB;
+int rightA, rightB;
+int topA, topB;
+int bottomA, bottomB;
+
+//Calculate the sides of rect A
+leftA = bullet->x;
+rightA = bullet->x + bullet->w;
+topA = bullet->y;
+bottomA = bullet->y + bullet->h;
+
+//Calculate the sides of rect B
+leftB = enemy->x;
+rightB = enemy->x + enemy->w;
+topB = enemy->y;
+bottomB = enemy->y + enemy->h;
+
+//If any of the sides from A are outside of B
+if (bottomA <= topB)
+{
+return false;
+}
+
+if (topA >= bottomB)
+{
+return false;
+}
+
+if (rightA <= leftB)
+{
+return false;
+}
+
+if (leftA >= rightB)
+{
+return false;
+}
+
+//If none of the sides from A are outside B
+return true;
+}
+*/
\ No newline at end of file
diff --git a/ModulePlayer.h b/ModulePlayer.h
index dbb7f12..c6e1702 100644
--- a/ModulePlayer.h
+++ b/ModulePlayer.h
@@ -17,6 +17,7 @@ class ModulePlayer : public Module
bool Start();
update_status Update();
bool CleanUp();
+ //bool checkCollision(SDL_Rect* bullet, SDL_Rect* enemy);
public:
@@ -31,7 +32,7 @@ class ModulePlayer : public Module
Animation* current_animation;
SDL_Rect r;
iPoint position;
-
+ Uint32 start_time;
};
#endif
\ No newline at end of file
diff --git a/ModuleRender.cpp b/ModuleRender.cpp
index e25766c..287e690 100644
--- a/ModuleRender.cpp
+++ b/ModuleRender.cpp
@@ -53,16 +53,16 @@ update_status ModuleRender::Update()
{
int speed = 3;
- if (App->input->keyboard[SDL_SCANCODE_UP] == 1)
+ if (App->input->keyboard[SDL_SCANCODE_UP] == KEY_STATE::KEY_REPEAT)
camera.y += speed;
- if (App->input->keyboard[SDL_SCANCODE_DOWN] == 1)
+ if (App->input->keyboard[SDL_SCANCODE_DOWN] == KEY_STATE::KEY_REPEAT)
camera.y -= speed;
- if (App->input->keyboard[SDL_SCANCODE_LEFT] == 1)
+ if (App->input->keyboard[SDL_SCANCODE_LEFT] == KEY_STATE::KEY_REPEAT)
camera.x += speed;
- if (App->input->keyboard[SDL_SCANCODE_RIGHT] == 1)
+ if (App->input->keyboard[SDL_SCANCODE_RIGHT] == KEY_STATE::KEY_REPEAT)
camera.x -= speed;
/*
if(App->scene_stage1->IsEnabled() || App->scene_stage2->IsEnabled())
diff --git a/ModuleSceneKen.cpp b/ModuleSceneKen.cpp
deleted file mode 100644
index c2a5da5..0000000
--- a/ModuleSceneKen.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-#include "Globals.h"
-#include "Application.h"
-#include "ModuleTextures.h"
-#include "ModuleRender.h"
-#include "ModulePlayer.h"
-#include "ModuleInput.h"
-#include "ModuleFadeToBlack.h"
-#include "ModuleSceneMainMenu.h"
-#include "ModuleSceneKen.h"
-
-// Reference at https://www.youtube.com/watch?v=OEhmUuehGOA
-
-ModuleSceneKen::ModuleSceneKen()
-{
- // ground
- ground.x = 8;
- ground.y = 391;
- ground.w = 896;
- ground.h = 72;
-
- // foreground
- foreground.x = 8;
- foreground.y = 24;
- foreground.w = 521;
- foreground.h = 181;
-
- // Background / sky
- background.x = 72;
- background.y = 208;
- background.w = 768;
- background.h = 176;
-
- // flag animation
- flag.PushBack({848, 208, 40, 40});
- flag.PushBack({848, 256, 40, 40});
- flag.PushBack({848, 304, 40, 40});
- flag.speed = 0.08f;
-
- // Girl Animation
- girl.PushBack({624, 16, 32, 56});
- girl.PushBack({624, 80, 32, 56});
- girl.PushBack({624, 144, 32, 56});
- girl.speed = 0.05f;
-
- // for moving the foreground
- foreground_pos = 0;
- forward = true;
-}
-
-ModuleSceneKen::~ModuleSceneKen()
-{}
-
-// Load assets
-bool ModuleSceneKen::Start()
-{
- LOG("Loading ken scene");
-
- graphics = App->textures->Load("ken_stage.png");
-
- // TODO 1: Enable (and properly disable) the player module
-
- App->player->Enable();
-
- return true;
-}
-
-// UnLoad assets
-bool ModuleSceneKen::CleanUp()
-{
- LOG("Unloading ken scene");
- App->textures->Unload(graphics);
- App->player->Disable();
- return true;
-}
-
-// Update: draw background
-update_status ModuleSceneKen::Update()
-{
- // Calculate boat Y position -----------------------------
- if(foreground_pos < -6.0f)
- forward = false;
- else if(foreground_pos > 0.0f)
- forward = true;
-
- if(forward)
- foreground_pos -= 0.02f;
- else
- foreground_pos += 0.02f;
-
- // Draw everything --------------------------------------
- App->render->Blit(graphics, 0, 0, &background, 0.75f); // sea and sky
- App->render->Blit(graphics, 560, 8, &(flag.GetCurrentFrame()), 0.75f); // flag animation
-
- App->render->Blit(graphics, 0, (int)foreground_pos, &foreground, 0.92f);
- App->render->Blit(graphics, 192, 104 + (int)foreground_pos, &(girl.GetCurrentFrame()), 0.92f); // girl animation
-
- App->render->Blit(graphics, 0, 170, &ground);
-
- // TODO 2: make so pressing SPACE the MainMenu stage is loaded
- if (App->input->keyboard[SDL_SCANCODE_SPACE] == 1)
- {
- //App->fade->FadeToBlack(App->scene_ken, App->scene_MainMenu, 1);
- }
- return UPDATE_CONTINUE;
-}
\ No newline at end of file
diff --git a/ModuleSceneKen.h b/ModuleSceneKen.h
deleted file mode 100644
index cfe5568..0000000
--- a/ModuleSceneKen.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef __MODULESCENEKEN_H__
-#define __MODULESCENEKEN_H__
-
-#include "Module.h"
-#include "Animation.h"
-#include "Globals.h"
-
-struct SDL_Texture;
-
-class ModuleSceneKen : public Module
-{
-public:
- ModuleSceneKen();
- ~ModuleSceneKen();
-
- bool Start();
- update_status Update();
- bool CleanUp();
-
-public:
-
- SDL_Texture* graphics = nullptr;
- SDL_Rect ground;
- SDL_Rect foreground;
- SDL_Rect background;
- Animation flag;
- Animation girl;
-
- float foreground_pos;
- bool forward;
-};
-
-#endif // __MODULESCENEKEN_H__
\ No newline at end of file
diff --git a/ModuleSceneStage1.cpp b/ModuleSceneStage1.cpp
index eb120be..03f6f90 100644
--- a/ModuleSceneStage1.cpp
+++ b/ModuleSceneStage1.cpp
@@ -38,14 +38,11 @@ bool ModuleSceneStage1::Start()
App->player->Enable();
- App->enemy->Enable();
-
- App->particles->Enable();
-
+ //App->enemy->Enable();
+
graphics = App->textures->Load("Assets/TileMap1.png");
back = App->textures->Load("Assets/FirstLvlMap3.png");
-
return ret;
}
@@ -58,8 +55,7 @@ bool ModuleSceneStage1::CleanUp()
App->textures->Unload(graphics);
App->textures->Unload(back);
App->player->Disable();
- App->enemy->Disable();
- App->particles->Disable();
+ //App->enemy->Disable();
App->render->camera.x = App->render->camera.y = 0;
return ret;
diff --git a/ModuleSceneStage2.cpp b/ModuleSceneStage2.cpp
index 02d93ae..c3110ec 100644
--- a/ModuleSceneStage2.cpp
+++ b/ModuleSceneStage2.cpp
@@ -41,9 +41,7 @@ bool ModuleSceneStage2::Start()
App->player->Enable();
- App->particles->Enable();
-
- App->enemy->Enable();
+ //App->enemy->Enable();
return ret;
}
@@ -59,9 +57,7 @@ bool ModuleSceneStage2::CleanUp()
App->player->Disable();
- App->enemy->Disable();
-
- App->particles->Disable();
+ //App->enemy->Disable();
return ret;
diff --git a/XMultiply.vcxproj b/XMultiply.vcxproj
index 6ca236a..f87fa99 100644
--- a/XMultiply.vcxproj
+++ b/XMultiply.vcxproj
@@ -86,7 +86,6 @@
-
@@ -107,7 +106,6 @@
-
diff --git a/XMultiply.vcxproj.filters b/XMultiply.vcxproj.filters
index 627fcac..8f0d5ff 100644
--- a/XMultiply.vcxproj.filters
+++ b/XMultiply.vcxproj.filters
@@ -43,9 +43,6 @@
Modules\Scenes
-
- Modules\Scenes
-
Modules\Scenes
@@ -108,9 +105,6 @@
Modules\Scenes
-
- Modules\Scenes
-
Modules\Scenes