diff options
| author | miguel <miguel@localhost> | 2017-09-13 01:47:16 +0200 |
|---|---|---|
| committer | miguel <miguel@localhost> | 2017-09-13 01:47:16 +0200 |
| commit | 842c21d6aab2f38e35ea668194f67f85af2e3539 (patch) | |
| tree | 2277e439edf7980781f56b46fbb6dc837f3b8427 /World.cpp | |
| parent | 3e48a47b9c47721e041b5b54a55ce5cb74d27ddb (diff) | |
extra tiles
Diffstat (limited to 'World.cpp')
| -rw-r--r-- | World.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
@@ -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++; +} + |
