-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathPopCap.java
35 lines (32 loc) · 931 Bytes
/
PopCap.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
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class PopCap here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class PopCap extends World
{
/**
* Constructor for objects of class PopCap.
*
*/
public int counter = 0;
public GreenfootSound menutheme = new GreenfootSound("menutheme.mp3");
public PopCap()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(576, 430, 1, false);
setPaintOrder(EndTransition.class, Transition.class);
}
public void act() {
if (!menutheme.isPlaying()) {
menutheme.setVolume(70);
menutheme.playLoop();
}
counter++;
if (counter > 100) {
addObject(new Transition(true, new MainMenu(menutheme), 6), 288, 215);
}
}
}