Created
January 12, 2016 22:32
-
-
Save JanBerktold/e4f3e051dc7a6d19135d to your computer and use it in GitHub Desktop.
This file contains 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
import java.awt.Color; | |
public class CircleTest | |
{ | |
public static void main(String [] args) | |
{ | |
EZ.initialize(800, 400); | |
EZCircle circle = EZ.addCircle(40, 40, 40, 40, Color.black, true); | |
while (true) { | |
if (circle.getXCenter() > EZ.getWindowWidth() || circle.getYCenter() > EZ.getWindowHeight()) { | |
circle.translateTo(40, 40); | |
} | |
if (EZInteraction.isMouseLeftButtonDown()) { | |
circle.translateBy(0, EZ.getDeltaTime() / 5); | |
} else { | |
circle.translateBy(EZ.getDeltaTime() / 5, 0); | |
} | |
if (EZInteraction.wasKeyPressed('b')) { | |
circle.setColor(Color.blue); | |
} else if (EZInteraction.wasKeyPressed('s')) { | |
circle.setColor(Color.black); | |
} else if (EZInteraction.wasKeyPressed('g')) { | |
circle.setColor(Color.green); | |
} | |
EZ.refreshScreen(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment