summaryrefslogtreecommitdiff
path: root/World.cpp
diff options
context:
space:
mode:
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++;
+}
+