Compare commits
No commits in common. "aa5043a81156bd6b31262f0ddea021efc72a3d7f" and "45ab92c31f61fb1f355f63dcd61f3f83d4b4e40d" have entirely different histories.
aa5043a811
...
45ab92c31f
@ -189,7 +189,6 @@ VineTopBlock::VineTopBlock(int x, int y,
|
|||||||
: MarioBlock(x, y, renderer, g_terrain_texture, VINE_TOP_SRC, false) {
|
: MarioBlock(x, y, renderer, g_terrain_texture, VINE_TOP_SRC, false) {
|
||||||
ensureCollision();
|
ensureCollision();
|
||||||
setId(VINE_TOP_ID);
|
setId(VINE_TOP_ID);
|
||||||
setBouncable(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VineBottomBlock::VineBottomBlock(int x, int y,
|
VineBottomBlock::VineBottomBlock(int x, int y,
|
||||||
@ -198,7 +197,6 @@ VineBottomBlock::VineBottomBlock(int x, int y,
|
|||||||
false) {
|
false) {
|
||||||
ensureCollision();
|
ensureCollision();
|
||||||
setId(VINE_BOTTOM_ID);
|
setId(VINE_BOTTOM_ID);
|
||||||
setBouncable(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PoleTopBlock::PoleTopBlock(int x, int y,
|
PoleTopBlock::PoleTopBlock(int x, int y,
|
||||||
@ -297,7 +295,6 @@ TreePlatformTopLeftBlock::TreePlatformTopLeftBlock(
|
|||||||
TREE_PLATFORM_TOP_LEFT_SRC, false) {
|
TREE_PLATFORM_TOP_LEFT_SRC, false) {
|
||||||
ensureCollision();
|
ensureCollision();
|
||||||
setId(TREE_PLATFORM_TOP_LEFT_ID);
|
setId(TREE_PLATFORM_TOP_LEFT_ID);
|
||||||
setBouncable(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TreePlatformTopMiddleBlock::TreePlatformTopMiddleBlock(
|
TreePlatformTopMiddleBlock::TreePlatformTopMiddleBlock(
|
||||||
@ -306,7 +303,6 @@ TreePlatformTopMiddleBlock::TreePlatformTopMiddleBlock(
|
|||||||
TREE_PLATFORM_TOP_MIDDLE_SRC, false) {
|
TREE_PLATFORM_TOP_MIDDLE_SRC, false) {
|
||||||
ensureCollision();
|
ensureCollision();
|
||||||
setId(TREE_PLATFORM_TOP_MIDDLE_ID);
|
setId(TREE_PLATFORM_TOP_MIDDLE_ID);
|
||||||
setBouncable(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TreePlatformTopRightBlock::TreePlatformTopRightBlock(
|
TreePlatformTopRightBlock::TreePlatformTopRightBlock(
|
||||||
@ -315,7 +311,6 @@ TreePlatformTopRightBlock::TreePlatformTopRightBlock(
|
|||||||
TREE_PLATFORM_TOP_RIGHT_SRC, false) {
|
TREE_PLATFORM_TOP_RIGHT_SRC, false) {
|
||||||
ensureCollision();
|
ensureCollision();
|
||||||
setId(TREE_PLATFORM_TOP_RIGHT_ID);
|
setId(TREE_PLATFORM_TOP_RIGHT_ID);
|
||||||
setBouncable(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TreePlatformBarkBlock::TreePlatformBarkBlock(
|
TreePlatformBarkBlock::TreePlatformBarkBlock(
|
||||||
@ -324,7 +319,6 @@ TreePlatformBarkBlock::TreePlatformBarkBlock(
|
|||||||
false) {
|
false) {
|
||||||
ensureCollision();
|
ensureCollision();
|
||||||
setId(TREE_PLATFORM_BARK_ID);
|
setId(TREE_PLATFORM_BARK_ID);
|
||||||
setBouncable(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WaterTopBlock::WaterTopBlock(int x, int y,
|
WaterTopBlock::WaterTopBlock(int x, int y,
|
||||||
@ -332,7 +326,6 @@ WaterTopBlock::WaterTopBlock(int x, int y,
|
|||||||
: MarioBlock(x, y, renderer, g_terrain_texture, WATER_TOP_SRC, false) {
|
: MarioBlock(x, y, renderer, g_terrain_texture, WATER_TOP_SRC, false) {
|
||||||
ensureCollision();
|
ensureCollision();
|
||||||
setId(WATER_TOP_ID);
|
setId(WATER_TOP_ID);
|
||||||
setBouncable(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WaterFillBlock::WaterFillBlock(int x, int y,
|
WaterFillBlock::WaterFillBlock(int x, int y,
|
||||||
@ -340,7 +333,6 @@ WaterFillBlock::WaterFillBlock(int x, int y,
|
|||||||
: MarioBlock(x, y, renderer, g_terrain_texture, WATER_FILL_SRC, false) {
|
: MarioBlock(x, y, renderer, g_terrain_texture, WATER_FILL_SRC, false) {
|
||||||
ensureCollision();
|
ensureCollision();
|
||||||
setId(WATER_FILL_ID);
|
setId(WATER_FILL_ID);
|
||||||
setBouncable(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MushroomPlatformTopLeftBlock::MushroomPlatformTopLeftBlock(
|
MushroomPlatformTopLeftBlock::MushroomPlatformTopLeftBlock(
|
||||||
@ -349,7 +341,6 @@ MushroomPlatformTopLeftBlock::MushroomPlatformTopLeftBlock(
|
|||||||
MUSHROOM_PLATFORM_TOP_LEFT_SRC, false) {
|
MUSHROOM_PLATFORM_TOP_LEFT_SRC, false) {
|
||||||
ensureCollision();
|
ensureCollision();
|
||||||
setId(MUSHROOM_PLATFORM_TOP_LEFT_ID);
|
setId(MUSHROOM_PLATFORM_TOP_LEFT_ID);
|
||||||
setBouncable(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MushroomPlatformTopMiddleBlock::MushroomPlatformTopMiddleBlock(
|
MushroomPlatformTopMiddleBlock::MushroomPlatformTopMiddleBlock(
|
||||||
@ -358,7 +349,6 @@ MushroomPlatformTopMiddleBlock::MushroomPlatformTopMiddleBlock(
|
|||||||
MUSHROOM_PLATFORM_TOP_MIDDLE_SRC, false) {
|
MUSHROOM_PLATFORM_TOP_MIDDLE_SRC, false) {
|
||||||
ensureCollision();
|
ensureCollision();
|
||||||
setId(MUSHROOM_PLATFORM_TOP_MIDDLE_ID);
|
setId(MUSHROOM_PLATFORM_TOP_MIDDLE_ID);
|
||||||
setBouncable(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MushroomPlatformTopRightBlock::MushroomPlatformTopRightBlock(
|
MushroomPlatformTopRightBlock::MushroomPlatformTopRightBlock(
|
||||||
@ -367,7 +357,6 @@ MushroomPlatformTopRightBlock::MushroomPlatformTopRightBlock(
|
|||||||
MUSHROOM_PLATFORM_TOP_RIGHT_SRC, false) {
|
MUSHROOM_PLATFORM_TOP_RIGHT_SRC, false) {
|
||||||
ensureCollision();
|
ensureCollision();
|
||||||
setId(MUSHROOM_PLATFORM_TOP_RIGHT_ID);
|
setId(MUSHROOM_PLATFORM_TOP_RIGHT_ID);
|
||||||
setBouncable(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MushroomPlatformBarkTopBlock::MushroomPlatformBarkTopBlock(
|
MushroomPlatformBarkTopBlock::MushroomPlatformBarkTopBlock(
|
||||||
@ -376,7 +365,6 @@ MushroomPlatformBarkTopBlock::MushroomPlatformBarkTopBlock(
|
|||||||
MUSHROOM_PLATFORM_BARK_TOP_SRC, false) {
|
MUSHROOM_PLATFORM_BARK_TOP_SRC, false) {
|
||||||
ensureCollision();
|
ensureCollision();
|
||||||
setId(MUSHROOM_PLATFORM_BARK_TOP_ID);
|
setId(MUSHROOM_PLATFORM_BARK_TOP_ID);
|
||||||
setBouncable(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MushroomPlatformBarkBottomBlock::MushroomPlatformBarkBottomBlock(
|
MushroomPlatformBarkBottomBlock::MushroomPlatformBarkBottomBlock(
|
||||||
@ -385,7 +373,6 @@ MushroomPlatformBarkBottomBlock::MushroomPlatformBarkBottomBlock(
|
|||||||
MUSHROOM_PLATFORM_BARK_BOTTOM_SRC, false) {
|
MUSHROOM_PLATFORM_BARK_BOTTOM_SRC, false) {
|
||||||
ensureCollision();
|
ensureCollision();
|
||||||
setId(MUSHROOM_PLATFORM_BARK_BOTTOM_ID);
|
setId(MUSHROOM_PLATFORM_BARK_BOTTOM_ID);
|
||||||
setBouncable(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TreeBarkBlock::TreeBarkBlock(int x, int y,
|
TreeBarkBlock::TreeBarkBlock(int x, int y,
|
||||||
@ -393,7 +380,6 @@ TreeBarkBlock::TreeBarkBlock(int x, int y,
|
|||||||
: MarioBlock(x, y, renderer, g_terrain_texture, TREE_BARK_SRC, false) {
|
: MarioBlock(x, y, renderer, g_terrain_texture, TREE_BARK_SRC, false) {
|
||||||
ensureCollision();
|
ensureCollision();
|
||||||
setId(TREE_BARK_ID);
|
setId(TREE_BARK_ID);
|
||||||
setBouncable(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TreeLeavesSmallBlock::TreeLeavesSmallBlock(
|
TreeLeavesSmallBlock::TreeLeavesSmallBlock(
|
||||||
@ -402,7 +388,6 @@ TreeLeavesSmallBlock::TreeLeavesSmallBlock(
|
|||||||
false) {
|
false) {
|
||||||
ensureCollision();
|
ensureCollision();
|
||||||
setId(TREE_LEAVES_SMALL_ID);
|
setId(TREE_LEAVES_SMALL_ID);
|
||||||
setBouncable(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TreeLeavesTopBlock::TreeLeavesTopBlock(
|
TreeLeavesTopBlock::TreeLeavesTopBlock(
|
||||||
@ -411,7 +396,6 @@ TreeLeavesTopBlock::TreeLeavesTopBlock(
|
|||||||
false) {
|
false) {
|
||||||
ensureCollision();
|
ensureCollision();
|
||||||
setId(TREE_LEAVES_TOP_ID);
|
setId(TREE_LEAVES_TOP_ID);
|
||||||
setBouncable(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TreeLeavesBottomBlock::TreeLeavesBottomBlock(
|
TreeLeavesBottomBlock::TreeLeavesBottomBlock(
|
||||||
@ -420,7 +404,6 @@ TreeLeavesBottomBlock::TreeLeavesBottomBlock(
|
|||||||
false) {
|
false) {
|
||||||
ensureCollision();
|
ensureCollision();
|
||||||
setId(TREE_LEAVES_BOTTOM_ID);
|
setId(TREE_LEAVES_BOTTOM_ID);
|
||||||
setBouncable(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CannonTowerBlock::CannonTowerBlock(int x, int y,
|
CannonTowerBlock::CannonTowerBlock(int x, int y,
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#include "../sdlpp/sdlpp.hpp"
|
#include "../sdlpp/sdlpp.hpp"
|
||||||
#include "SDL2/SDL_keycode.h"
|
|
||||||
#include "sprites.hpp"
|
#include "sprites.hpp"
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@ -45,20 +44,16 @@ std::mutex gamescene_mutex;
|
|||||||
void handleKeyDown(SDL_Keycode key, SDLPP::Scene &scene) {
|
void handleKeyDown(SDL_Keycode key, SDLPP::Scene &scene) {
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case SDLK_a:
|
case SDLK_a:
|
||||||
case SDLK_LEFT:
|
|
||||||
mario->walkLeft();
|
mario->walkLeft();
|
||||||
break;
|
break;
|
||||||
case SDLK_d:
|
case SDLK_d:
|
||||||
case SDLK_RIGHT:
|
|
||||||
mario->walkRight();
|
mario->walkRight();
|
||||||
break;
|
break;
|
||||||
case SDLK_SPACE:
|
case SDLK_SPACE:
|
||||||
case SDLK_w:
|
case SDLK_w:
|
||||||
case SDLK_UP:
|
|
||||||
mario->jump();
|
mario->jump();
|
||||||
break;
|
break;
|
||||||
case SDLK_s:
|
case SDLK_s:
|
||||||
case SDLK_DOWN:
|
|
||||||
break;
|
break;
|
||||||
case SDLK_r:
|
case SDLK_r:
|
||||||
scene.getRenderer().setRenderColiders(
|
scene.getRenderer().setRenderColiders(
|
||||||
@ -81,16 +76,13 @@ void handleKeyUp(SDL_Keycode key) {
|
|||||||
createGameMainMenuScene(renderer, false, true, true));
|
createGameMainMenuScene(renderer, false, true, true));
|
||||||
} break;
|
} break;
|
||||||
case SDLK_a:
|
case SDLK_a:
|
||||||
case SDLK_LEFT:
|
|
||||||
mario->walkRight();
|
mario->walkRight();
|
||||||
break;
|
break;
|
||||||
case SDLK_d:
|
case SDLK_d:
|
||||||
case SDLK_RIGHT:
|
|
||||||
mario->walkLeft();
|
mario->walkLeft();
|
||||||
break;
|
break;
|
||||||
case SDLK_SPACE:
|
case SDLK_SPACE:
|
||||||
case SDLK_w:
|
case SDLK_w:
|
||||||
case SDLK_UP:
|
|
||||||
mario->stopJump();
|
mario->stopJump();
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user