-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBullet.cs
44 lines (38 loc) · 882 Bytes
/
Bullet.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
using System;
using System.Collections.Generic;
using System.Text;
namespace zooiiscool
{
enum SenderType
{
player,
badguy
};
class Bullet : Entity
{
float speed = 420;
float time = 0f;
float maxtime = 20;
float direction = 0f;
public override void Start()
{
texture = "pluto.png";
}
public SenderType type;
public Bullet(float speed, float direction, SenderType type)
{
this.speed = speed;
this.type = type;
this.direction = direction;
}
public override void Update()
{
time += Time.DeltaTime;
if(time >= maxtime)
{
active = false;
}
position.X += direction*speed * Time.DeltaTime;
}
}
}