Skip to content

Commit

Permalink
Change name in the script instead of hardcoding
Browse files Browse the repository at this point in the history
  • Loading branch information
FergusonAJ committed Dec 7, 2023
1 parent 1047cb0 commit 52cead2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion assets/scripts/g4_world_load.ws
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ water_id = addCellType("water","Water that distinguishes fire.","w",CELL_WATER)
loadWorld("../assets/grids/group4_maze.grid")

# Place the player agent into the world
player=addAgent("Player2D","PlayerAgent","@",0,0)
# Name is interface to play nicely with the 2D interface
player=addAgent("Player2D","Interface","@",0,0)
setProperty(player,"Health",100.0)
setProperty(player,"Strength",7.0)
setProperty(player,"Defense",7.0)
Expand Down
2 changes: 1 addition & 1 deletion source/Worlds/ProgramExecutor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ namespace worldlang {
}
#ifdef USE_SFML_INTERFACE
else if (type == "Player2D") {
agent = &world.AddAgent<i_2D::MainInterface>("Interface", "symbol", symbol[0]);
agent = &world.AddAgent<i_2D::MainInterface>(name, "symbol", symbol[0]);
agent->SetPosition(x, y);
}
#endif
Expand Down

0 comments on commit 52cead2

Please sign in to comment.