-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMudTrueTile.cs
59 lines (42 loc) · 1.08 KB
/
MudTrueTile.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace monowizard
{
internal class MudTrueTile : Truetile
{
TileManager tileManager;
public int tileind;
int aniframe = 0;
//int health = 4;
public MudTrueTile(int ind, TileManager tileManager)
{
tileind = ind;
this.tileManager = tileManager;
croprect = new Microsoft.Xna.Framework.Rectangle(0, 256, 128, 128);
}
public override void Activate(int side, Entity e)
{
e.xvel = e.xvel / 2;
e.yvel = e.yvel / 2;
if (e is Player)
{
((Player)e).muddy = true;
}
}
public override void Update()
{
aniframe++;
if(aniframe == 80)
{
aniframe = 0;
croprect.X = 0;
}else if(aniframe % 20 == 0)
{
croprect.X += 128;
}
}
}
}