public PlasmaCell(World _level, Texture2D _texture, Vector2 _position, Vector2 _velocity, int _frames, int _animations, Char _direction) : base(_level, _texture, _position, _velocity, _frames, _animations) { animation.Scale = .5f; animation.Depth = 0.1f; aniM.FramesPerSecond = 5; aniM.AddAnimation("swimVerticalDown", 1, _frames, animation.Copy()); //animation.IsLooping = true; aniM.AddAnimation("explodeVerticalDown", 4, _frames, animation.Copy()); aniM.AddAnimation("glowVerticalDown", 6, _frames, animation.Copy()); aniM.AddAnimation("explodeHorzontalRight", 3, _frames, animation.Copy()); aniM.AddAnimation("glowHorizontalRight", 5, _frames, animation.Copy()); //animation.IsLooping = false; aniM.AddAnimation("swimHorzontalRight", 2, _frames, animation.Copy()); animation.SpriteEffect = SpriteEffects.FlipHorizontally; aniM.AddAnimation("swimHorzontalLeft", 2, _frames, animation.Copy()); //animation.IsLooping = true; aniM.AddAnimation("explodeHorzontalLeft", 3, _frames, animation.Copy()); aniM.AddAnimation("glowHorizontalLeft", 5, _frames, animation.Copy()); //animation.IsLooping = false; animation.SpriteEffect = SpriteEffects.FlipVertically; aniM.AddAnimation("swimVerticalUp", 1, _frames, animation.Copy()); //animation.IsLooping = true; aniM.AddAnimation("explodeVerticalUp", 4, _frames, animation.Copy()); aniM.AddAnimation("glowVerticalUp", 6, _frames, animation.Copy()); //animation.IsLooping = false; body.FixtureList[0].UserData = "PlasmaCell"; aniM.Origin = new Vector2(aniM.Width * .5f, aniM.Height *.75f); Type = "Plasma"; rotates = false; direction = _direction; shotList = new List<PlasmaShot>(); faceDirection(); Points = 100; velocity = _velocity; pointList = new Menu.Points(Type, Points, false); //JointFactory.CreateFixedRevoluteJoint(level, body, // new Vector2((float)ConvertUnits.ToSimUnits(0), (float)ConvertUnits.ToSimUnits(20)), // new Vector2((float)ConvertUnits.ToSimUnits(position.X), (float)ConvertUnits.ToSimUnits(position.Y))); }
public MonozytCell(World _level, Texture2D _texture, Vector2 _position, Vector2 _velocity, int _frames, int _animations) : base(_level, _texture, _position, _velocity, _frames, _animations) { animation.Depth = 0.058f; animation.Scale = .25f; aniM.FramesPerSecond = 10; aniM.AddAnimation("spin", 1, _frames - 1, animation.Copy()); aniM.AddAnimation("attack", 3, _frames, animation.Copy()); animation.IsLooping = false; aniM.AddAnimation("die", 2, _frames - 1, animation.Copy()); spawn = position; position = new Vector2(position.X + 10f, position.Y); body.IgnoreGravity = false; body.Mass = .1f; body.Restitution = 0f; body.LinearDamping = .75f; aniM.Animation = "spin"; body.FixtureList[0].UserData = "monozyt"; Type = "Monozyt"; rotates = false; pointList = new Menu.Points(Type, 0, false); }
public CollectCell(World _level, Texture2D _texture, Vector2 _position, Vector2 _velocity, int _frames, int _animations) : base(_level, _texture, _position, _velocity, _frames, _animations) { animation.Scale = .15f; animation.Depth = 0.2f; aniM.FramesPerSecond = 9; aniM.AddAnimation("float", 1, _frames, animation.Copy()); aniM.Animation = "float"; body.FixtureList[0].UserData = "collectable"; body.IsSensor = true; Type = "collectable"; rotates = false; Points = 100; body.Mass = 0.01f; body.Restitution = 0f; //slows the object when no force applied body.LinearDamping = .75f; body.CollidesWith = ~Category.All | Category.Cat5; pointList = new Menu.Points(Type, Points, true); JointFactory.CreateFixedRevoluteJoint(level, body, body.LocalCenter, new Vector2((float)ConvertUnits.ToSimUnits(_position.X), (float)ConvertUnits.ToSimUnits(_position.Y))); }