private void InitializeGame() { player = new Player(); enemyManager = EnemyManager.GetInstance(); enemyManager.Initialize(); projectileManager = ProjectileManager.GetInstance(); projectileManager.Initialize(); loopTimer = LoopTimer.GetInstance(); timeLogger = TimeLogger.GetInstance(); Loop(); }
public Projectile( MovementModule movementModule, SKBitmap projBitmap, Animator animatorExpl, float damage ) { this.movementModule = movementModule; this.projBitmap = projBitmap; this.animatorExpl = animatorExpl; explDuration = animatorExpl.GetLoopDuration(); this.damage = damage; friendly = false; loopTimer = LoopTimer.GetInstance(); }
public Animator(string resourceString, int nSteps, int stepDuration) { nStepsPre = 0; nStepsHold = nSteps; nStepsPost = 0; this.stepDuration = stepDuration; bitmapsArrayHold = new SKBitmap[nSteps]; for (int i = 0; i < nSteps; i++) { bitmapsArrayHold[i] = Helper.LoadBitmap( resourceString + GetStepIdentifierString(i) + ".png" ); } loopTimer = LoopTimer.GetInstance(); //TODO move call out of constructor Start(); }
public Enemy( float maxHealth, MovementModule movementModule, WeaponModule weaponModule, Animator animatorNormal, Animator animatorExpl ) { this.maxHealth = maxHealth; health = maxHealth; this.movementModule = movementModule; this.weaponModule = weaponModule; this.animatorNormal = animatorNormal; this.animatorExpl = animatorExpl; explDuration = animatorExpl.GetLoopDuration(); loopTimer = LoopTimer.GetInstance(); }
public WeaponModuleUnit( float frequency, float damage, MovementModule movementTemplate, SKBitmap projBitmap, Animator animatorExpl ) { shootInterval = 1000 / frequency; this.damage = damage; this.movementTemplate = movementTemplate; this.projBitmap = projBitmap; this.animatorExpl = animatorExpl; loopTimer = LoopTimer.GetInstance(); cooldownStartTime = loopTimer.GetTotalMs(); friendly = false; projectileManager = ProjectileManager.GetInstance(); //fireAudioPlayer = // Helper.LoadAudioPlayer("JetPack.media.samples.laserpew.ogg"); }
public Animator( string resourceStringPre, string resourceStringHold, string resourceStringPost, int nStepsPre, int nStepsHold, int nStepsPost, int stepDuration ) { this.nStepsPre = nStepsPre; this.nStepsHold = nStepsHold; this.nStepsPost = nStepsPost; this.stepDuration = stepDuration; bitmapsArrayPre = new SKBitmap[nStepsPre]; bitmapsArrayHold = new SKBitmap[nStepsHold]; bitmapsArrayPost = new SKBitmap[nStepsPost]; for (int i = 0; i < nStepsPre; i++) { bitmapsArrayPre[i] = Helper.LoadBitmap( resourceStringPre + GetStepIdentifierString(i) + ".png" ); } for (int i = 0; i < nStepsHold; i++) { bitmapsArrayHold[i] = Helper.LoadBitmap( resourceStringHold + GetStepIdentifierString(i) + ".png" ); } for (int i = 0; i < nStepsPost; i++) { bitmapsArrayPost[i] = Helper.LoadBitmap( resourceStringPost + GetStepIdentifierString(i) + ".png" ); } loopTimer = LoopTimer.GetInstance(); }
public Player() { pos = new SKPoint( Settings.Player.startPosX, Settings.Player.startPosY ); speed = 0; playerBitmapUp = Helper.LoadBitmap("JetPack.media.player.up.png"); playerBitmapDown = Helper.LoadBitmap("JetPack.media.player.down.png"); playerBitmapNeutral = Helper.LoadBitmap("JetPack.media.player.neutral.png"); weaponModuleFactory = WeaponModuleFactory.GetInstance(); loopTimer = LoopTimer.GetInstance(); weapon = weaponModuleFactory.CreatePlayerWeapon( Settings.Player.Weapon.frequency, Settings.Player.Weapon.damage, Settings.Player.Weapon.projSpeed ); weapon.SetFriendly(); weapon.active = false; jetPackActive = false; animatorExpl = new Animator( "JetPack.media.explosions.explosion1_", 1, Settings.Player.explAnimStepDuration ); explDuration = Settings.Player.explAnimStepDuration * 1; animatorJetPack = new Animator( "JetPack.media.fire.fire_start_", "JetPack.media.fire.fire_hold_", "JetPack.media.fire.fire_stop_", 8, 23, 19, Settings.Player.jetPackAnimStepDuration ); }
private BackAndForthMovUnit() { loopTimer = LoopTimer.GetInstance(); cycleStart = loopTimer.GetTotalMs(); }
private CircularMovUnit() { loopTimer = LoopTimer.GetInstance(); cycleStart = loopTimer.GetTotalMs(); }