Skip to content

Commit

Permalink
Merge remote-tracking branch 'group_8/main' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
FergusonAJ committed Dec 7, 2023
2 parents 7a413cd + 3faa1c4 commit 4e30d72
Show file tree
Hide file tree
Showing 12 changed files with 493 additions and 296 deletions.
8 changes: 4 additions & 4 deletions assets/grids/team8_grid_large.grid
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
^^^ ^^^~~ ^^^^^^^^^^^^^^ ^^^^^^
^ ^^~~ ^^^^^^^^^^^^^^^^^^^ ^^^^^
^^^ ^^^~~ ^^^^^^^^^^^^^^} ^^^^^^
^ } ^^~~ ^^^^^^^^^^^^^^^^^^^ ^^^^^
^^^ ~~~ ^^^^^^^^^^^^^
^^^^^ ~~^ ^^^^^ ^^
^^^^ ~~~^^^ ^ ^^ ^^^
Expand All @@ -8,13 +8,13 @@
^ ~~~^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^
^ ^^~~ ^^^^^^^^^^^^ ^^^^^^^
^ ^^^~~ ^^^ ^^^^^^^ ^^^ ^^^^
^ ^^^~~~^^^^^^^^^ ^^^^^^^^^^^^~~~~~
^ { ^^^~~~^^^^^^^^^ ^^^^^^^^^^^^~~~~~
^^ ^^^^~~~~^^^^^^^^^^ ^^^^^^^^^^^^^~~~~~~~~
^^^ ^ ~~~~~^^^^^^^^^ ^^^^^^^^^~~~~~~~~~^^^^^
^^^ ^^~~~~~~^^^^^ ^^^^^~~~~~~~^^^^^^^ ^^^
^ ^ ~~~~~~~~##~~~~~~~^^^^^^^^^^ ^^^
^^ ^^^^^ ~~~##~~~~^^^^^^^^^ ^^^^
^^ ^^^^^^^^^^ ^^ ^^
^ ^^^^^^^^^^^^^ ^^^ ^
^ ^^^^^^^^^^^^^ ^^^ ^ {
^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^
^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
300 changes: 150 additions & 150 deletions assets/grids/team8_grid_v2.grid

Large diffs are not rendered by default.

File renamed without changes
42 changes: 36 additions & 6 deletions source/Interfaces/MainInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ namespace i_2D {
if (item_ptr->HasProperty("symbol")) {
c = item_ptr->GetProperty<char>("symbol");
}
if(pos.CellX() >= 0 && pos.CellY() <= 0 &&
pos.CellX() < grid.GetWidth() && pos.CellY() < grid.GetHeight()){
if(pos.CellX() >= 0 && pos.CellY() >= 0 &&
pos.CellX() < grid.GetWidth() && pos.CellY() < grid.GetHeight() &&
!item_ptr->IsOwned()){
symbol_grid[pos.CellY()][pos.CellX()] = c;
}
}
Expand All @@ -77,7 +78,9 @@ namespace i_2D {
if (agent_ptr->HasProperty("symbol")) {
c = agent_ptr->GetProperty<char>("symbol");
}
symbol_grid[pos.CellY()][pos.CellX()] = c;
if (!agent_ptr->HasProperty("deleted")){
symbol_grid[pos.CellY()][pos.CellX()] = c;
}
}
return symbol_grid;
}
Expand Down Expand Up @@ -379,6 +382,33 @@ namespace i_2D {
case sf::Keyboard::Right:
action_id = GetActionID("right");
break;
case sf::Keyboard::H:
action_id = GetActionID("heal");
break;
case sf::Keyboard::T:
action_id = GetActionID("stats");
break;
case sf::Keyboard::C:
action_id = GetActionID("use_axe");
break;
case sf::Keyboard::V:
action_id = GetActionID("use_boat");
break;
case sf::Keyboard::F:
action_id = GetActionID("attack");
break;
case sf::Keyboard::G:
action_id = GetActionID("special");
break;
case sf::Keyboard::B:
action_id = GetActionID("buff");
break;
case sf::Keyboard::R:
action_id = GetActionID("run");
break;
case sf::Keyboard::Y:
action_id = GetActionID("help");
break;
default:
break; // The user pressed an unknown key.
}
Expand Down Expand Up @@ -483,10 +513,10 @@ namespace i_2D {
}

// Check if the mouse is over specific menu items
if (mMenu.GetMenu()[4]->isMouseOver(mWindow) or (mGridWidth == mGridHeight and mGridWidth > ROW)){
mGridSizeLarge = true;
if (mMenu.GetMenu()[4]->isMouseOver(mWindow)){
SetLargeGrid(true);
} else if (mMenu.GetMenu()[3]->isMouseOver(mWindow)) {
mGridSizeLarge = false;
SetLargeGrid(false);
} else {
// Handle mouse button press for the general menu
mMenu.HandleMouseButtonPressed(mWindow);
Expand Down
2 changes: 2 additions & 0 deletions source/Interfaces/MainInterface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ namespace i_2D {

void ChooseTexture();

bool SetLargeGrid(bool b){ mGridSizeLarge = b; }

void Notify(const std::string & message,
const std::string & /*msg_type*/="none") override
{
Expand Down
10 changes: 10 additions & 0 deletions source/Interfaces/TextureHolder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ namespace i_2D
LoadTexture("pathTexture", "../assets/Ground_tiles/Sand1.png");
LoadTexture("portal1Texture", "../assets/walls/portal1.png");
LoadTexture("portal2Texture", "../assets/walls/portal2.png");
LoadTexture("portal3Texture", "../assets/walls/portal3.png");
LoadTexture("portal4Texture", "../assets/walls/portal4.png");
LoadTexture("healthTexture", "../assets/walls/teleport.png");
LoadTexture("rockTexture", "../assets/walls/gray_wall.png");
LoadTexture("swordTexture", "../assets/weapons/longsword.png");
textures['P'] = GetTexture("axeTexture");
textures['U'] = GetTexture("boatTexture");
textures['#'] = GetTexture("wallTexture");
Expand All @@ -121,6 +126,11 @@ namespace i_2D
textures[' '] = GetTexture("pathTexture");
textures['{'] = GetTexture("portal1Texture");
textures['}'] = GetTexture("portal2Texture");
textures['('] = GetTexture("portal3Texture");
textures[')'] = GetTexture("portal4Texture");
textures['j'] = GetTexture("healthTexture");
textures['t'] = GetTexture("swordTexture");
textures['$'] = GetTexture("rockTexture");

return textures;
}
Expand Down
2 changes: 1 addition & 1 deletion source/Interfaces/TrashInterface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace cse491 {
if(agent_ptr->HasProperty("symbol")){
c = agent_ptr->GetProperty<char>("symbol");
}
if (!agent_ptr->HasProperty("Deleted")){
if (!agent_ptr->HasProperty("deleted")){
symbol_grid[pos.CellY()][pos.CellX()] = c;
}
}
Expand Down
Loading

0 comments on commit 4e30d72

Please sign in to comment.