Example #1
0
        public Snake(int x, int y)
        {
            Weight   = 100;
            Behavior = new SnakeBehavior();
            Behavior.Initialize(this);

            Texture = ContentHelper.LoadTexture("Enemies/snake");
            SetPosition(new Vector2(x, y));
            CollRectangle   = new Rectangle(0, 0, 32 * 2, 48 * 2);
            SourceRectangle = new Rectangle(0, 0, 32, 48);

            _complexAnimation.AddAnimationData("still", new ComplexAnimData(1, Texture, new Rectangle(0, 0, 32, 48), 0, 32, 48, 125, 8, true));

            _complexAnimation.AddAnimationData("attack", new ComplexAnimData()
            {
                Priority       = 1000,
                Texture        = Texture,
                DeltaRectangle = new Rectangle(0, 0, 32, 48),
                StartingY      = SourceRectangle.Height * 1,
                Width          = SourceRectangle.Width,
                Height         = SourceRectangle.Height,
                Speed          = 50,
                FrameCount     = 8,
                IsRepeating    = false,
            });

            Sounds.AddSoundRef("idle", "Sounds/Snake/snake_idle");
            Sounds.AddSoundRef("spit", "Sounds/Snake/snake_spit");
            Sounds.AddSoundRef("death", "Sounds/Snake/snake_death");
        }
Example #2
0
        public Frog(int x, int y)
        {
            Weight   = 90;
            Behavior = new FrogBehavior();
            Behavior.Initialize(this);

            Texture = ContentHelper.LoadTexture("Enemies/frog");
            SetPosition(new Vector2(x, y));
            CollRectangle   = new Rectangle(0, 0, 32, 32);
            SourceRectangle = new Rectangle(0, 0, 24, 32);

            _complexAnimation.AddAnimationData("still", new ComplexAnimData(1, Texture, new Rectangle(4, 16, 24, 32), 0, 24, 32, 125, 4, true));
            _complexAnimation.AddAnimationData("jump", new ComplexAnimData(100, Texture, new Rectangle(4, 16, 24, 32), 32, 24, 32, 50, 4, false));

            Sounds.AddSoundRef("jump", "Sounds/Frog/frog_jump");
            Sounds.AddSoundRef("idle", "Sounds/Frog/frog_croak");
        }
Example #3
0
        public StoneGolem(int x, int y)
        {
            Weight   = 90;
            Behavior = new StoneGolemBehavior();
            Behavior.Initialize(this);

            Texture = ContentHelper.LoadTexture("Enemies/stone_golem");
            SetPosition(new Vector2(x, y));
            CollRectangle   = new Rectangle(0, 0, 18 * 2, 25 * 2);
            SourceRectangle = new Rectangle(0, 0, 32, 32);

            _complexAnimation.AddAnimationData("idle", new ComplexAnimData(1, Texture, new Rectangle(5, 7, 18, 25), 0, 32, 32, 200, 4, true));
            _complexAnimation.AddAnimationData("walk", new ComplexAnimData(100, Texture, new Rectangle(5, 7, 18, 25), 32, 32, 32, 125, 4, true));

            Sounds.AddSoundRef("jump", "Sounds/Frog/frog_jump");
            Sounds.AddSoundRef("idle", "Sounds/Frog/frog_croak");
        }
Example #4
0
        public Player(PlayerIndex playerIndex)
        {
            PlayerIndex = playerIndex;
            script.Initialize(this);
            Weight = 100;
            Texture2D edenTexture;

            if (PlayerIndex == PlayerIndex.One)
            {
                edenTexture = ContentHelper.LoadTexture("Characters/dot/dot");
            }
            else
            {
                edenTexture = ContentHelper.LoadTexture("Characters/dot/dot_green");
            }

            var idlePoop = ContentHelper.LoadTexture("Characters/adam_poop");

            var ninjaDash        = ContentHelper.LoadTexture("Characters/adam_ninja");
            var fallStandTexture = ContentHelper.LoadTexture("Characters/adam_fall");
            var fightTexture     = ContentHelper.LoadTexture("Characters/adam_punch");
            var punchTexture     = ContentHelper.LoadTexture("Characters/time_punch");

            AttackSound = new SoundFx("Player/attackSound");

            _complexAnimation.AnimationEnded        += ComplexAnim_AnimationEnded;
            _complexAnimation.AnimationStateChanged += ComplexAnim_AnimationStateChanged;
            _complexAnimation.FrameChanged          += ComplexAnim_FrameChanged;

            // Animation information.
            CollRectangle   = new Rectangle(0, 0, 24, 64);
            SourceRectangle = new Rectangle(0, 0, 24, 40);

            // Animation textures.
            _complexAnimation.AddAnimationData("editMode",
                                               new ComplexAnimData(9999, edenTexture, new Rectangle(6, 7, 12, 66), 0, 24, 40, 400, 4, true));
            _complexAnimation.AddAnimationData("idle",
                                               new ComplexAnimData(0, edenTexture, new Rectangle(6, 7, 12, 66), 0, 24, 40, 400, 4, true));
            _complexAnimation.AddAnimationData("smellPoop",
                                               new ComplexAnimData(1, idlePoop, new Rectangle(6, 7, 12, 66), 0, 24, 40, 125, 21, false));
            _complexAnimation.AddAnimationData("sleep",
                                               new ComplexAnimData(1, edenTexture, new Rectangle(6, 7, 12, 66), 200, 24, 40, 125, 4, true));
            //ComplexAnim.AddAnimationData("idle",
            //    new ComplexAnimData(0, edenTexture, new Rectangle(6, 7, 12, 66), 400, 24, 40, 125, 4, true));
            _complexAnimation.AddAnimationData("oldWalk",
                                               new ComplexAnimData(100, edenTexture, new Rectangle(6, 7, 12, 66), 40, 24, 40, 25, 4, true));
            _complexAnimation.AddAnimationData("walk",
                                               new ComplexAnimData(150, edenTexture, new Rectangle(6, 7, 12, 66), 240, 24, 40, 125, 4, true));
            _complexAnimation.AddAnimationData("slide",
                                               new ComplexAnimData(153, edenTexture, new Rectangle(6, 7, 12, 66), 280, 24, 40, 125, 4, true));
            _complexAnimation.AddAnimationData("standup",
                                               new ComplexAnimData(155, fallStandTexture, new Rectangle(15, 7, 12, 66), 0, 45, 40, 125, 3, false));
            _complexAnimation.AddAnimationData("duck",
                                               new ComplexAnimData(156, fallStandTexture, new Rectangle(15, 7, 12, 66), 40, 45, 40, 125, 3, false));
            _complexAnimation.AddAnimationData("jump",
                                               new ComplexAnimData(200, edenTexture, new Rectangle(6, 7, 12, 66), 80, 24, 40, 250, 4, false));
            _complexAnimation.AddAnimationData("climb",
                                               new ComplexAnimData(900, edenTexture, new Rectangle(6, 7, 12, 66), 160, 24, 40, 75, 4, true));
            _complexAnimation.AddAnimationData("fall",
                                               new ComplexAnimData(1000, edenTexture, new Rectangle(6, 7, 12, 66), 120, 24, 40, 125, 4, true));
            _complexAnimation.AddAnimationData("ninjaDash",
                                               new ComplexAnimData(1100, ninjaDash, new Rectangle(19, 8, 12, 66), 0, 48, 40, 200, 1, false));
            _complexAnimation.AddAnimationData("punch",
                                               new ComplexAnimData(1110, punchTexture, new Rectangle(25, 7, 11, 33), 0, 60, 40, 75, 3, false));
            _complexAnimation.AddAnimationData("punch2",
                                               new ComplexAnimData(1111, fightTexture, new Rectangle(6, 7, 12, 66), 80, 24, 40, 75, 4, false));
            // ComplexAnim.AddAnimationData("death",
            //new ComplexAnimData(int.MaxValue, edenTexture, new Rectangle(6, 7, 12, 66), 280, 24, 40, 125, 4, true));

            // Sounds
            Sounds.AddSoundRef("hurt", "Player/hurtSound");
            Sounds.AddSoundRef("jump", "Player/jumpSound");
            Sounds.AddSoundRef("stomp", "Player/jumpSound");
            Sounds.AddSoundRef("fail", "Sounds/Menu/level_fail");

            _complexAnimation.AddToQueue("idle");

            Light = new Light(Center, Color.White, 100);


            InitializeInput();
            Initialize(0, 0);

            PlayerAttacked   += OnPlayerAttack;
            HasFinishedDying += OnPlayerDeath;
            HasTakenDamage   += OnDamageTaken;
            HasRevived       += OnPlayerRevive;
        }
Example #5
0
        public Hellboar(int x, int y)
        {
            Behavior = new HellboarBehavior();
            Weight   = 100;
            Behavior.Initialize(this);

            Texture = ContentHelper.LoadTexture("Enemies/hellboar");
            SetPosition(new Vector2(x, y));
            CollRectangle   = new Rectangle(0, 0, 88, 60);
            SourceRectangle = new Rectangle(0, 0, 68, 60);

            _complexAnimation.AddAnimationData("still", new ComplexAnimData()
            {
                Priority       = 1,
                Texture        = Texture,
                DeltaRectangle = new Rectangle(15 * 2, 30 * 2, CollRectangle.Width, CollRectangle.Height),
                StartingY      = 0,
                Width          = SourceRectangle.Width,
                Height         = SourceRectangle.Height,
                Speed          = 125,
                FrameCount     = 4,
                IsRepeating    = true,
            });

            _complexAnimation.AddAnimationData("walk", new ComplexAnimData()
            {
                Priority       = 10,
                Texture        = Texture,
                DeltaRectangle = new Rectangle(15 * 2, 30 * 2, CollRectangle.Width, CollRectangle.Height),
                StartingY      = SourceRectangle.Height * 1,
                Width          = SourceRectangle.Width,
                Height         = SourceRectangle.Height,
                Speed          = 125,
                FrameCount     = 4,
                IsRepeating    = true,
            });

            _complexAnimation.AddAnimationData("angry", new ComplexAnimData()
            {
                Priority       = 100,
                Texture        = Texture,
                DeltaRectangle = new Rectangle(15 * 2, 30 * 2, CollRectangle.Width, CollRectangle.Height),
                StartingY      = SourceRectangle.Height * 2,
                Width          = SourceRectangle.Width,
                Height         = SourceRectangle.Height,
                Speed          = 125,
                FrameCount     = 4,
                IsRepeating    = false,
            });

            _complexAnimation.AddAnimationData("charge", new ComplexAnimData()
            {
                Priority       = 1000,
                Texture        = Texture,
                DeltaRectangle = new Rectangle(15 * 2, 30 * 2, CollRectangle.Width, CollRectangle.Height),
                StartingY      = SourceRectangle.Height * 3,
                Width          = SourceRectangle.Width,
                Height         = SourceRectangle.Height,
                Speed          = 125,
                FrameCount     = 5,
                IsRepeating    = true,
            });


            Sounds.AddSoundRef("idle", "Sounds/Hellboar/hellboar_breath");
            Sounds.AddSoundRef("scream", "Sounds/Hellboar/hellboar_scream");
            Sounds.AddSoundRef("fire", "Sounds/Hellboar/hellboar_fire");
        }