Skip to content

Commit

Permalink
Replace screen_tapped with screen_down
Browse files Browse the repository at this point in the history
  • Loading branch information
NyakoFox committed Aug 27, 2024
1 parent f75eaeb commit 2bc2f31
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions desktop_version/src/Input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2386,7 +2386,7 @@ void titleinput(void)
}
}
if (key.isDown(KEYBOARD_z) || key.isDown(KEYBOARD_SPACE) || key.isDown(KEYBOARD_v) || key.isDown(game.controllerButton_flip)
|| (!game.menustart ? touch::screen_tapped() : touch::button_tapped(TOUCH_BUTTON_CONFIRM)))
|| (!game.menustart ? touch::screen_down() : touch::button_tapped(TOUCH_BUTTON_CONFIRM)))
{
game.press_action = true;
}
Expand Down Expand Up @@ -2642,7 +2642,7 @@ void gameinput(void)
game.press_action = false;
if (key.isDown(KEYBOARD_z) || key.isDown(KEYBOARD_SPACE) || key.isDown(KEYBOARD_v)
|| key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN) || key.isDown(KEYBOARD_w)
|| key.isDown(KEYBOARD_s) || key.isDown(game.controllerButton_flip) || touch::screen_tapped()
|| key.isDown(KEYBOARD_s) || key.isDown(game.controllerButton_flip) || touch::screen_down()
)
{
game.press_action = true;
Expand Down Expand Up @@ -3539,7 +3539,7 @@ void gamecompleteinput(void)
graphics.titlebg.bypos += graphics.titlebg.bscroll;
game.oldcreditposition = game.creditposition;

if (key.isDown(KEYBOARD_z) || key.isDown(KEYBOARD_SPACE) || key.isDown(KEYBOARD_v) || key.isDown(game.controllerButton_flip) || touch::screen_tapped())
if (key.isDown(KEYBOARD_z) || key.isDown(KEYBOARD_SPACE) || key.isDown(KEYBOARD_v) || key.isDown(game.controllerButton_flip) || touch::screen_down())
{
game.creditposition -= 6;
if (game.creditposition <= -Credits::creditmaxposition)
Expand Down Expand Up @@ -3587,7 +3587,7 @@ void gamecompleteinput2(void)
//Do this here because input comes first
game.oldcreditposx = game.creditposx;

if (key.isDown(KEYBOARD_z) || key.isDown(KEYBOARD_SPACE) || key.isDown(KEYBOARD_v) || key.isDown(game.controllerButton_flip) || touch::screen_tapped())
if (key.isDown(KEYBOARD_z) || key.isDown(KEYBOARD_SPACE) || key.isDown(KEYBOARD_v) || key.isDown(game.controllerButton_flip) || touch::screen_down())
{
game.creditposx++;
game.oldcreditposx++;
Expand Down
8 changes: 4 additions & 4 deletions desktop_version/src/Script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ void scriptclass::run(void)
game.hascontrol = false;
game.pausescript = true;
if (key.isDown(90) || key.isDown(32) || key.isDown(86)
|| key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN) || touch::screen_tapped()) game.jumpheld = true;
|| key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN) || touch::screen_down()) game.jumpheld = true;
}
game.backgroundtext = false;

Expand Down Expand Up @@ -1829,7 +1829,7 @@ void scriptclass::run(void)
game.hascontrol = false;
game.pausescript = true;
if (key.isDown(90) || key.isDown(32) || key.isDown(86)
|| key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN) || touch::screen_tapped()) game.jumpheld = true;
|| key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN) || touch::screen_down()) game.jumpheld = true;
}
game.backgroundtext = false;
}
Expand All @@ -1852,7 +1852,7 @@ void scriptclass::run(void)
game.hascontrol = false;
game.pausescript = true;
if (key.isDown(90) || key.isDown(32) || key.isDown(86)
|| key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN) || touch::screen_tapped()) game.jumpheld = true;
|| key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN) || touch::screen_down()) game.jumpheld = true;
}
game.backgroundtext = false;
}
Expand All @@ -1873,7 +1873,7 @@ void scriptclass::run(void)
game.hascontrol = false;
game.pausescript = true;
if (key.isDown(90) || key.isDown(32) || key.isDown(86)
|| key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN) || touch::screen_tapped()) game.jumpheld = true;
|| key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN) || touch::screen_down()) game.jumpheld = true;
}
game.backgroundtext = false;
}
Expand Down
4 changes: 2 additions & 2 deletions desktop_version/src/Touch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ namespace touch
return false;
}

bool screen_tapped(void)
bool screen_down(void)
{
for (int i = 0; i < fingers.size(); i++)
{
Expand All @@ -255,7 +255,7 @@ namespace touch
continue;
}

return fingers[i].pressed;
return true;
}
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion desktop_version/src/Touch.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace touch

bool button_tapped(TouchButtonID button);
bool touching_right(void);
bool screen_tapped(void);
bool screen_down(void);
}

#endif /* TOUCH_H */
2 changes: 1 addition & 1 deletion desktop_version/src/preloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void preloaderinput(void)
{
game.press_action = false;

if (key.isDown(KEYBOARD_z) || key.isDown(KEYBOARD_SPACE) || key.isDown(KEYBOARD_v) || key.isDown(game.controllerButton_flip) || touch::screen_tapped()) {
if (key.isDown(KEYBOARD_z) || key.isDown(KEYBOARD_SPACE) || key.isDown(KEYBOARD_v) || key.isDown(game.controllerButton_flip) || touch::screen_down()) {
game.press_action = true;
}

Expand Down

0 comments on commit 2bc2f31

Please sign in to comment.