Defines a Tile, which can be positioned and drawn in the world and is compatible with collision
Inheritance: Zeplin.GameObject, ICollisionVolumeProvider
Esempio n. 1
0
 public DungeonTile(Sprite sprite, Rectangle extent, TileType type, AnimationScript script)
     : base(sprite, script)
 {
     SubRect = extent;
     _extent = extent;
     _type = type;
     if (script != null) script.Loop = true; // hack: this really shouldn't beee heeeeere
     FrameSize = new Point(24, 24);
 }
Esempio n. 2
0
File: Tile.cs Progetto: vogon/Zeplin
        public Tile(Sprite sprite, Transformation transformation, AnimationScript animation, SATCollisionVolume collider)
        {
            this.Sprite = sprite;
            SubRect = new Rectangle(0, 0, sprite.Image.Width, sprite.Image.Height);

            this.Transformation = new Transformation(transformation);
            this.AnimationScript = animation;
            this.CollisionVolume = collider;

            OnDraw += this.Draw;

            if (CollisionVolume != null)
            {
                OnUpdate += delegate(GameTime time) { collider.TransformCollisionVolume(this.Transformation); };
            }
        }
Esempio n. 3
0
File: Tile.cs Progetto: vogon/Zeplin
 public Tile(Sprite sprite, Transformation transformation, SATCollisionVolume collider)
     : this(sprite, transformation, null, collider)
 {
 }
Esempio n. 4
0
File: Tile.cs Progetto: vogon/Zeplin
 public Tile(Sprite sprite, AnimationScript animation)
     : this(sprite, new Transformation(), animation, null)
 {
 }
Esempio n. 5
0
File: Tile.cs Progetto: vogon/Zeplin
 /// <summary>
 /// Constructs a tile with a sprite and a transformation
 /// </summary>
 /// <param name="sprite"></param>
 /// <param name="transformation"></param>
 public Tile(Sprite sprite, Transformation transformation)
     : this(sprite, transformation, null, null)
 {
 }
Esempio n. 6
0
File: Tile.cs Progetto: vogon/Zeplin
 public Tile(Sprite sprite)
     : this(sprite, new Transformation(), null, null)
 {
 }
Esempio n. 7
0
 /// <summary>
 /// Creates a MenuItem with a Sprite and Transformation
 /// </summary>
 /// <param name="sprite"></param>
 /// <param name="transformation"></param>
 public MenuItem(Sprite sprite, Transformation transformation)
 {
     this.Sprite = sprite;
     this.Transformation = transformation;
 }
Esempio n. 8
0
 public DungeonTile(Sprite sprite, Rectangle extent, TileType type)
     : this(sprite, extent, type, (AnimationScript)null)
 {
 }
Esempio n. 9
0
 /// <summary>
 /// An Actor can be drawn on screen, translated around arbitrarily, collide with other game objects, and process update logic every frame.
 /// </summary>
 /// <param name="sprite">The artwork the actor will use during Draw.</param>
 /// <param name="transformation">Positioning information.</param>
 public Actor(Sprite sprite, Transformation transformation)
     : this(sprite, transformation, new SATCollisionVolume())
 {
 }
Esempio n. 10
0
 /// <summary>
 /// An Actor can be drawn on screen, translated around arbitrarily, collide with other game objects, and process update logic every frame.
 /// </summary>
 /// <param name="sprite">The artwork the actor will use during Draw.</param>
 /// <param name="transformation">Positioning information.</param>
 /// <param name="collider">A collision shape that mirrors the transformation.</param>
 public Actor(Sprite sprite, Transformation transformation, SATCollisionVolume collider)
     : base(sprite, transformation, collider)
 {
 }