コード例 #1
0
ファイル: PlayerEntity.cs プロジェクト: amidos2006/CleanEmUp
        private void OverclockingEnds()
        {
            if (runningOverclocking != null)
            {
                OGE.CurrentWorld.RemoveEntity(runningOverclocking);
            }

            runningOverclocking = null;
            rageReady = false;
            Rage = MIN_RAGE;
        }
コード例 #2
0
ファイル: PlayerEntity.cs プロジェクト: amidos2006/CleanEmUp
        public PlayerEntity(Vector2 startPosition, PlayerData topPlayer, PlayerData downPlayer)
        {
            this.Position.X = startPosition.X;
            this.Position.Y = startPosition.Y;

            this.topPlayer = topPlayer.Clone();
            this.downPlayer = downPlayer.Clone();

            this.topPlayer.Weapon.Processor = 0;
            this.downPlayer.Weapon.Processor = 0;

            AdjustDownPlayer();

            HitBox = new Rectangle((int)(-topPlayer.BodyImage.OriginX),(int)(-topPlayer.BodyImage.OriginY),
                (int)(Math.Max(topPlayer.BodyImage.Width, downPlayer.BodyImage.Width)),
                (int)(topPlayer.BodyImage.Height + downPlayer.BodyImage.Height));

            this.ShootingMethod = ShootingType.Parallel;

            this.CurrentImages.Add(this.topPlayer.BodyImage);
            this.CurrentImages.Add(this.downPlayer.BodyImage);

            this.health = topPlayer.Health + downPlayer.Health;
            this.acceleration = 0.6f;
            this.hspeed = 0;
            this.vspeed = 0;
            this.maxSpeed = topPlayer.Speed / 2 + downPlayer.Speed / 2;

            IntializeParticleGenerators();

            IntializeMainKeys();

            InvertEnded();
            this.invertAlarm = new Alarm(1f, TweenType.OneShot, new AlarmFinished(InvertEnded));
            AddTween(invertAlarm);

            ShieldEnded();
            this.shieldImageEntity = new ShieldImageEntity();
            this.shieldAlarm = new Alarm(0f, TweenType.OneShot, new AlarmFinished(ShieldEnded));
            AddTween(shieldAlarm);

            this.rageFullEffectAlarm = new Alarm(1.5f, TweenType.Looping, GenerateRageFullEffect);
            AddTween(this.rageFullEffectAlarm, true);

            this.Rage = MIN_RAGE;
            this.rageReady = false;
            this.runningOverclocking = null;

            this.isHit = false;
            this.hitCoolDown = new Alarm(0.3f, TweenType.OneShot, new AlarmFinished(HitEnded));
            AddTween(hitCoolDown);

            AddCollisionMask(new HitboxMask(HitBox.Width - 10, HitBox.Height - 10, (HitBox.Width - 10) / 2, (HitBox.Height - 10) / 2));

            this.speedResistance = 0.005f;
            this.minSpeedFactor = 0.5f;
            this.maxSpeedFactor = 1f;
            this.speedFactor = 1;

            this.EntityCollisionType = CollisionType.Player;
        }
コード例 #3
0
ファイル: PlayerEntity.cs プロジェクト: amidos2006/CleanEmUp
        private void LaunchOverclocking()
        {
            if (rageReady && runningOverclocking == null)
            {
                int random = OGE.Random.Next(2);

                switch (random)
                {
                    case 0:
                        runningOverclocking = topPlayer.GetOverclocking();
                        break;
                    case 1:
                        runningOverclocking = downPlayer.GetOverclocking();
                        break;
                }

                runningOverclocking.EndAction = OverclockingEnds;
                runningOverclocking.Position = Position;

                OGE.CurrentWorld.AddEntity(runningOverclocking);
            }
            else
            {
                //TODO play sound that tells the player that the rage is not full yet
            }
        }