Ejemplo n.º 1
0
 public Shuriken(World world)
     : base(world)
 {
     init(new Rectangle(0, 0, 15, 14));
     setAnimation(new GFX.Animation(world.Game.TextureManager.shuriken_anim));
     currentAnim.play();
     AffectedByGravity = false;
     collisionArea     = new Rectangle(0, 0, 15, 14);
     entityMask        = EntityStaticMask.fromTexture(this, world.Game.TextureManager.shurikenMask);
     createTimer().setDelay(2000, delegate() { this.destroy(); });
     createTimer().setDelay(300, delegate() { AffectedByGravity = true; });
 }
Ejemplo n.º 2
0
 public EnemyWolf(World world)
     : base(world, 10)
 {
     init(new Microsoft.Xna.Framework.Rectangle(0, 0, 32, 32));
     setAnimation(new Animation(world.Game.TextureManager.rabbit_walkW));
     currentAnim.play();
     entityMask    = EntityStaticMask.fromTexture(this, world.Game.TextureManager.rabbitMask);
     collisionArea = new Microsoft.Xna.Framework.Rectangle(0, 0, 32, 32);
     color         = Color.Pink;
     AI.addAIStep(new AI.EntityAIFlipAnimation(this, true));
     AI.addAIStep(new AI.EntityAIMoveUntilStopped(this, 0.35f, false));
     AI.addAIStep(new AI.EntityAIFlipAnimation(this, false));
     AI.addAIStep(new AI.EntityAIMoveUntilStopped(this, 0.35f, true));
 }
Ejemplo n.º 3
0
 public Player(World world)
     : base(world, 20)
 {
     init(new Rectangle(0, 0, 32, 32));
     walkW = new Animation(world.Game.TextureManager.rabbit_walkW);
     setAnimation(walkW);
     currentAnim.play();
     //base.setTexture(world.Game.TextureManager.rabbitMask);
     entityMask = EntityStaticMask.fromTexture(this, world.Game.TextureManager.rabbitMask);
     //entityMask = new EntityDynamicMask(this);
     System.IO.MemoryStream mem = new System.IO.MemoryStream();
     Files.TileMaskFilePart.toStream(mem, EntityStaticMask.fromTexture(this, world.Game.TextureManager.rabbitMask));
     collisionArea = new Rectangle(0, 0, 32, 32);
     canDamage     = true;
     damageTimer   = createTimer();
     blinkTimer    = createTimer();
     moveTimer     = createTimer();
     mass          = 100f;
 }