I want to make a game were a circle jumps over obstacles but I can't get it to jump
I've tried all keys on keyboard
import java.awt.event.KeyEvent;
public class Game {
public static void main(String[] args) {
StdDraw.setCanvasSize();
circle player = new circle(0, 0.05 , 0.05) ;
StdDraw.line(0, 0, 1, 0);
if(StdDraw.isKeyPressed(KeyEvent.VK_UP)){
System.out.println("hello");
double height = player.height;
while(height <= 0.2)
height = height + 0.05;
StdDraw.setCanvasSize();
StdDraw.line(0, 0, 1, 0);
StdDraw.filledCircle(0, height, 0.05);
StdDraw.show(100);
}
}
}
I put in print function to test if it goes in the "if" and it doesn't