コード例 #1
0
 public Agent(Vector2 pos, string name, Tag tag, CharacterStats characterStats) : base(Type.Agent, name)
 {
     this.PositionXY     = pos;
     this.characterStats = characterStats;
     this.tag            = tag;
     size             = new Point(8);
     origin           = size.ScaleRet(new Vector2(.5f, .5f));
     type             = Type.Agent;
     collider         = new Collider.Circle(PositionXY, 0, 10, false);
     collider.heightZ = 32;
     healthBar        = new GUI.ProgressBar(Rectangle.Empty, Color.Red, 1f, Game1.pixel, true, false);
 }
コード例 #2
0
ファイル: Projectile.cs プロジェクト: Felle321/TitanBenk
 public Fireball(Vector3 position, Vector3 movement, Agent.Tag ignore) : base(position, movement, ignore, "Fireball")
 {
     position.Z = 10;
     collider   = new Collider.Circle(PositionXY, position.Z, 6f, false);
     agentTagsToIgnore.Add(Agent.Tag.Player);
     sprite        = new AnimatedSprite(textures["Fireball"], new Point(64, 32), 16);
     sprite.speed  = .3f;
     sprite.repeat = true;
     useGravity    = false;
     airResistance = 1f;
     collisionTypesToIgnore.Add(Type.Projectile);
     collisionTypesToIgnore.Add(Type.Particle);
     collisionTypesToIgnore.Add(Type.Null);
     sprite.affectedByLight = 2;
     bounceFactor           = 1;
     friction = 1;
 }
コード例 #3
0
ファイル: Projectile.cs プロジェクト: Felle321/TitanBenk
 public BouncingBall(Vector3 position, Vector3 movement, Agent.Tag ignore) : base(position, movement, ignore, "BouncingBall")
 {
     position.Z = 10;
     collider   = new Collider.Circle(PositionXY, position.Z, 8f, false);
     agentTagsToIgnore.Add(Agent.Tag.Player);
     sprite        = new AnimatedSprite(textures["BouncingBall"], new Point(32, 32), 0);
     sprite.speed  = .3f;
     sprite.repeat = true;
     useGravity    = true;
     usePhysics    = true;
     airResistance = .99f;
     friction      = .8f;
     bounceFactor  = .99f;
     collisionTypesToIgnore.Add(Type.Projectile);
     collisionTypesToIgnore.Add(Type.Particle);
     collisionTypesToIgnore.Add(Type.Null);
 }