public LogoEntity(Action endFunction) { Position.X = OGE.HUDCamera.Width / 2.0f; Position.Y = OGE.HUDCamera.Height / 2.0f; currentSpeed = 0.03f; currentValue = 0; status = AnnouncerStatus.Appearing; this.endFunction = endFunction; logoBackgroundImage = new Image(OGE.Content.Load<Texture2D>(@"Graphics\Intro\LogoBack")); logoBackgroundImage.CenterOrigin(); logoBackgroundImage.TintColor = Color.White * currentValue; oImage = new Image(OGE.Content.Load<Texture2D>(@"Graphics\Intro\OLogo")); oImage.CenterOrigin(); oImage.TintColor = Color.White * currentValue; omidosImage = new Image(OGE.Content.Load<Texture2D>(@"Graphics\Intro\OmidosLogo")); omidosImage.CenterOrigin(); omidosImage.TintColor = Color.White * currentValue; waitingAlarm = new Alarm(2f, TweenType.OneShot, Disappear); AddTween(waitingAlarm); CurrentImages.Add(logoBackgroundImage); CurrentImages.Add(oImage); CurrentImages.Add(omidosImage); }
public ExeFile() { infectedDamage = 25; infectedType = null; maxHealth = 50; health = maxHealth; rescuedFileScore = 100; flicked = false; normalImage = new Image(OGE.Content.Load<Texture2D>(@"Graphics\Entities\Objects\ExeFile")); virusInfectedImage = new Image(OGE.Content.Load<Texture2D>(@"Graphics\Entities\Objects\InfectedFile")); trojanInfectedImage = new Image(OGE.Content.Load<Texture2D>(@"Graphics\Entities\Objects\InfectedFileTrojan")); CurrentImages.Add(new Image(OGE.Content.Load<Texture2D>(@"Graphics\Entities\Objects\ExeFile"))); CurrentImages[0].CenterOrigin(); normalImage.CenterOrigin(); virusInfectedImage.CenterOrigin(); trojanInfectedImage.CenterOrigin(); normalImage.Scale = 0; virusInfectedImage.Scale = 0; trojanInfectedImage.Scale = 0; AddCollisionMask(new HitboxMask(normalImage.Width, normalImage.Height, normalImage.OriginX, normalImage.OriginY)); replicateAlarm = new Alarm(REPLICATE_TIME, TweenType.OneShot, ReplicateAndDestroy); flickerAlarm = new Alarm(MAX_FLICKER_TIME, TweenType.OneShot, FlickColor); AddTween(replicateAlarm); AddTween(flickerAlarm); }
public BaseBoss(Vector2 startingPosition) { this.Position = startingPosition; this.damagePercentage = 1f; this.MainColor = Color.White; this.freezeResistance = 0.8f; this.freezeReviving = 0.005f; this.slidingFactor = 1; this.Direction = OGE.Random.Next(360); this.score = 0; this.MainColor = Color.White; this.status = BossState.Enterance; this.isHit = false; this.SlowFactor = 1; this.hitAlarm = new Alarm(0.2f, TweenType.OneShot, () => { isHit = false; }); AddTween(hitAlarm); this.images = new Dictionary<BossState, Image>(); this.actions = new Dictionary<BossState, Action>(); this.freezeImage = new Image(OGE.Content.Load<Texture2D>(@"Graphics\Entities\Bosses\Ice")); this.freezeImage.CenterOrigin(); this.EntityCollisionType = CollisionType.Boss; }
public WormEnemy() : base(new Color(70,20,90)) { maxSpeed = 1 * SPEED_UNIT; acceleration = 0.25f; direction = random.Next(360); rotationSpeed = 5f; health = 30f; damage = 10f; score = 30; enemyStatus = EnemyStatus.Attacking; alarmTime = 2f + 2 * (float)random.NextDouble(); replicateAlarm = new Alarm(alarmTime, TweenType.OneShot, new AlarmFinished(SlowDown)); AddTween(replicateAlarm, true); CurrentImages.Add(new Image(OGE.Content.Load<Texture2D>(@"Graphics\Entities\Enemies\Worm"))); CurrentImages[0].CenterOrigin(); AddCollisionMask(new HitboxMask(CurrentImages[0].Width, CurrentImages[0].Height, CurrentImages[0].OriginX, CurrentImages[0].OriginY)); thrusters.Add(new EnemyThrusterData { Direction = 180, Length = 22 }); }
public BaseExplosion(Vector2 position, Color explosionColor, float radius) { this.Position = position; this.radius = radius; this.AdditiveWhite = 0.2f; this.FriendlyExplosion = false; Particle particlePrototype = new Particle(); particlePrototype.ParticleColor = explosionColor; particlePrototype.DeltaScale = 0.03f; particlePrototype.DeltaAlpha = -0.03f; this.circleGenerator = new CircleParticleGenerator(OGE.CurrentWorld.ExplosionEffectSystem, particlePrototype); this.circleGenerator.AngleDisplacement = 20; this.circleGenerator.InterDistance = 10; this.circleGenerator.NumberOfCircles = (int)MathHelper.Clamp((radius / 100), 1, 4); this.circleGenerator.ParticleTexture = ParticleTextureType.BlurredCircle; this.circleGenerator.Speed = 4f; this.circleGenerator.GenerateParticles(Position); OGE.CurrentWorld.LightingEffectSystem.GenerateLightSource(position, new Vector2(2 * radius, 2 * radius), explosionColor, -0.01f); OGE.CurrentWorld.AdditiveWhite.Alpha += AdditiveWhite; OGE.WorldCamera.ShackCamera(10, 0.25f); this.EntityCollisionType = CollisionType.Explosion; SoundManager.EmitterPosition = Position; SoundManager.PlaySFX("explosion"); this.removalAlarm = new Alarm(0.08f, TweenType.OneShot, new AlarmFinished(RemoveEntity)); AddTween(removalAlarm, true); }
public Popur2Enemy() : base(new Color(255,150,150)) { maxSpeed = 0.7f * SPEED_UNIT; acceleration = 0.25f; totalTime = (float)((totalTime - 3) + 3 * OGE.Random.NextDouble()); direction = random.Next(360); rotationSpeed = 5f; health = 30f; damage = 0f; score = 120; enemyStatus = EnemyStatus.Attacking; CurrentImages.Add(new Image(OGE.Content.Load<Texture2D>(@"Graphics\Entities\Enemies\Popur2"))); CurrentImages[0].CenterOrigin(); AddCollisionMask(new HitboxMask(CurrentImages[0].Width, CurrentImages[0].Height, CurrentImages[0].OriginX, CurrentImages[0].OriginY)); thrusters.Add(new EnemyThrusterData { Direction = 180, Length = 22 }); explosionAlarm = new Alarm(totalTime, TweenType.OneShot, EnemyDestroy); AddTween(explosionAlarm, true); flickerAlarm = new Alarm(MAX_FLICKER_AMOUNT, TweenType.OneShot, FlickerColor); AddTween(flickerAlarm, true); alarmText = new Text(Math.Ceiling((1 - explosionAlarm.PercentComplete()) * totalTime).ToString(), FontSize.Small); alarmText.Angle = direction + 90; alarmText.OriginX = alarmText.Width / 2; alarmText.OriginY = alarmText.Height / 2; }
public ZipFile() { health = 200; maxHealth = 200; hitAlarm = new Alarm(0.3f, TweenType.OneShot, () => { isHit = false; }); AddTween(hitAlarm); healthBarBGImage = new Image(OGE.Content.Load<Texture2D>(@"Graphics\Entities\Objects\HealthBG")); healthBarImage = new Image(OGE.Content.Load<Texture2D>(@"Graphics\Entities\Objects\Health")); healthBarBGImage.CenterOrigin(); healthBarImage.CenterOrigin(); healthBarImage.Scale = 0; healthBarBGImage.Scale = 0; normalImage = new Image(OGE.Content.Load<Texture2D>(@"Graphics\Entities\Objects\ZipFile")); normalImage.CenterOrigin(); normalImage.Scale = 0; CurrentImages.Add(new Image(OGE.Content.Load<Texture2D>(@"Graphics\Entities\Objects\ZipFile"))); CurrentImages[0].CenterOrigin(); hitColor = new Color(255, 80, 80); normalColor = Color.White; AddCollisionMask(new HitboxMask(normalImage.Width, normalImage.Height, normalImage.OriginX, normalImage.OriginY)); }
public TimeAnnouncerEntity(AnnouncerEnded endFunction, float height, float time, FontSize size) : base(endFunction, height) { endAlarm = new Alarm(time, TweenType.OneShot, new AlarmFinished(FinishAnnouncer)); AddTween(endAlarm, true); text = new Text("", size); }
public void ReplicatePosition(float health, float randomAmount, double alarmAmount) { this.health = health; this.Position.X += (float)((randomAmount - 0.5) * 100); this.Position.Y += (float)((randomAmount - 0.5) * 100); RemoveTween(replicateAlarm); this.alarmTime = alarmAmount + alarmAmount * randomAmount; this.replicateAlarm = new Alarm(alarmTime, TweenType.OneShot, new AlarmFinished(SlowDown)); AddTween(replicateAlarm, true); }
public EffectArea(Color color, float timeToLast = 5) { EndAction = null; currentRadius = 0; deltaRadius = 10; alarm = new Alarm(timeToLast, TweenType.OneShot, ChangeRadiusDirection); AddTween(alarm, true); EntityCollisionType = CollisionType.Effect; }
public DosBossController(int totalNumberBosses = 8) { this.totalNumberBosses = totalNumberBosses; this.enemyColor = new Color(255, 120, 255); this.generateAttackAlarm = new Alarm(3f, TweenType.OneShot, Attack); AddTween(generateAttackAlarm, false); Attack(); this.bosses = new List<DosBoss>(); }
public DosBossNewPosition(Vector2 newPosition, Color color, double timeToAppear, AlarmFinished endFunction) { Position.X = newPosition.X; Position.Y = newPosition.Y; CurrentImages.Add(new Image(OGE.Content.Load<Texture2D>(@"Graphics\Entities\Bosses\ExplosionPositon"))); CurrentImages[0].TintColor = color; CurrentImages[0].CenterOrigin(); appearTimer = new Alarm(timeToAppear, TweenType.OneShot, endFunction); AddTween(appearTimer, true); EntityCollisionType = Collision.CollisionType.Effect; }
public BaseWeapon(float refreshTime) { random = new Random(); refreshShotgun = new Alarm(refreshTime, TweenType.OneShot, new AlarmFinished(RefreshWeapon)); numberOfBullets = 1; bulletSpeed = 5; processorTime = 5; accuracy = 5; maxDistance = OGE.WorldCamera.Width; shootBullet = true; this.ProcessorCoolDown = 0.5f; this.CooldownProcessor = false; this.Processor = 0; }
public PopurBossNewPosition(Vector2 newPosition, double timeToAppear, PopurBoss popurBoss) { this.boss = popurBoss; Position.X = newPosition.X; Position.Y = newPosition.Y; CurrentImages.Add(new Image(OGE.Content.Load<Texture2D>(@"Graphics\Entities\Bosses\ExplosionPositon"))); CurrentImages[0].TintColor = popurBoss.BossColor; CurrentImages[0].CenterOrigin(); appearTimer = new Alarm(timeToAppear, TweenType.OneShot, FinishAlarm); AddTween(appearTimer, true); EntityCollisionType = Collision.CollisionType.Effect; }
public PopurBoss() : base(new Vector2(OGE.CurrentWorld.Dimensions.X / 2 + 40, OGE.CurrentWorld.Dimensions.Y / 2 - 200)) { this.status = BossState.Wait; Texture2D texture = OGE.Content.Load<Texture2D>(@"Graphics\Entities\Bosses\WaitBoss"); this.wait1Image = new Image(texture, new Rectangle(0, 0, 128, 128)); this.wait2Image = new Image(texture, new Rectangle(128, 0, 128, 128)); this.images.Add(BossState.Wait, wait1Image); wait1Image.CenterOrigin(); wait2Image.CenterOrigin(); foreach (Image image in this.images.Values) { image.CenterOrigin(); } this.actions.Add(BossState.Wait, Wait); this.maxHealth = 15000; this.health = this.maxHealth; this.acceleration = 0; this.Direction = 90; this.maxSpeed = 0; this.speed = 0; this.slidingFactor = 0; this.freezeResistance = 1f; this.damage = 60; this.enemyColor = new Color(255, 150, 150); this.score = 5000; this.CurrentImage = images[status]; this.waitAlarm = new Alarm(2f, TweenType.OneShot, WaitEnded); this.flikerAlarm = new Alarm(flikerTime, TweenType.OneShot, FlickImage); AddTween(this.waitAlarm, true); AddTween(this.flikerAlarm, true); AddCollisionMask(new HitboxMask(110, 110, 55, 55)); }
public FreezeEnemiesEntity(double freezingTime) { enemyList = new List<BaseEnemy>(); List<BaseEntity> list = OGE.CurrentWorld.GetCollisionEntitiesType(CollisionType.Enemy); foreach (BaseEntity entity in list) { BaseEnemy enemy = entity as BaseEnemy; if (enemy != null) { enemyList.Add(enemy); } } removalAlarm = new Alarm(freezingTime, TweenType.OneShot, new AlarmFinished(RemoveEntity)); AddTween(removalAlarm, true); EntityCollisionType = CollisionType.Object; }
public BaseGenerator(Type classType, int numberOfEnemies, double startingTime, double interGenerationTime, double randomStartingTime = 0, double randomInterGenerationTime = 0) { this.classType = classType; this.numberOfEnemies = numberOfEnemies; this.infinite = false; if (numberOfEnemies <= 0) { this.numberOfEnemies = 0; this.infinite = true; } this.interGenerationTime = interGenerationTime; this.randomInterGenerationTime = randomInterGenerationTime; this.random = OGE.Random; this.generatorAlarm = new Alarm(startingTime + randomStartingTime * random.NextDouble(), TweenType.OneShot, Generate); AddTween(this.generatorAlarm, true); EntityCollisionType = Collision.CollisionType.Generator; }
public TroyBoss() : base(new Vector2(OGE.CurrentWorld.Dimensions.X / 2, -100)) { Texture2D texture = OGE.Content.Load<Texture2D>(@"Graphics\Entities\Bosses\TroyBoss"); this.images.Add(BossState.Enterance, new Image(texture, new Rectangle(0, 0, 128, 128))); this.images.Add(BossState.Move, new Image(texture, new Rectangle(0, 0, 128, 128))); this.images.Add(BossState.Rotate, new Image(texture, new Rectangle(0, 0, 128, 128))); this.images.Add(BossState.Summon, new Image(texture, new Rectangle(0, 0, 128, 128))); this.images.Add(BossState.Wait, new Image(texture, new Rectangle(0, 0, 128, 128))); foreach (Image image in this.images.Values) { image.CenterOrigin(); } this.actions.Add(BossState.Enterance, CheckMoveEnds); this.actions.Add(BossState.Summon, Summon); this.actions.Add(BossState.Wait, Wait); this.actions.Add(BossState.Rotate, Rotate); this.actions.Add(BossState.Move, CheckMoveEnds); this.maxHealth = 6000; this.health = this.maxHealth; this.acceleration = 0; this.Direction = 90; this.maxSpeed = 15 * BaseEnemy.SPEED_UNIT; this.speed = this.maxSpeed / 4; this.slidingFactor = 0; this.freezeResistance = 1f; this.damage = 50; this.enemyColor = new Color(80, 120, 20); this.score = 5000; this.CurrentImage = images[status]; this.waitAlarm = new Alarm(1f, TweenType.OneShot, () => { status = BossState.Rotate; }); AddTween(this.waitAlarm); AddCollisionMask(new HitboxMask(120, 120, 60, 60)); }
public HackintoshEnemy() : base(new Color(50,50,50)) { InsideScreen = true; maxSpeed = SPEED_UNIT; acceleration = 0f; direction = random.Next(0); rotationSpeed = 0f; health = 300f; damage = 0f; score = 500; enemyStatus = EnemyStatus.Enterance; CurrentImages.Add(new Image(OGE.Content.Load<Texture2D>(@"Graphics\Entities\Enemies\Hackintosh"))); CurrentImages[0].CenterOrigin(); CurrentImages[0].Scale = 0; AddCollisionMask(new HitboxMask(CurrentImages[0].Width, CurrentImages[0].Height, CurrentImages[0].OriginX, CurrentImages[0].OriginY)); Particle particlePrototype = new Particle(); particlePrototype.ParticleColor = enemyColor; particlePrototype.DeltaScale = -0.08f; particlePrototype.DeltaAlpha = -0.08f; this.circleGenerator = new CircleParticleGenerator(OGE.CurrentWorld.TrailEffectSystem, particlePrototype); this.circleGenerator.AngleDisplacement = 45; this.circleGenerator.InterDistance = 5; this.circleGenerator.StartingDistance = 5; this.circleGenerator.NumberOfCircles = 1; this.circleGenerator.ParticleTexture = ParticleTextureType.BlurredCircle; this.circleGenerator.Speed = 4f; this.circleGenerator.Scale = 0.1f; this.generateAlarm = new Alarm(3f, TweenType.Looping, new AlarmFinished(GenerateVirus)); AddTween(generateAlarm, true); }
public BaseObject(double timeTillRemove, Color removalColor) { this.removalAlarm = new Alarm(timeTillRemove, TweenType.OneShot, new AlarmFinished(RemoveEntity)); AddTween(removalAlarm, true); this.removalColor = removalColor; this.notifingAlarm = new Alarm(0.8f, TweenType.Looping, GenerateNotifier); AddTween(this.notifingAlarm, true); Particle particlePrototype = new Particle(); particlePrototype.ParticleColor = removalColor; particlePrototype.DeltaScale = 0.03f; particlePrototype.DeltaAlpha = -0.03f; this.circleGenerator = new CircleParticleGenerator(OGE.CurrentWorld.TrailEffectSystem, particlePrototype); this.circleGenerator.AngleDisplacement = 30; this.circleGenerator.NumberOfCircles = 1; this.circleGenerator.ParticleTexture = ParticleTextureType.BlurredCircle; this.circleGenerator.Speed = 1f; this.circleGenerator.Scale = 0.5f; EntityCollisionType = CollisionType.Object; }
public BaseEnemy(Color enemyColor) { this.IsFollowed = false; this.enemyColor = enemyColor; this.MainColor = Color.White; this.speed = 0; this.damagePercentage = 0.2f; this.freezeResistance = 0.1f; this.freezeReviving = 0.005f; this.lightingPercent = 1f; this.random = OGE.Random; IntializeParticleGenerators(); this.isHit = false; this.hitAlarm = new Alarm(0.2f, TweenType.OneShot, new AlarmFinished(HitEnded)); AddTween(hitAlarm); this.enemyStatus = EnemyStatus.Standing; this.aiFunctions = new Dictionary<EnemyStatus, AIEnemyFunction>(); this.aiFunctions.Add(EnemyStatus.Enterance, new AIEnemyFunction(EnteranceAI)); this.aiFunctions.Add(EnemyStatus.Standing, new AIEnemyFunction(StandingAI)); this.aiFunctions.Add(EnemyStatus.Moving, new AIEnemyFunction(MovingAI)); this.aiFunctions.Add(EnemyStatus.Attacking, new AIEnemyFunction(AttackingAI)); this.thrusters = new List<EnemyThrusterData>(); this.SlowFactor = 1; this.freezeImage = new Image(OGE.Content.Load<Texture2D>(@"Graphics\Entities\Enemies\Freeze")); this.freezeImage.CenterOrigin(); this.freezeImage.Angle = random.Next(360); this.EntityCollisionType = CollisionType.Enemy; }
public SpikeBullet(Vector2 startingPoint, float speed, float direction, float maxDistance, float timeToRemove = 3) : base(startingPoint, speed, direction, maxDistance) { this.damage = 10; this.originalSpeed = speed; Particle particlePrototype = new Particle(); particlePrototype.ParticleColor = new Color(255, 60, 50); particlePrototype.DeltaScale = -0.1f; particlePrototype.DeltaSpeed = -0.1f; this.trailParticleGenerator = new TrailParticleGenerator(OGE.CurrentWorld.TrailEffectSystem, particlePrototype); this.trailParticleGenerator.Angle = direction + 180; this.trailParticleGenerator.ParticleTexture = ParticleTextureType.BlurredCircle; this.trailParticleGenerator.Speed = 2f; this.trailParticleGenerator.Scale = 0f; this.ExplosionColor = new Color(255, 60, 50); this.ExplosionRadius = 20; this.ExplosionPower = 1; this.removalAlarm = new Alarm(timeToRemove, TweenType.OneShot, () => { OGE.CurrentWorld.RemoveEntity(this); }); AddTween(removalAlarm, true); }
public TutorialEntity(Color color, Action removeEntityAction = null) { this.removeEntityAction = removeEntityAction; GlobalVariables.IsFirstTime = false; this.color = color; controlsImage = new Image(OGE.Content.Load<Texture2D>(@"Graphics\Entities\Tutorial\Controls")); arrowLayoutImage = new Image(OGE.Content.Load<Texture2D>(@"Graphics\Entities\Tutorial\ArrowLayout")); controlsImage.TintColor = color; arrowLayoutImage.TintColor = color; Position = new Vector2(OGE.HUDCamera.Width / 2, OGE.HUDCamera.Height / 2) - new Vector2(controlsImage.Width / 2, controlsImage.Height / 2); wText = new Text("W", FontSize.Medium); aText = new Text("A", FontSize.Medium); sText = new Text("S", FontSize.Medium); dText = new Text("D", FontSize.Medium); wText.Align(AlignType.Center); aText.Align(AlignType.Center); sText.Align(AlignType.Center); dText.Align(AlignType.Center); moveText = new Text("Move Player", FontSize.Small); moveText.Align(AlignType.Right); moveText.TintColor = color; spaceText = new Text("Spacebar", FontSize.Medium); spaceText.Align(AlignType.Center); overclockingText = new Text("Start Overclocking", FontSize.Small); overclockingText.Align(AlignType.Center); overclockingText.TintColor = color; overclockingDetailsText = new Text("(It launches a random special ability from player abilities when the Overclocking meter is full)", FontSize.Small); overclockingDetailsText.Align(AlignType.Center); overclockingDetailsText.TintColor = color; leftMouseText = new Text("Fire", FontSize.Small); leftMouseText.TintColor = color; labelsImage = new Image(OGE.Content.Load<Texture2D>(@"Graphics\Entities\Tutorial\TutorialLabels")); labelsImage.TintColor = color; healthText = new Text("Player Health (if depleted, player dies)", FontSize.Small); topProcessorText = new Text("Primary Turret Processor(if reach maximum, it must cooldown)", FontSize.Small); bottomProcessorText = new Text("Secondry Turret Processor(if reach maximum, it must cooldown)", FontSize.Small); scoreText = new Text("Player score in that level", FontSize.Small); overclockingBarText = new Text("Show percentage filled of Overclocking (Increase by killing enemies)", FontSize.Small); healthText.TintColor = color; topProcessorText.TintColor = color; bottomProcessorText.TintColor = color; scoreText.TintColor = color; overclockingBarText.TintColor = color; scoreText.Align(AlignType.Right); overclockingBarText.Align(AlignType.Center); this.finishingAlarm = new Alarm(10, TweenType.OneShot, FadeEntity); AddTween(finishingAlarm); AdjustAlpha(); EntityCollisionType = Collision.CollisionType.Solid; }
public HackintoshBoss() : base(new Vector2(OGE.CurrentWorld.Dimensions.X / 2, OGE.CurrentWorld.Dimensions.Y / 2 - 200)) { this.status = BossState.Wait; Texture2D texture = OGE.Content.Load<Texture2D>(@"Graphics\Entities\Bosses\HackintoshBoss"); this.images.Add(BossState.Wait, new Image(texture)); foreach (Image image in this.images.Values) { image.CenterOrigin(); } this.actions.Add(BossState.Wait, Wait); this.maxHealth = 15000; this.health = this.maxHealth; this.acceleration = 0; this.Direction = 90; this.maxSpeed = 0; this.speed = 0; this.slidingFactor = 0; this.freezeResistance = 1f; this.damage = 0; this.enemyColor = new Color(255, 255, 80); this.score = 5000; this.CurrentImage = images[status]; Particle particlePrototype = new Particle(); particlePrototype.ParticleColor = enemyColor; particlePrototype.DeltaScale = -0.08f; particlePrototype.DeltaAlpha = -0.08f; this.circleGenerator = new CircleParticleGenerator(OGE.CurrentWorld.TrailEffectSystem, particlePrototype); this.circleGenerator.AngleDisplacement = 45; this.circleGenerator.InterDistance = 5; this.circleGenerator.StartingDistance = 15; this.circleGenerator.NumberOfCircles = 1; this.circleGenerator.ParticleTexture = ParticleTextureType.BlurredCircle; this.circleGenerator.Speed = 4f; this.circleGenerator.Scale = 1f; this.waitAlarm = new Alarm(waitingTime, TweenType.Looping, Disappear); this.generatingAlarm = new Alarm(generatingTime, TweenType.Looping, Generate); AddTween(this.waitAlarm, true); AddTween(this.generatingAlarm, true); this.enemyTypes = new List<Type>(); this.enemyTypes.Add(typeof(VirusEnemy)); this.enemyTypes.Add(typeof(TroyEnemy)); this.enemyTypes.Add(typeof(Troy2Enemy)); this.enemyTypes.Add(typeof(DOSEnemy)); this.enemyTypes.Add(typeof(DOS2Enemy)); this.enemyTypes.Add(typeof(WormEnemy)); this.enemyTypes.Add(typeof(SlowEnemy)); this.hackintoshFanController = new HackintoshBossFanController(this, 40); OGE.CurrentWorld.AddEntity(hackintoshFanController); AddCollisionMask(new HitboxMask(110, 110, 55, 55)); }
public override void Intialize() { GC.Collect(); base.Intialize(); AddBackground(GlobalVariables.Background); levelData.LoadLevel(); BaseEntity boss = levelData.GetBoss(); if (boss != null) { AddEntity(boss); SoundManager.PlayMusic("boss"); } else { if (GlobalVariables.CurrentDrive < 5) { if (!SoundManager.CurrentRunningMusic.Contains("ingame")) { SoundManager.PlayMusic("ingame" + GlobalVariables.CurrentDrive + (OGE.Random.Next(3) + 1).ToString()); } } else { SoundManager.PlayMusic("ingame" + GlobalVariables.CurrentDrive); } } TotalNumberOfZipFiles = levelData.NumberOfZip; if (TotalNumberOfZipFiles > 0) { AddEntity(HUDEntity.FileArrowEntity); } if (levelData.NumberOfDocumentFiles == 0) { //TotalNumberOfDocumentFiles = int.MaxValue; } else { TotalNumberOfDocumentFiles = levelData.NumberOfDocumentFiles; } if (levelData.TimeEndLevel > 0) { LevelAlarm = new Alarm(levelData.TimeEndLevel, TweenType.OneShot, ClearArea); BaseEntity e = new BaseEntity(); e.AddTween(LevelAlarm, true); AddEntity(e); } foreach (BaseGenerator generator in levelData.Generator) { AddEntity(generator); } AddEntity(new PlayerEntity(levelData.StartPosition, GlobalVariables.TopPlayer, GlobalVariables.BottomPlayer)); HUDEntity.GameScoreType = ScoreType.Points; OGE.CurrentWorld.AddOverLayer(new HUDEntity()); CursorEntity.CursorView = CursorType.Aim; LevelNameAnnouncerEntity levelTitle = new LevelNameAnnouncerEntity(ShowTutorial, levelData.LevelName, GlobalVariables.CurrentLevel); levelTitle.TintColor = new Color(150, 255, 130); AddOverLayer(levelTitle); }
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; }