-
Notifications
You must be signed in to change notification settings - Fork 0
/
LevelForm.cs
380 lines (338 loc) · 12.1 KB
/
LevelForm.cs
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
namespace claustrophobia
{
public partial class LevelForm : Form
{
int locationVeribal = -1;
public LevelForm()
{
InitializeComponent();
//Cursor.Show();
LoadFonts.LoadFont();
//применение шрифтов к первой локации
LoadFonts.loadFontsForForm(headLabelOne, 80);
LoadFonts.loadFontsForForm(label1, 36);
LoadFonts.loadFontsForForm(label2, 36);
LoadFonts.loadFontsForForm(label3, 36);
LoadFonts.loadFontsForForm(label4, 36);
LoadFonts.loadFontsForForm(label5, 36);
LoadFonts.loadFontsForForm(label6, 36);
LoadFonts.loadFontsForForm(label7, 36);
LoadFonts.loadFontsForForm(label8, 36);
//применение шрифтов ко второй локации
LoadFonts.loadFontsForForm(headLabelTwo, 80);
LoadFonts.loadFontsForForm(label11, 36);
LoadFonts.loadFontsForForm(label12, 36);
LoadFonts.loadFontsForForm(label13, 36);
LoadFonts.loadFontsForForm(label14, 36);
LoadFonts.loadFontsForForm(label15, 36);
LoadFonts.loadFontsForForm(label16, 36);
LoadFonts.loadFontsForForm(label17, 36);
LoadFonts.loadFontsForForm(label18, 36);
//применение шрифтов к третьей локации
LoadFonts.loadFontsForForm(headLabelThree, 80);
LoadFonts.loadFontsForForm(label20, 36);
LoadFonts.loadFontsForForm(label21, 36);
LoadFonts.loadFontsForForm(label22, 36);
LoadFonts.loadFontsForForm(label23, 36);
LoadFonts.loadFontsForForm(label24, 36);
LoadFonts.loadFontsForForm(label25, 36);
LoadFonts.loadFontsForForm(label26, 36);
LoadFonts.loadFontsForForm(label27, 36);
//применение шрифтов к обучающей локации
LoadFonts.loadFontsForForm(headLabelTraning, 80);
LoadFonts.loadFontsForForm(label53, 36);
LoadFonts.loadFontsForForm(label54, 36);
LoadFonts.loadFontsForForm(label55, 36);
LoadFonts.loadFontsForForm(label56, 36);
}
//----------------стрелки перелистывания локаций-------------
private void arrowRight0_Click(object sender, EventArgs e)
{
locationVeribal = 01;
timer1.Start();
}
private void arrowRight_Click(object sender, EventArgs e)
{
locationVeribal = 10;
timer1.Start();
}
private void arrowLeft1_Click(object sender, EventArgs e)
{
locationVeribal = 11;
timer1.Start();
}
private void arrowRight2_Click(object sender, EventArgs e)
{
locationVeribal = 20;
timer1.Start();
}
private void arrowLeft2_Click(object sender, EventArgs e)
{
locationVeribal = 21;
timer1.Start();
}
private void arrowLeft3_Click(object sender, EventArgs e)
{
locationVeribal = 31;
timer1.Start();
}
//------------------------------------------------------------
private void timer1_Tick(object sender, EventArgs e)
{
switch (locationVeribal)
{
case 01:
locationOne.Width += 40;
if (locationOne.Width >= ClientSize.Width)
timer1.Stop();
break;
case 10:
locationTwo.Width += 40;
if (locationTwo.Width >= ClientSize.Width)
timer1.Stop();
break;
case 11:
locationOne.Width -= 40;
if (locationOne.Width == 0)
timer1.Stop();
break;
case 20:
locationThree.Width += 40;
if (locationThree.Width >= ClientSize.Width)
timer1.Stop();
break;
case 21:
locationTwo.Width -= 40;
if (locationTwo.Width == 0)
timer1.Stop();
break;
case 31:
locationThree.Width -= 40;
if (locationThree.Width == 0)
timer1.Stop();
break;
default:
break;
}
}
//----------------------------кнопка закрытия----------------------
private void CloseButton_Click(object sender, EventArgs e)
{
this.Close();
}
private void CloseButton_MouseEnter(object sender, EventArgs e)
{
(sender as PictureBox).Image = Properties.Resources.closeRedBackground;
}
private void CloseButton_MouseLeave(object sender, EventArgs e)
{
(sender as PictureBox).Image = Properties.Resources.ButtonClose;
}
//------------------------------------------------------------------
//-----------------------Стрелки выбора уровня---------------------
private void arrowRight1_MouseEnter(object sender, EventArgs e)
{
(sender as PictureBox).Left += 10;
}
private void arrowRight1_MouseLeave(object sender, EventArgs e)
{
(sender as PictureBox).Left -= 10;
}
private void arrowLeft1_MouseEnter(object sender, EventArgs e)
{
(sender as PictureBox).Left -= 10;
}
private void arrowLeft1_MouseLeave(object sender, EventArgs e)
{
(sender as PictureBox).Left += 10;
}
//-----------------------------------------------------------------
//---------------------подсветка уровня-----------------------
private void label56_MouseEnter(object sender, EventArgs e)
{
(sender as Label).Font = new Font(LoadFonts.font.Families[0], 40);
SoundClass.PlayStart();
}
private void label56_MouseLeave(object sender, EventArgs e)
{
(sender as Label).Font = new Font(LoadFonts.font.Families[0], 36);
}
//------------------------------------------------------------
//-------------------------выбор уровня-----------------------
private void pictureBox29_Click(object sender, EventArgs e)
{
T_L1 T_L1 = new T_L1();
SoundClass.PlayBackground();
T_L1.ShowDialog();
}
private void pictureBox28_Click(object sender, EventArgs e)
{
T_L2 T_L2 = new T_L2();
SoundClass.PlayBackground();
T_L2.ShowDialog();
}
private void pictureBox27_Click(object sender, EventArgs e)
{
T_L3 T_L3 = new T_L3();
SoundClass.PlayBackground();
T_L3.ShowDialog();
}
private void pictureBox26_Click(object sender, EventArgs e)
{
T_L4 T_L4 = new T_L4();
SoundClass.PlayBackground();
T_L4.ShowDialog();
}
private void levelOne1_Click(object sender, EventArgs e)
{
L1_L1 L1_L1 = new L1_L1();
SoundClass.PlayBackground();
L1_L1.ShowDialog();
}
private void levelTwo1_Click(object sender, EventArgs e)
{
L1_L2 L1_L2 = new L1_L2();
SoundClass.PlayBackground();
L1_L2.ShowDialog();
}
private void levelThree1_Click(object sender, EventArgs e)
{
L1_L3 L1_L3 = new L1_L3();
SoundClass.PlayBackground();
L1_L3.ShowDialog();
}
private void levelFour1_Click(object sender, EventArgs e)
{
L1_L4 L1_L4 = new L1_L4();
SoundClass.PlayBackground();
L1_L4.ShowDialog();
}
private void levelFive1_Click(object sender, EventArgs e)
{
L1_L5 L1_L5 = new L1_L5();
SoundClass.PlayBackground();
L1_L5.ShowDialog();
}
private void levelSix1_Click(object sender, EventArgs e)
{
L1_L6 L1_L6 = new L1_L6();
SoundClass.PlayBackground();
L1_L6.ShowDialog();
}
private void levelSeven1_Click(object sender, EventArgs e)
{
L1_L7 L1_L7 = new L1_L7();
SoundClass.PlayBackground();
L1_L7.ShowDialog();
}
private void levelEight1_Click(object sender, EventArgs e)
{
L1_L8 L1_L8 = new L1_L8();
SoundClass.PlayBackground();
L1_L8.ShowDialog();
}
//отображение прогресса
private void timer2_Tick(object sender, EventArgs e)
{
if (ProgressClass.progressMass[0, 0] == 1)
{
levelOne1.Visible = false;
label9.Visible = true;
label9.Text = ProgressClass.timeMass[0, 0];
}
else
{
levelOne1.Visible = true;
label9.Visible = false;
}
if (ProgressClass.progressMass[0, 1] == 1)
{
levelTwo1.Visible = false;
label10.Visible = true;
label10.Text = ProgressClass.timeMass[0, 1];
}
else
{
levelTwo1.Visible = true;
label10.Visible = false;
}
if (ProgressClass.progressMass[0, 2] == 1)
{
levelThree1.Visible = false;
label19.Visible = true;
label19.Text = ProgressClass.timeMass[0, 2];
}
else
{
levelThree1.Visible = true;
label19.Visible = false;
}
if (ProgressClass.progressMass[0, 3] == 1)
{
levelFour1.Visible = false;
label28.Visible = true;
label28.Text = ProgressClass.timeMass[0, 3];
}
else
{
levelFour1.Visible = true;
label28.Visible = false;
}
if (ProgressClass.progressMass[0, 4] == 1)
{
levelFive1.Visible = false;
label29.Visible = true;
label29.Text = ProgressClass.timeMass[0, 4];
}
else
{
levelFive1.Visible = true;
label29.Visible = false;
}
if (ProgressClass.progressMass[0, 5] == 1)
{
levelSix1.Visible = false;
label30.Visible = true;
label30.Text = ProgressClass.timeMass[0, 5];
}
else
{
levelSix1.Visible = true;
label30.Visible = false;
}
if (ProgressClass.progressMass[0, 6] == 1)
{
levelSeven1.Visible = false;
label31.Visible = true;
label31.Text = ProgressClass.timeMass[0, 6];
}
else
{
levelSeven1.Visible = true;
label31.Visible = false;
}
if (ProgressClass.progressMass[0, 7] == 1)
{
levelEight1.Visible = false;
label32.Visible = true;
label32.Text = ProgressClass.timeMass[0, 7];
}
else
{
levelEight1.Visible = true;
label32.Visible = false;
}
}
//------------------------------------------------------------
}
}