Skip to content

Instantly share code, notes, and snippets.

@avh4
Created February 6, 2012 03:30
Show Gist options
  • Save avh4/1749356 to your computer and use it in GitHub Desktop.
Save avh4/1749356 to your computer and use it in GitHub Desktop.
Provided code for the Submarine project
iceX += iceSpeed;
if (iceX + iceWidth < 0)
{
iceX = windowWidth + r.nextInt(500);
iceSpeed = 2 + r.nextInt(25);
iceWidth = 30 + r.nextInt(30);
iceHeight = 60 + r.nextInt(20);
}
if (ke.getKeyCode() == KeyEvent.VK_UP)
{
subY = Math.max(90, subX-3);
}
else if (ke.getKeyCode() == KeyEvent.VK_DOWN)
{
subY = subY + 3;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment