MCPcopy Create free account
hub / github.com/NianBroken/Firework_Simulator / handlePointerStart

Function handlePointerStart

js/script.js:1112–1138  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

1110let isUpdatingSpeed = false;
1111
1112function handlePointerStart(event) {
1113 activePointerCount++;
1114 const btnSize = 50;
1115
1116 if (event.y < btnSize) {
1117 if (event.x < btnSize) {
1118 togglePause();
1119 return;
1120 }
1121 if (event.x > mainStage.width / 2 - btnSize / 2 && event.x < mainStage.width / 2 + btnSize / 2) {
1122 toggleSound();
1123 return;
1124 }
1125 if (event.x > mainStage.width - btnSize) {
1126 toggleMenu();
1127 return;
1128 }
1129 }
1130
1131 if (!isRunning()) return;
1132
1133 if (updateSpeedFromEvent(event)) {
1134 isUpdatingSpeed = true;
1135 } else if (event.onCanvas) {
1136 launchShellFromConfig(event);
1137 }
1138}
1139
1140function handlePointerEnd(event) {
1141 activePointerCount--;

Callers

nothing calls this directly

Calls 6

togglePauseFunction · 0.85
toggleSoundFunction · 0.85
toggleMenuFunction · 0.85
isRunningFunction · 0.85
updateSpeedFromEventFunction · 0.85
launchShellFromConfigFunction · 0.85

Tested by

no test coverage detected