first commit
This commit is contained in:
commit
c8d40ecc9b
22 changed files with 817 additions and 0 deletions
35
Main.java
Normal file
35
Main.java
Normal file
|
@ -0,0 +1,35 @@
|
|||
import javax.swing.*;
|
||||
|
||||
public class Main
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
Box box = new Box("Tank");
|
||||
box.setSize(600, 600);
|
||||
|
||||
Tank tank = new Tank(box);
|
||||
box.addObject(tank);
|
||||
|
||||
TankEvent controll = new TankEvent(tank);
|
||||
box.addKeyListener(controll);
|
||||
|
||||
/* game loop */
|
||||
|
||||
while(true)
|
||||
{
|
||||
controll.keyMonitoring();
|
||||
|
||||
box.step();
|
||||
box.repaint();
|
||||
|
||||
try
|
||||
{
|
||||
Thread.sleep(15);
|
||||
}
|
||||
catch(InterruptedException e)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue