-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain_Menu.java
49 lines (46 loc) · 1.2 KB
/
Main_Menu.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
41
42
43
44
45
46
47
48
49
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Main_Menu here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Main_Menu extends World
{
/**
* Constructor for objects of class Main_Menu.
*
*/
public Mock_Blob eelo = new Mock_Blob();
public Logo yey = new Logo();
public Play ya = new Play();
public int current = 1;
public int current1 = 1;
public int timer = 4;
public Main_Menu()
{
// Create a new world with 750x500 cells with a cell size of 1x1 pixels.
super(750, 500, 1);
addObject(eelo, 365, 330);
addObject(yey, 375, 116);
addObject(ya, 375, 230);
setPaintOrder(Mock_Blob.class);
addObject(new Credits(), 375, 480);
}
public void act() {
timer--;
if(timer <= 0) {
yey.change("" + current);
ya.change("" + current1);
current++;
current1++;
if(current > 8) {
current = 1;
}
if(current1 > 6) {
current1 = 1;
}
timer = 4;
}
}
}