summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Character.cpp2
-rw-r--r--src/List.cpp6
-rw-r--r--src/main.cpp15
3 files changed, 6 insertions, 17 deletions
diff --git a/src/Character.cpp b/src/Character.cpp
index 5ebc39e..d5f8bc0 100644
--- a/src/Character.cpp
+++ b/src/Character.cpp
@@ -69,7 +69,7 @@ void Character::action(vector <Character> men)
bool Character::check(Location L, vector <Character> men)
{
- for(int i = 0; i < 10; i++)
+ for(int i = 0; i < men.size(); i++)
if(L.x == men[i].getLocation().x && L.y == men[i].getLocation().y)
return false;
diff --git a/src/List.cpp b/src/List.cpp
index 05a6f66..d4bc796 100644
--- a/src/List.cpp
+++ b/src/List.cpp
@@ -2,7 +2,7 @@
List::List()
{
- for(int i = 0; i < 10; i++)
+ for(int i = 0; i < 50; i++)
{
Location L;
L.x = 150;
@@ -14,12 +14,12 @@ List::List()
void List::draw(WINDOW * w)
{
- for(int i = 0; i < 10; i++)
+ for(int i = 0; i < men.size(); i++)
men[i].draw(w);
}
void List::action()
{
- for(int i = 0; i < 10; i++)
+ for(int i = 0; i < men.size(); i++)
men[i].action(men);
}
diff --git a/src/main.cpp b/src/main.cpp
index 022a2aa..c0d59af 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -31,20 +31,9 @@ int main()
else if (c == 'j')
l.x = l.x-1;
else if (c == 'q')
- break;
+ break;
else if (c == 'p')
- {
- if (paused)
- {
- timeout(100);
- paused = false;
- }
- else
- {
- timeout(-1);
- paused = true;
- }
- }
+ paused = !paused;
cursor.move(l);
if (!paused)