Skip to content

Instantly share code, notes, and snippets.

@codeforfun-jp
Created June 7, 2021 09:23
Show Gist options
  • Save codeforfun-jp/e0a51364d8653aa88a062d268b561669 to your computer and use it in GitHub Desktop.
Save codeforfun-jp/e0a51364d8653aa88a062d268b561669 to your computer and use it in GitHub Desktop.
CTB 4-9
public void changePos() {
if (action_flg) {
boxY -= 20;
} else {
boxY += 20;
}
if (boxY < 0) boxY = 0;
if (boxY > frameHeight - boxSize) boxY = frameHeight - boxSize;
box.setY(boxY);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment