Skip to content

Instantly share code, notes, and snippets.

@codeforfun-jp
Created June 8, 2021 01:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeforfun-jp/90cce758fe6321f31a298373a18718b8 to your computer and use it in GitHub Desktop.
Save codeforfun-jp/90cce758fe6321f31a298373a18718b8 to your computer and use it in GitHub Desktop.
CTB 6-7
// Black
float blackCenterX = blackX + black.getWidth() / 2;
float blackCenterY = blackY + black.getHeight() / 2;
if (0 <= blackCenterX && blackCenterX <= boxSize &&
boxY <= blackCenterY && blackCenterY <= boxY + boxSize) {
// Game Over!
if (timer != null) {
timer.cancel();
timer = null;
}
// 結果画面へ
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment