From 7d3af9aa2b01b922a19675b7c18f0b7b89dff94f Mon Sep 17 00:00:00 2001 From: vamastah Date: Sat, 28 Sep 2019 10:55:56 +0200 Subject: [PATCH] soft drop change, icons added --- icon.png | Bin 0 -> 787 bytes main.c | 23 +++++------------------ yatka.png | Bin 0 -> 2422 bytes 3 files changed, 5 insertions(+), 18 deletions(-) create mode 100644 icon.png create mode 100644 yatka.png diff --git a/icon.png b/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..c003aca783cbcd1347c16e9a2f67a0120791a5e1 GIT binary patch literal 787 zcmV+u1MK{XP)`QD>DADO0Tk(Z0 zb{zTB?tUxn=b$&AKWeREYX|@Ugb^iPkzzQy*ht=R$DKg%D4^|D8^!2%+QS zkWW`c5@iGk9kIq2qDIpo12?P^f(@F5@@Z35Z2rMyJ;F2XFskB zLP(M%>-E~ML{S6)Wm#TbT@zOw=iGYeX3&cH`RjKBIT#Eu#;esTilPmJSx0q!80=b6 z6sy(BK4W*Vwypq!o|uM_EX!;H(+$e9EF5Jt8exnUi)CZIsw&c_oV}Q$D3T;W2*q(c z91bzY#+dbbUDq|S4ecVaw{~ZX#lmJPioz{MQAEz3$AN7h-hZv@Ivo1-t1qE5P)c{b zlTtLI$8lVi<=s3ZWQ+j-rB!DFO4HUCt%+?o|0hDWyFgRgo}e|Bl#(%Kn^;wqt9LXS z*`u>7arL_JqE#hG< z>dU~>q5uQ5tEq=E@U@8V)uOFlu@Htcf3QiGed`9B{{JlkTEzBl?uF^lqJKX4yj`TI RacKYm002ovPDHLkV1g!sX(<2z literal 0 HcmV?d00001 diff --git a/main.c b/main.c index 3fb1fe8..14acfa2 100644 --- a/main.c +++ b/main.c @@ -43,7 +43,7 @@ #define BLOCK_SIZE 12 #define FIG_NUM 7 // including the active figure -#define KEY_REPEAT_RATE 80 // in ms +#define KEY_REPEAT_RATE 100 // in ms #define FONT_SIZE 7 #define MUSIC_TRACK_NUM 4 #define MUSIC_FADE_TIME 3000 @@ -121,7 +121,6 @@ int nextblocks = FIG_NUM - 1; enum RandomAlgo randomalgo = RA_7BAG; bool pause = false, gameover = false, hold_ready = true, fast_drop = false; -const int fast_drop_rate = KEY_REPEAT_RATE; const int drop_delay_per_level[] = {500, 425, 360, 307, 261, 222, 189, 160, 136, 116}; int fps, lines = 0, hiscore = 0, old_hiscore, score = 0, level = 0; int next_time; @@ -707,10 +706,8 @@ void dropSoft(void) if (gameover) Mix_FadeOutMusic(MUSIC_FADE_TIME); - if (fast_drop) - next_time = SDL_GetTicks() + fast_drop_rate; - else - next_time = SDL_GetTicks() + drop_delay_per_level[level]; + + next_time = SDL_GetTicks() + drop_delay_per_level[level]; screenFlagUpdate(true); } @@ -823,7 +820,6 @@ void handleInput(void) static bool rotateccw_key_state = false; static bool pause_key_state = false; static bool harddrop_key_state = false; - static bool softdrop_key_state = false; static bool hold_key_state = false; static bool left_key_state = false; static bool right_key_state = false; @@ -847,10 +843,6 @@ void handleInput(void) case KEY_HARDDROP: harddrop_key_state = false; break; - case KEY_SOFTDROP: - fast_drop = false; - softdrop_key_state = false; - break; case KEY_HOLD: hold_key_state = false; break; @@ -928,14 +920,9 @@ void handleInput(void) } break; case KEY_SOFTDROP: - if (!softdrop_key_state) + if (!pause && !gameover) { - softdrop_key_state = true; - if (!pause && !gameover) - { - fast_drop = true; - dropSoft(); - } + dropSoft(); } break; case KEY_HARDDROP: diff --git a/yatka.png b/yatka.png new file mode 100644 index 0000000000000000000000000000000000000000..16178c271780cb96dbb308baa5b20ffc6e3d38dc GIT binary patch literal 2422 zcmV-+35oWJP)27;6oylxA$)+2zkE}!%Xq3QeL2RUzIP8G~XCx%V1%bo~z5xOuJ^){U8`3U)APj&I#A^rrBX@Fi)cxiwZAHL$KDqyL>)KbB&xwcu z002-5jI#GOcZb8F?|BzjSHF9C86$)c0szYB#0$6IdDFIS!!Y$E%L*Arv{|hX0Yl6n1RTdP0CXKESXn{{BLs|6Mq|JTAPRjqlzs1p0~W9U_Sm-S#;n>$%YD*$!wYd@Tv1K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