summaryrefslogtreecommitdiff
path: root/main.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 /main.cpp
parent3e48a47b9c47721e041b5b54a55ce5cb74d27ddb (diff)
extra tiles
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/main.cpp b/main.cpp
index 303e656..c9bfae0 100644
--- a/main.cpp
+++ b/main.cpp
@@ -158,7 +158,7 @@ int main(int, char**){
mouse_x=event.button.x;
mouse_y=event.button.y;
- world.bricks[(mouse_x+50-world.player.x2)/100+world.player.x-5][0].altitude=10-mouse_y/100;
+ world.mouseclick((mouse_x+50-world.player.x2)/100+world.player.x-5,10-mouse_y/100);
}
@@ -193,9 +193,6 @@ int main(int, char**){
switch(world.bricks[i][j].type)
{
- case 1:
- SDL_RenderCopy(ren,textures[4],NULL,&rect);
- break;
case 0:
SDL_RenderCopy(ren,textures[4],NULL,&rect);
SDL_SetRenderDrawColor(ren, 150+19*(i%2),115,70, 255);
@@ -203,6 +200,18 @@ int main(int, char**){
rect.y+=100;
SDL_RenderFillRect(ren,&rect);
break;
+ case 1:
+ SDL_RenderCopy(ren,textures[4],NULL,&rect);
+ break;
+ case 2:
+ SDL_RenderCopy(ren,textures[5],NULL,&rect);
+ break;
+ case 3:
+ SDL_RenderCopy(ren,textures[6],NULL,&rect);
+ break;
+ case 4:
+ SDL_RenderCopyEx(ren,textures[6],NULL,&rect,90,NULL,SDL_FLIP_NONE);
+ break;
}