-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathman
62 lines (52 loc) · 1.19 KB
/
man
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
using Pukaj.Properties;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Pukaj
{
public class man{
public enum DIRECTION
{
RIGHT,
LEFT,
}
public int X { get; set; }
public int Y { get; set; }
public Image coveche;
public DIRECTION Direction;
public Rectangle Bounds;
public man()
{
X = 150;
Y = 300;
coveche = Resources.man;
Direction = DIRECTION.LEFT;
}
public void ChangeDirection(DIRECTION direction)
{
Direction = direction;
}
public void Move(int width, int height)
{
if (Direction == DIRECTION.RIGHT)
{
X += 1;
if (X >= width)
{
X = width - 1;
}
}
if (Direction == DIRECTION.LEFT)
{
X -= 1;
if (X < 0)
{
X = 0;
}
}
}
}
}