Esempio n. 1
0
 public Goblin(Vector2 position)
     : base(new Mesh(64, 64, Resources.Textures["goblin.png"]), 0, position, new Vector2(64, 64), 200)
 {
     source = new Source();
     source.Buffer = Resources.Audio["goblin.wav"];
     //source.Looping = true;
     source.Relative = true;
 }
Esempio n. 2
0
        public Lift(Vector2 position)
            : base(new Mesh(64, 64, Resources.Textures["shaft1.png"]), 0, position, new Vector2(64, 64), 0)
        {
            helpText = "The lift is not powered. Find the generator first!";

            source = new Source();
            source.Buffer = Resources.Audio["lift.wav"];
            source.Relative = true;
        }
        public Generator(Vector2 position)
            : base(new Mesh(128, 103, Resources.Textures["generatoroff.png"]), 0, position, new Vector2(128, 64), 0)
        {
            helpText = "Press E to active the generator.";

            source = new Source();
            source.Buffer = Resources.Audio["generator.wav"];
            source.Relative = true;
            //source.Position = new Vector3(Position);
        }
        public Pickaxe(Vector2 position, float angle, bool active)
            : base(new Mesh(32, 32, Resources.Textures["pickaxe.png"]), angle, position, new Vector2(32, 32), 250)
        {
            health = 10;

            source = new Source();
            source.Buffer = Resources.Audio["pickaxe.wav"];
            source.Relative = true;

            this.active = active;
        }
Esempio n. 5
0
        public Player()
            : base(new Mesh(64, 64, Resources.Textures["Miner.png"]), 0, new Vector2(2000, 1500), new Vector2(64, 64), 256)
        {
            drawShadow = true;

            const int lightVerticesCount = 16;
            const float lightFoV = MathHelper.PiOver2;
            const float lightRadius = 400;

            List<float> lightVertList = new List<float>();
            lightVertList.Add(0);
            lightVertList.Add(0); //starts at the origin of player space.

            for (int i = 0; i < lightVerticesCount; i++)
            {
                float angle = (lightFoV * (float)i / ((float)lightVerticesCount - 1)) - (lightFoV * 0.5f) + MathHelper.PiOver2;
                lightVertList.Add((float)Math.Cos(angle) * lightRadius);
                lightVertList.Add((float)Math.Sin(angle) * lightRadius);
            }

            lightVertices = lightVertList.ToArray();

            animTime = 0.2f;

            animTextures = new Texture[]
            {
                Resources.Textures["Miner_walk1.png"],
                Resources.Textures["Miner_walk2.png"]
            };

            shadow = new Mesh(1024, 768, Resources.Textures["shadow.png"]);

            health = 5;

            walkSource = new Source();
            //walkSource.Position = new Vector3(position);
            walkSource.Relative = true;
            walkSource.Looping = true;
            walkSource.Buffer = Resources.Audio["walk.wav"];
        }