summaryrefslogtreecommitdiff
path: root/World.cpp
diff options
context:
space:
mode:
authormiguel <miguel@localhost>2017-09-13 01:47:16 +0200
committermiguel <miguel@localhost>2017-09-13 01:47:16 +0200
commit842c21d6aab2f38e35ea668194f67f85af2e3539 (patch)
tree2277e439edf7980781f56b46fbb6dc837f3b8427 /World.cpp
parent3e48a47b9c47721e041b5b54a55ce5cb74d27ddb (diff)
extra tiles
Diffstat (limited to 'World.cpp')
-rw-r--r--World.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/World.cpp b/World.cpp
index 66b1aba..1a3e9b5 100644
--- a/World.cpp
+++ b/World.cpp
@@ -3,7 +3,7 @@
World::World(int level)
{
- player.speed=1;
+ player.speed=0;
player.x2=player.x=0;
player.anim=0;
// generate level
@@ -18,6 +18,29 @@ void World::sim(double time)
{
player.x2-=1;
player.x+=1;
+
+ player.speed--;
}
}
+void World::mouseclick(int x, int y)
+{
+ for(Brick &brick:bricks[x])
+ {
+ if(brick.type<=1&&brick.altitude==y)
+ {
+ return;
+ }
+ if(brick.type>1&&brick.altitude==y)
+ {
+ brick.type++;
+ if(brick.type>=6)brick.type=2;
+ return;
+ }
+
+
+ }
+ bricks[x].push_back({y,2});
+ player.speed++;
+}
+