コード例 #1
0
ファイル: Luigi.cs プロジェクト: JohnP42/super-luigi
        public void powerUps()
        {
            //Transform
            if (transform > 0)
                transform--;

            if (transform == 0 && aura != null)
                aura = null;

            if (transform == 60)
            {
                if (toTransform == "Star")
                    star = 840;
                else if (toTransform == "Fire")
                    fireLuigi = true;

                Game1.luigiSounds[6].Play();
                aura = new Aura(toTransform, this);
                toTransform = "";

            }

            if (star > 0)
            {
                star--;
                color = new Color(Particle.random.Next(0, 256), Particle.random.Next(0, 256), Particle.random.Next(0, 256), 255);
                dust.Particles.Add(new ParticleStar(body.Left + body.Width / 2, body.Top + body.Height / 2));
            }
            else
                color = Color.White;
        }
コード例 #2
0
ファイル: Luigi.cs プロジェクト: JohnP42/super-luigi
        public Luigi(Vector2 pos)
        {
            coins = 0;
            hp = 3;
            lives = 3;

            running = false;
            acc = .2f;
            runAcc = .2f;
            maxSpeed = 3f;
            maxRunSpeed = 6f;
            maxVspeed = 6f;
            jumpForce = 7f;
            friction = .05f;
            air = .01f;
            hurt = 0;
            tripped = 0;

            velocity = Vector2.Zero;
            gravity = .7f;

            body = new Rectangle((int)pos.X + 4, (int)pos.Y + 2, 16, 32);
            facingRight = true;

            canJump = true;
            ducking = false;
            onGround = false;
            onWall = false;
            superJump = 0f;
            jumpLevel = 0;
            currentJump = 0;
            jumpCount = 0;

            badge = "None";
            fireLuigi = false;
            star = 0;
            transform = 0;
            toTransform = "";
            aura = null;
            throwing = false;
            projectiles = new List<Projectile>();

            dust = new ParticleSystem();
            dustTime = 0;

            color = Color.White;
            spriteSheet = Game1.sprLuigi;
            srcRects();
        }