Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
onon1101 committed May 2, 2024
1 parent 954bfe8 commit dd813b2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
6 changes: 4 additions & 2 deletions src/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void App::Update() {
}

if (Util::Input::IsKeyDown(Util::Keycode::T)) {
m_MainCharacter->GetToolMod()->RemoveTool("WEAPON", "Spear");
// m_MainCharacter->GetToolMod()->RemoveTool("WEAPON", "Spear");
}

if (Util::Input::IsKeyDown(Util::Keycode::N)) {
Expand Down Expand Up @@ -153,7 +153,9 @@ void App::Update() {
m_MainCharacter->PrepareThrowOut(false);
for (const auto& elem : m_MapTableCodeDire) {
if (Util::Input::IsKeyDown(elem.first)) {
Game::Actions::ThrowOutWeapon(m_DungeonMap.get(), elem.second);
// Game::Actions::ThrowOutWeapon(m_DungeonMap.get(),
// elem.second);
Game::Systems::HPIS::ThrowOut(elem.second);
}
}
m_ThrowMode = false;
Expand Down
19 changes: 12 additions & 7 deletions src/Game/Systems/HEIS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Created by adven on 2024/5/1.
//
#include "HEIS.h"
#include "Game/System.h"
#include "Game_config.h"
#include "Graphs/Dagger.h"
#include "Helper.hpp"
Expand All @@ -27,20 +28,22 @@ auto Game::Systems::HEIS::MakeTile(
auto&& currGP = static_cast<glm::ivec2>(playerGP);

// is wall
while (true) {
while (m_Map->GetMapData()->IsPositionWall(currGP + direGP)) {
mi = Settings::Helper::GamePosToMapIdx(currGP);

// is wall?
if (m_Map->GetMapData()->IsPositionWall(currGP + direGP)) {
break;
}

if (m_Map->GetMapData()->IsHasEntity(mi)) {
m_Map->RemoveEnemy(mi);
currGP += direGP;
}

currGP += direGP;

// // is wall?
// if (m_Map->GetMapData()->IsPositionWall(currGP + direGP)) {
// break;
// }
}

// renderer weapon on floor
const auto pixelSize =
ToolBoxs::CountImagePixel(Game::Config::IMAGE_DAGGER_PATH, 1, 2);
const auto image = std::make_shared<SpriteSheet>(
Expand All @@ -54,6 +57,8 @@ auto Game::Systems::HEIS::MakeTile(
);
const auto object = std::make_shared<Graphs::DaggerGameObj>();
object->SetDrawable(image);

System::AddWeapon(object, mi);
}

Dungeon::Map* Game::Systems::HEIS::m_Map = nullptr;

0 comments on commit dd813b2

Please sign in to comment.