diff options
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++; +} + |
