forked from DaniPTRK/Next-Move
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalAU.java
More file actions
173 lines (172 loc) · 6.92 KB
/
alAU.java
File metadata and controls
173 lines (172 loc) · 6.92 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Scena pierderii războiului sau a dictaturii militare
*/
public class alAU extends cutscene
{
public String al="În timpul războiului,\n România nu a reușit să facă față ofensivelor Austro-Ungariei.";
public String[] animat=new String[]{"aud.png", "aus.png"};
int count=0;
/**
* Constructor for objects of class alau.
*
*/
public alAU()
{
prepare();
//În funcție de caz, sunt schimbate imaginile soldaților și textul.
if(mainroom.win==-1)
{
setBackground("RU.jpg");
int i;
for(i=0; i<15; i++)
{
getObjects(ausold.class).get(i).setImage("rusold.png");
if(i>=13)
{
getObjects(ausold.class).get(i).setImage("rufront.png");
}
}
animat=new String[]{"rud.png", "rus.png"};
al="În timpul războiului,\n România nu a reușit să facă față ofensivelor Rusiei.";
}
else if(mainroom.win==-3)
{
setBackground("Alegeriopen.jpg");
int i;
for(i=0; i<15; i++)
{
getObjects(ausold.class).get(i).setImage("rosold.png");
if(i>=13)
{
getObjects(ausold.class).get(i).setImage("rofront.png");
}
}
animat=new String[]{"rod.png", "ros.png"};
al="În timpul războiului, România a suferit\n o puternică lovitură de stat inițiată de soldați.";
}
getObjects(ausold.class).get(13).getImage().setTransparency(0);
getObjects(ausold.class).get(14).getImage().setTransparency(0);
getObjects(Inter.class).get(0).passday1(0);
}
//În funcție de situație, Aurel fie este împușcat (înfrângere), fie întemnițat (dictatură militară).
public void act()
{
getObjects(Text.class).get(0).TextFadeIn(0,al,50, Color.WHITE);
Greenfoot.delay(300);
Greenfoot.playSound("incom.mp3");
getObjects(Text.class).get(0).TextFadeOut(0);
getObjects(Inter.class).get(0).passday2(0);
walk();
getObjects(Inter.class).get(0).passday1(0);
if(mainroom.win==-3)
{
Greenfoot.playSound("sumup.mp3");
Greenfoot.setWorld(new prisonexterior());
}
else
{
Greenfoot.playSound("gunshot.mp3");
Greenfoot.delay(100);
Greenfoot.setWorld(new mormant());
}
}
public void walk()
{
int i;
for(i=0; i<=255; i=i+15)
{
getObjects(Conducator.class).get(0).setLocation(getObjects(Conducator.class).get(0).getX(),getObjects(Conducator.class).get(0).getY()+5);
getObjects(ausold.class).get(13).setLocation(getObjects(ausold.class).get(13).getX()+5,getObjects(ausold.class).get(13).getY()+5);
getObjects(ausold.class).get(14).setLocation(getObjects(ausold.class).get(14).getX()-5,getObjects(ausold.class).get(14).getY()+5);
if(count%50>25)
{
getObjects(Conducator.class).get(0).setImage("fatamers2.png");
getObjects(ausold.class).get(13).setImage(animat[0]);
getObjects(ausold.class).get(14).setImage(animat[0]);
}
else
{
getObjects(Conducator.class).get(0).setImage("fatamers1.png");
getObjects(ausold.class).get(13).setImage(animat[1]);
getObjects(ausold.class).get(14).setImage(animat[1]);
}
getObjects(Conducator.class).get(0).getImage().setTransparency(i);
getObjects(ausold.class).get(13).getImage().setTransparency(i);
getObjects(ausold.class).get(14).getImage().setTransparency(i);
count++;
Greenfoot.delay(3);
}
for(i=255; i>=0; i=i-5)
{
getObjects(Conducator.class).get(0).setLocation(getObjects(Conducator.class).get(0).getX(),getObjects(Conducator.class).get(0).getY()+4);
getObjects(ausold.class).get(13).setLocation(getObjects(ausold.class).get(13).getX(),getObjects(ausold.class).get(13).getY()+4);
getObjects(ausold.class).get(14).setLocation(getObjects(ausold.class).get(14).getX(),getObjects(ausold.class).get(14).getY()+4);
if(count%50>25)
{
getObjects(Conducator.class).get(0).setImage("fatamers2.png");
getObjects(ausold.class).get(13).setImage(animat[0]);
getObjects(ausold.class).get(14).setImage(animat[0]);
}
else
{
getObjects(Conducator.class).get(0).setImage("fatamers1.png");
getObjects(ausold.class).get(13).setImage(animat[1]);
getObjects(ausold.class).get(14).setImage(animat[1]);
}
getObjects(Conducator.class).get(0).getImage().setTransparency(i);
getObjects(ausold.class).get(13).getImage().setTransparency(i);
getObjects(ausold.class).get(14).getImage().setTransparency(i);
count++;
Greenfoot.delay(3);
}
}
/**
* Prepare the world for the start of the program.
* That is: create the initial objects and add them to the world.
*/
private void prepare()
{
ausold ausold = new ausold();
addObject(ausold,419,565);
ausold ausold2 = new ausold();
addObject(ausold2,875,568);
ausold ausold3 = new ausold();
addObject(ausold3,984,637);
ausold ausold4 = new ausold();
addObject(ausold4,1108,549);
ausold ausold5 = new ausold();
addObject(ausold5,291,508);
ausold ausold6 = new ausold();
addObject(ausold6,273,637);
ausold ausold7 = new ausold();
addObject(ausold7,148,526);
ausold ausold8 = new ausold();
addObject(ausold8,1236,520);
ausold ausold9 = new ausold();
addObject(ausold9,1096,645);
ausold ausold10 = new ausold();
addObject(ausold10,96,644);
ausold ausold11 = new ausold();
addObject(ausold11,973,490);
ausold ausold12 = new ausold();
addObject(ausold12,35,476);
ausold ausold13 = new ausold();
addObject(ausold13,376,660);
Conducator conducator = new Conducator();
addObject(conducator,640,405);
conducator.getImage().setTransparency(0);
ausold ausold14 = new ausold();
addObject(ausold14,640,405);
ausold14.setImage("aufront.png");
ausold ausold15 = new ausold();
addObject(ausold15,640,405);
ausold15.setImage("aufront.png");
Inter inter= new Inter();
addObject(inter, 640, 355);
getObjects(Inter.class).get(0).init();
Text text=new Text();
addObject(text, 640, 355);
text.getImage().setTransparency(0);
}
}