Skip to content

Instantly share code, notes, and snippets.

@codeforfun-jp
Created June 8, 2021 00:22
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/1edffcf1fccc69c12a04e6bb075a9200 to your computer and use it in GitHub Desktop.
Save codeforfun-jp/1edffcf1fccc69c12a04e6bb075a9200 to your computer and use it in GitHub Desktop.
CTB 5-4
public void changePos() {
// Orange
orangeX -= 12;
if (orangeX < 0) {
orangeX = screenWidth + 20;
orangeY = (float)Math.floor(Math.random() * (frameHeight - orange.getHeight()));
}
orange.setX(orangeX);
orange.setY(orangeY);
// Box
if (action_flg) {
boxY -= 20;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment