-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBossFight2.java
41 lines (37 loc) · 888 Bytes
/
BossFight2.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import greenfoot.*;
/**
* Write a description of class BossFight2 here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class BossFight2 extends GameWorld2
{
SimpleTimer timer = new SimpleTimer();
Counter counter = new Counter();
BossFightText text = new BossFightText();
GreenfootSound sound = new GreenfootSound("Stage1Sound.wav");
/**
* Constructor for objects of class BossFight.
*
*/
public BossFight2()
{
super();
}
public Counter getCounter(){
return counter;
}
public void act()
{
super.act();
sound.setVolume(80);
sound.play();
addObject(text, 410, 230);
if(timer.millisElapsed() > 3000){
Boss2 boss2 = new Boss2();
boss2.counter = counter;
Greenfoot.setWorld(boss2);
}
}
}