Exemplo n.º 1
0
        //Character attributes
        public BasicGroundEnemy(Game game, Vector position, Vector velocity, Dictionary<string, Sprite> sprites, string defaultSprite, IController controller, //GameObject attributes
		               WorldPhysics worldPhysics, ObjectPhysics objectPhysics, Dictionary<string, BoundingPolygon> boundingPolygons,	//PhysicalObject attributes
		               double runSpeed, double maxSpeed)
            : base(game, position, velocity, sprites, defaultSprite, controller, worldPhysics, objectPhysics, boundingPolygons, runSpeed, maxSpeed)
        {
            Stompable = true;
        }
Exemplo n.º 2
0
        //Just pass on the constructor stuff to base
        public Character(Game game, Vector position, Vector velocity, Dictionary<string, Sprite> sprites, string defaultSprite, IController controller, 
		                 WorldPhysics worldPhysics, ObjectPhysics objectPhysics, Dictionary<string, BoundingPolygon> boundingPolygons,
		                 double runSpeed, double maxSpeed)
            : base(game, position, velocity, sprites, defaultSprite, controller, worldPhysics, objectPhysics, boundingPolygons)
        {
            CurrentSprite.PlayAnimation("stand", true);
            MaxSpeed = maxSpeed;
            RunSpeed = runSpeed;
        }
Exemplo n.º 3
0
        public PhysicalObject(Game game, Vector position, Vector velocity, Dictionary<string, Sprite> sprites, string defaultSprite, IController controller, 
		                       WorldPhysics worldPhysics, ObjectPhysics objectPhysics, Dictionary<string, BoundingPolygon> boundingPolygons)
            : base(game, position, velocity, sprites, defaultSprite, controller, boundingPolygons)
        {
            this.worldPhysics = worldPhysics;
            this.objectPhysics = objectPhysics;
            this.friction = objectPhysics.Friction*worldPhysics.GroundFrictionFactor;
            inAirTimer.Start();
        }
Exemplo n.º 4
0
        public Player(Game game, Vector position, Vector velocity, Dictionary<string, Sprite> sprites, string defaultSprite, IController controller, //GameObject attributes
		               WorldPhysics worldPhysics, ObjectPhysics objectPhysics, Dictionary<string, BoundingPolygon> boundingPolygons, //PhysicalObject attributes
		               double runSpeed, double maxSpeed, 	//Character attributes
		               PlayerState state)
            : base(game, position, velocity, sprites, defaultSprite, controller, worldPhysics, objectPhysics, boundingPolygons, runSpeed, maxSpeed)
        {
            oldFriction = objectPhysics.Friction;
            PlayerState = state;

            invincibleTimer.Start();
        }
Exemplo n.º 5
0
        public Mushroom(Game game, 
		                    Vector position, 
		                    Dictionary<string, Sprite> sprites, string defaultSprite, 
		                    WorldPhysics worldPhysics, ObjectPhysics objectPhysics, 
		                    Dictionary<string, BoundingPolygon> polygons, 
		                    ItemType itemType)
            : base(game, position, new Vector(0,0), sprites, defaultSprite, new DumbGroundAI(), worldPhysics, objectPhysics, polygons)
        {
            CurrentSprite.PlayAnimation(Sprite.DEFAULT_ANIMATION, true);
            MushroomType = itemType;
        }