예제 #1
0
        public Particle(
            IParent parent,
            string textureId, 
            float LifeTime, 
            Color color,
            World world,
            Vector2 position = new Vector2(),
            bool collidable = false,
            float layerDepth = 0.5f)
            : base(parent: parent, 
                    position: position, 
                    collidable: collidable)
        {
            this.TextureId = textureId;
            this.LifeTime = LifeTime;
            this.Color = color;
            this._parent = parent;

            LayerDepth = layerDepth;

            if (collidable) {
                MovableBehaviour = new MovableBehaviour(this);
            }
            LastFrameBounds = Bounds;
        }
예제 #2
0
        public Character(IParent parent, ISpawn spawn = null)
            : base(parent)
        {
            Spawn = spawn;
            MovableBehaviour = new MovableBehaviour();

            _onDieListeners = new List<Delegate>();
            _colorBehaviour = new ColorBehaviour(this);

            WalkingAcceleration = 15;
            WalkingSpeed = 40;
            jumpPower = 42;
        }
예제 #3
0
 public override void Initialize()
 {
     base.Initialize();
     Direction = Direction;
     OriginalPosition = Position;
     MovableBehaviour = new MovableBehaviour(this);
     _collisionWith = new Dictionary<Character, Collision>();
 }