-
Notifications
You must be signed in to change notification settings - Fork 0
/
ShootingEntity.cs
37 lines (32 loc) · 1.12 KB
/
ShootingEntity.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
using SquareGraphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KosmiczniNajeźdźcy
{
abstract class ShootingEntity : Entity
{
protected int pointVal;
int bulletDamage;
protected ShootingEntity(Point pos, int pixelSize, bool allowUpDownMove, SquareGraphic graphic, int pointVal, int bulletDamage) : base(pos, pixelSize, allowUpDownMove, graphic)
{
this.pointVal = pointVal;
this.bulletDamage = bulletDamage;
}
protected ShootingEntity(Point pos, SquareGraphic graphic, int pointVal): this(pos,GameController.PixelSize,true,graphic, pointVal, 1)
{
}
public int PointVal => pointVal;
public abstract Point GunExit
{
get;
}
protected abstract int yBulletSpeed { get; }
public virtual Bullet Fire(Color bulletColor)
{
return new Bullet(yBulletSpeed, Pos.X + GunExit.X, Pos.Y + GunExit.Y, bulletDamage,GameController.PixelSize, bulletColor);
}
}
}