From 842c21d6aab2f38e35ea668194f67f85af2e3539 Mon Sep 17 00:00:00 2001 From: miguel Date: Wed, 13 Sep 2017 01:47:16 +0200 Subject: extra tiles --- main.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'main.cpp') 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; } -- cgit v1.2.3