Esempio n. 1
0
		public EntityFireWeapon(PointF pnt, Object[] obj, byte[,,] chips, EntityList par)
		{
			Location = pnt;
			Mpts = obj;
			Map = chips;
			Parent = par;
			Size = new Size(8, 8);
			SetAnime(3, 6, 8);
			var vec = new Vector();
			if (GameEngine.Ks.Inup)
				vec.Y = -1;
			if (GameEngine.Ks.Indown)
				vec.Y = 1;
			if (GameEngine.Ks.Inleft)
				vec.X = -1;
			else if (GameEngine.Ks.Inright)
				vec.X = 1;

			vec *= 4f;

			Velocity = vec;
		}
Esempio n. 2
0
		public EntityFeather(PointF pnt, Object[] obj, byte[,,] chips, EntityList par)
		{
			Location = pnt;
			Mpts = obj;
			Map = chips;
			Parent = par;
			Size = new Size(16, 16);
			SetGraphic(5);
			Velocity = new Vector(0, -0.9f);
			MainAi = new AiWalk(this, 1, 5, 5, 5, 5);
		}
Esempio n. 3
0
		public EntityGrimoire(PointF pnt, Object[] obj, byte[,,] chips, EntityList par)
		{
			Location = pnt;
			Mpts = obj;
			Map = chips;
			Parent = par;
			Size = new Size(16, 16);
			SetAnime(10, 13, 8);
			Velocity = new Vector(0, -2.0f);
		}
Esempio n. 4
0
		public EntityChocolate(PointF pnt, Object[] obj, byte[,,] chips, EntityList par)
		{
			Location = pnt;
			Mpts = obj;
			Map = chips;
			Parent = par;
			Size = new Size(16, 16);
			Velocity = new Vector(0, -2.4f);
			SetGraphic(5);
		}
Esempio n. 5
0
		public EntityLeafWeapon(PointF pnt, Object[] obj, byte[,,] chips, EntityList par)
		{
			Location = pnt;
			Mpts = obj;
			Map = chips;
			Parent = par;
			Size = new Size(8, 8);
			SetGraphic(2);
			Entity ent = null;
			var min = float.MaxValue;

			if (Parent.Count(en => en is EntityLeafWeapon) > 3)
				Kill();

			foreach (var e in from entity in Parent
				where entity.MyGroup == EntityGroup.Enemy
				select entity)
				if (Math.Abs(Location.X - e.Location.X) < min)
				{
					min = Math.Abs(Location.X - e.Location.X);
					ent = e;
				}

			var r = ent != null
				? Math.Atan2(Location.Y - ent.Location.Y, Location.X - ent.Location.X)
				: DevelopUtility.Deg2Rad(GetRand(360));

			float x = -(float) Math.Cos(r) * 5,
				y = -(float) Math.Sin(r) * 5;

			Velocity = new Vector(x, y);
		}
 /// <summary>
 ///     変数をバックアップし、次フレームに持ち越す処理をします。
 /// </summary>
 public virtual void Backup()
 {
     BLocation = Location;
     BVelocity = Velocity;
 }