Skip to content

Commit

Permalink
Fixed bug related to types, added a map
Browse files Browse the repository at this point in the history
  • Loading branch information
ogbaba committed Jan 2, 2017
1 parent 6f9d57d commit fe2c322
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 8 deletions.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions maps/clear/tstclr.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#######
## #
#1 Cb
##BA #
# ## #
# a# ##
# ## #
c 2#
########
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions src/.qmake.stash
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
QMAKE_DEFAULT_INCDIRS = \
/usr/include/c++/6.2.1 \
/usr/include/c++/6.2.1/x86_64-redhat-linux \
/usr/include/c++/6.2.1/backward \
/usr/lib/gcc/x86_64-redhat-linux/6.2.1/include \
/usr/local/include \
/usr/include
QMAKE_DEFAULT_LIBDIRS = \
/usr/lib/gcc/x86_64-redhat-linux/6.2.1 \
/usr/lib64 \
/lib64 \
/usr/lib \
/lib
16 changes: 8 additions & 8 deletions src/gameplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ using namespace std;

bool Move (CMatrix & Mat, GameObjects & Objects, CPosition & Pos, const int & DistX, const int & DistY)
{
if ( (-DistY > int (Pos.second))
||(-DistX > int (Pos.first))
if ( (-DistY > (int) Pos.second)
||(-DistX > (int) Pos.first)
||(DistY + Pos.second >= Mat.size())
||(DistX + Pos.first >= Mat[Pos.second].size())
||(Mat[Pos.second + DistY][Pos.first + DistX] == KTokenWall))
Expand Down Expand Up @@ -153,11 +153,11 @@ void WriteRules (const char & GameMode)

bool AreInContact (const CPosition & Pos1, const CPosition & Pos2)
{
return ((Pos1.second == Pos2.second)
&& (Pos1.first >= Pos2.first - 1)
&& (Pos1.first <= Pos2.first + 1))
||((Pos1.first == Pos2.first)
&& (Pos1.second >= Pos2.second - 1)
&& (Pos1.second <= Pos2.second + 1));
return ((( (int) Pos1.second == (int) Pos2.second)
&& ((int) Pos1.first >= (int) Pos2.first - 1)
&& ((int) Pos1.first <= (int) Pos2.first + 1))
||(((int) Pos1.first == (int) Pos2.first)
&& ((int) Pos1.second >= (int) Pos2.second - 1)
&& ((int) Pos1.second <= (int) Pos2.second + 1)));

} // AreInContact

0 comments on commit fe2c322

Please sign in to comment.