Created
February 6, 2012 03:30
-
-
Save avh4/1749356 to your computer and use it in GitHub Desktop.
Provided code for the Submarine project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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