-
Notifications
You must be signed in to change notification settings - Fork 0
/
Star.cs
47 lines (47 loc) · 1.48 KB
/
Star.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using My90Tank.Properties;
namespace My90Tank
{
public class Star :Module
{
public static Image img = My90Tank.Properties.Resources.star;
public static Image[] bornImages = new Image[] { Resources.born1, Resources.born2, Resources.born3, Resources.born4 };
private int Borntime = 16;
private int borntime = 0;
public Star(int x,int y):base(x,y,img) {
this.Width = img.Width;
this.Height = img.Height;
}
public override void Draw(Graphics g)
{
if (borntime < Borntime) {
switch (borntime % 8)
{
case 0:
case 1:
g.DrawImage(bornImages[0], this.X, this.Y);
break;
case 2:
case 3:
g.DrawImage(bornImages[1], this.X, this.Y);
break;
case 4:
case 5:
g.DrawImage(bornImages[2], this.X, this.Y);
break;
case 6:
case 7:
g.DrawImage(bornImages[3], this.X, this.Y);
break;
}
borntime++;
return;
}
g.DrawImage(img, this.X, this.Y);
}
}
}