Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com> Co-authored-by: sigonasr2 <sigonasr2@gmail.com>main
parent
535348d317
commit
db188a76b1
Binary file not shown.
@ -1,23 +1,37 @@ |
||||
package sig; |
||||
|
||||
import javax.swing.JFrame; |
||||
import java.awt.event.KeyEvent; |
||||
|
||||
import sig.engine.Panel; |
||||
|
||||
public class RabiClone { |
||||
public static final String PROGRAM_NAME="Sig's Java Project Template"; |
||||
|
||||
public static int UPCOUNT=0; |
||||
public static Panel p |
||||
public static void main(String[] args) { |
||||
|
||||
JFrame f = new JFrame(PROGRAM_NAME); |
||||
Panel p = new Panel(f); |
||||
p = new Panel(f); |
||||
|
||||
p.init(); |
||||
|
||||
f.add(p); |
||||
f.addComponentListener(p); |
||||
f.addKeyListener(p); |
||||
f.setSize(1280,720); |
||||
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
||||
f.setVisible(true); |
||||
|
||||
p.render(); |
||||
while (true) { |
||||
if (KeyHeld(KeyEvent.VK_UP)) { |
||||
System.out.println("Up Held: "+UPCOUNT++); |
||||
} |
||||
} |
||||
} |
||||
private static Boolean KeyHeld(int key) { |
||||
return p.KEYS.getOrDefault(key,false); |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue