示例#1
0
        public ClientPlayer(Deathmatch dm)
            : base(dm)
        {
            this.model = MainGame.Char2Model;
            Pos = new Vector2f(10, 10);
            Speed = 2f;
            MaxJumps = 2;
            JumpsLeft = MaxJumps;
            Alive = true;
            Health = 100;
            Texture = Content.GetTexture(model.idleFile);
            deathTimer = 0;
            Killer = this;

            idle = new Animation(Content.GetTexture(model.idleFile), 4, 120, 1);
            running = new Animation(Content.GetTexture(model.runFile), 6, 60, 2);
            backpedal = new Animation(Content.GetTexture(model.runFile), 6, 60, 2, false);
            jumpUp = new Animation(Content.GetTexture(model.jumpUpFile), 1, 60, 0);
            jumpDown = new Animation(Content.GetTexture(model.jumpDownFile), 3, 60, -5);
            animation = idle;

            weapons = new List<Weapon>()
            {
                new Revolver(this),
                null,
                null,
                null,
            };

            respawnTimer = respawnLength * 60;

            weapon = weapons[0];
        }
示例#2
0
        public ClientPlayer(Deathmatch dm)
            : base(dm)
        {
            this.model = MainGame.Char2Model;
            Pos        = new Vector2f(10, 10);
            Speed      = 2f;
            MaxJumps   = 2;
            JumpsLeft  = MaxJumps;
            Alive      = true;
            Health     = 100;
            Texture    = Content.GetTexture(model.idleFile);
            deathTimer = 0;
            Killer     = this;

            idle      = new Animation(Content.GetTexture(model.idleFile), 4, 120, 1);
            running   = new Animation(Content.GetTexture(model.runFile), 6, 60, 2);
            backpedal = new Animation(Content.GetTexture(model.runFile), 6, 60, 2, false);
            jumpUp    = new Animation(Content.GetTexture(model.jumpUpFile), 1, 60, 0);
            jumpDown  = new Animation(Content.GetTexture(model.jumpDownFile), 3, 60, -5);
            animation = idle;

            weapons = new List <Weapon>()
            {
                new Revolver(this),
                null,
                null,
                null,
            };

            respawnTimer = respawnLength * 60;

            weapon = weapons[0];
        }
示例#3
0
        private static void LoadContentInitialize()
        {
            Char1Model                 = new Model();
            Char1Model.name            = "Character_1_Model";
            Char1Model.gibArmFile      = "gibArm.png";
            Char1Model.gibBodyFile     = "gibBody.png";
            Char1Model.gibHeadFile     = "gibHead.png";
            Char1Model.gibLowerLegFile = "gibLowerLeg.png";
            Char1Model.gibUpperLegFile = "gibUpperLeg.png";
            Char1Model.idleFile        = "idle.png";
            Char1Model.jumpDownFile    = "jumpDown.png";
            Char1Model.jumpUpFile      = "jumpUp.png";
            Char1Model.runFile         = "run.png";
            Char1Model.pistolHand      = "pistolHand.png";

            Char2Model                 = new Model();
            Char2Model.name            = "Character_2_Model";
            Char2Model.gibArmFile      = "char2_gibArm.png";
            Char2Model.gibBodyFile     = "char2_gibBody.png";
            Char2Model.gibHeadFile     = "char2_gibHead.png";
            Char2Model.gibLowerLegFile = "char2_gibLowerLeg.png";
            Char2Model.gibUpperLegFile = "char2_gibUpperLeg.png";
            Char2Model.idleFile        = "char2_idle.png";
            Char2Model.jumpDownFile    = "char2_jumpDown.png";
            Char2Model.jumpUpFile      = "char2_jumpUp.png";
            Char2Model.runFile         = "char2_run.png";
            Char2Model.pistolHand      = "char2_pistolHand.png";

            window = new RenderWindow(
                new VideoMode(800, 600), "Project Iris", Styles.Resize);

            window.SetFramerateLimit(60);
            window.SetMouseCursorVisible(false);
            window.Closed += (o, e) =>
            {
                dm.Close();
                window.Close();
            };

            window.GainedFocus += (o, e) =>
            {
                Input.isActive = true;
            };
            window.LostFocus += (o, e) =>
            {
                Input.isActive = false;
            };

            Camera         = new View(window.DefaultView);
            Camera.Size    = new Vector2f(800 / 2, 600 / 2);
            GuiCamera      = new View(window.DefaultView);
            GuiCamera.Size = new Vector2f(800 / 2, 600 / 2);
            soundInstances = new List <SoundInstance>()
            {
            };
            dm        = new Deathmatch();
            mm        = new Menu();
            gamestate = mm;
        }
示例#4
0
文件: Actor.cs 项目: libjared/iris
 public Actor(Deathmatch dm)
 {
     Health = 100;
     Pos = new Vector2f(0, 0);
     UID = 0;
     Texture = null;//new Texture();
     //Texture = Content.GetTexture("flint_right.png");
     //Origin = new Vector2f(Texture.Size.X /2 , Texture.Size.Y);
     this.dm = dm;
     Killer = this;
 }
示例#5
0
文件: Actor.cs 项目: libjared/iris
 public Actor(Deathmatch dm)
 {
     Health  = 100;
     Pos     = new Vector2f(0, 0);
     UID     = 0;
     Texture = null;//new Texture();
     //Texture = Content.GetTexture("flint_right.png");
     //Origin = new Vector2f(Texture.Size.X /2 , Texture.Size.Y);
     this.dm = dm;
     Killer  = this;
 }
示例#6
0
        public NetPlayer(Deathmatch dm, long UID)
            : base(dm)
        {
            model     = MainGame.Char1Model;
            this.UID  = UID;
            idle      = new Animation(Content.GetTexture(model.idleFile), 4, 120, 1);
            running   = new Animation(Content.GetTexture(model.runFile), 6, 60, 2);
            backpedal = new Animation(Content.GetTexture(model.runFile), 6, 60, 2, false);
            jumpUp    = new Animation(Content.GetTexture(model.jumpUpFile), 1, 60, 0);
            jumpDown  = new Animation(Content.GetTexture(model.jumpDownFile), 3, 60, -5);
            animation = idle;

            Texture = Content.GetTexture("idle.png");
            Alive   = true;
            //.Color = Color.Red;

            weapons = new List <Weapon>()
            {
                new Revolver(this),
                new Shotgun(this),
                new MachineGun(this),
                new BombWeapon(this),
            };
        }
示例#7
0
        public NetPlayer(Deathmatch dm, long UID)
            : base(dm)
        {
            model = MainGame.Char1Model;
            this.UID = UID;
            idle = new Animation(Content.GetTexture(model.idleFile), 4, 120, 1);
            running = new Animation(Content.GetTexture(model.runFile), 6, 60, 2);
            backpedal = new Animation(Content.GetTexture(model.runFile), 6, 60, 2, false);
            jumpUp = new Animation(Content.GetTexture(model.jumpUpFile), 1, 60, 0);
            jumpDown = new Animation(Content.GetTexture(model.jumpDownFile), 3, 60, -5);
            animation = idle;

            Texture = Content.GetTexture("idle.png");
            Alive = true;
            //.Color = Color.Red;

            weapons = new List<Weapon>()
            {
                new Revolver(this),
                new Shotgun(this),
                new MachineGun(this),
                new BombWeapon(this),
            };
        }
示例#8
0
 public ClientMailman(Deathmatch dm)
 {
     this.dm = dm;
 }
示例#9
0
文件: MainGame.cs 项目: libjared/iris
        private static void LoadContentInitialize()
        {
            Char1Model = new Model();
            Char1Model.name = "Character_1_Model";
            Char1Model.gibArmFile = "gibArm.png";
            Char1Model.gibBodyFile = "gibBody.png";
            Char1Model.gibHeadFile = "gibHead.png";
            Char1Model.gibLowerLegFile = "gibLowerLeg.png";
            Char1Model.gibUpperLegFile = "gibUpperLeg.png";
            Char1Model.idleFile = "idle.png";
            Char1Model.jumpDownFile = "jumpDown.png";
            Char1Model.jumpUpFile = "jumpUp.png";
            Char1Model.runFile = "run.png";
            Char1Model.pistolHand = "pistolHand.png";

            Char2Model = new Model();
            Char2Model.name = "Character_2_Model";
            Char2Model.gibArmFile = "char2_gibArm.png";
            Char2Model.gibBodyFile = "char2_gibBody.png";
            Char2Model.gibHeadFile = "char2_gibHead.png";
            Char2Model.gibLowerLegFile = "char2_gibLowerLeg.png";
            Char2Model.gibUpperLegFile = "char2_gibUpperLeg.png";
            Char2Model.idleFile = "char2_idle.png";
            Char2Model.jumpDownFile = "char2_jumpDown.png";
            Char2Model.jumpUpFile = "char2_jumpUp.png";
            Char2Model.runFile = "char2_run.png";
            Char2Model.pistolHand = "char2_pistolHand.png";

            window = new RenderWindow(
                new VideoMode(800, 600), "Project Iris", Styles.Resize);

            window.SetFramerateLimit(60);
            window.SetMouseCursorVisible(false);
            window.Closed += (o, e) =>
            {
                dm.Close();
                window.Close();
            };

            window.GainedFocus += (o, e) =>
            {
                Input.isActive = true;
            };
            window.LostFocus += (o, e) =>
            {
                Input.isActive = false;
            };

            Camera = new View(window.DefaultView);
            Camera.Size = new Vector2f(800 / 2, 600 / 2);
            GuiCamera = new View(window.DefaultView);
            GuiCamera.Size = new Vector2f(800 / 2, 600 / 2);
            soundInstances = new List<SoundInstance>() { };
            dm = new Deathmatch();
            mm = new Menu();
            gamestate = mm;
        }
示例#10
0
 public ClientMailman(Deathmatch dm)
 {
     this.dm = dm;
 }