Browse Source

Created wave class

pull/1/head
emilydec 8 years ago
committed by 16nlyons
parent
commit
b4679f03ec
1 changed files with 47 additions and 0 deletions
  1. +47
    -0
      src/tanks/Tanks.java

+ 47
- 0
src/tanks/Tanks.java View File

@ -301,4 +301,51 @@ public class Tanks
}
private class Wave extends DrawableElement
{
/*fields time is continous while playing, gameMode(1=playing,
2=paused, 3=menu. spawntime keeps a countdown until next spawn,
kills keeps track of kills duh.
*/
int time, kills, gameMode, waveNum;
Timer spawn;
//constuctor
public Wave()
{
time=0;
kills=0;
gameMode=1;
waveNum=1;
ActionListener s = new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
spawn();
}
};
spawn = new Timer(2000,s);
spawn.start();
}
//spawn method checks if spawn timer ==0 and if so then spawns an
//enemy
public void spawn()
{
Enemy temp = new Enemy();
temp.spawn(frame);
enemy.add(temp);
}
//timer
}
}

Loading…
Cancel
Save