public ProjectileManager(LevelScreen lvl) { this.lvl = lvl; this.splashProjectiles = new List <Projectile>(); this.directProjectiles = new List <Projectile>(); // cache bunch of projectiles for (int i = 0; i < 10; i++) { Projectile p = Create("ball", 32, 32, 1); p.Type = ProjectileType.Bomb; p.DefaultAnimName = "ball"; this.splashProjectiles.Add(p); } for (int i = 0; i < 50; i++) { Projectile p = Create("arrow", 15, 15, 3); p.Type = ProjectileType.Arrow; p.DefaultAnimName = "arrow"; this.directProjectiles.Add(p); } }
public ProjectileManager(LevelScreen lvl) { this.lvl = lvl; this.splashProjectiles = new List<Projectile>(); this.directProjectiles = new List<Projectile>(); // cache bunch of projectiles for (int i = 0; i < 10; i++) { Projectile p = Create("ball", 32, 32, 1); p.Type = ProjectileType.Bomb; p.DefaultAnimName = "ball"; this.splashProjectiles.Add(p); } for (int i = 0; i < 50; i++) { Projectile p = Create("arrow", 15, 15, 3); p.Type = ProjectileType.Arrow; p.DefaultAnimName = "arrow"; this.directProjectiles.Add(p); } }
public override void Initialize(GnomicGame game) { levelScreen = ParentGame.GetScreen <LevelScreen>(); Vector2 imageSize = new Vector2(64.0f / 720.0f); Vector2 topRight = new Vector2(ParentGame.ScreenWidth, -ParentGame.ScreenHeight) * (0.5f / ParentGame.ScreenHeight) - new Vector2(imageSize.X, -imageSize.Y); IconMoveRight = base.AddSprite("IconMove", imageSize, topRight, new Vector2(0.5f), true); IconMoveLeft = base.AddSprite("IconMove", imageSize, topRight - new Vector2(imageSize.X, 0.0f), new Vector2(0.5f), true); IconMoveLeft.Settings.SpriteEffects = SpriteEffects.FlipHorizontally; ClipEntitySettings settings; settings = new ClipEntitySettings(); settings.ClipFile = "heart"; settings.Scale = Vector2.One; settings.DefaultAnimName = "heartBG"; settings.Position = new Vector2(90, 90); HeartBG = (ClipEntity)settings.CreateEntity(); base.AddEntity(HeartBG); settings = new ClipEntitySettings(); settings.ClipFile = "heart"; settings.Scale = Vector2.One * 0.5f; settings.DefaultAnimName = "beatA"; settings.Position = new Vector2(90, 90); Heart = (ClipEntity)settings.CreateEntity(); base.AddEntity(Heart); font = Content.Load <SpriteFont>("UIFont"); base.Initialize(game); IconMoveRight.Visible = false; IconMoveLeft.Visible = false; }
public override void Initialize(GnomicGame game) { levelScreen = ParentGame.GetScreen<LevelScreen>(); Vector2 imageSize = new Vector2(64.0f / 720.0f); Vector2 topRight = new Vector2(ParentGame.ScreenWidth, -ParentGame.ScreenHeight) * (0.5f / ParentGame.ScreenHeight) - new Vector2(imageSize.X, -imageSize.Y); IconMoveRight = base.AddSprite("IconMove", imageSize, topRight, new Vector2(0.5f), true); IconMoveLeft = base.AddSprite("IconMove", imageSize, topRight - new Vector2(imageSize.X, 0.0f), new Vector2(0.5f), true); IconMoveLeft.Settings.SpriteEffects = SpriteEffects.FlipHorizontally; ClipEntitySettings settings; settings = new ClipEntitySettings(); settings.ClipFile = "heart"; settings.Scale = Vector2.One; settings.DefaultAnimName = "heartBG"; settings.Position = new Vector2(90, 90); HeartBG = (ClipEntity)settings.CreateEntity(); base.AddEntity(HeartBG); settings = new ClipEntitySettings(); settings.ClipFile = "heart"; settings.Scale = Vector2.One * 0.5f; settings.DefaultAnimName = "beatA"; settings.Position = new Vector2(90, 90); Heart = (ClipEntity)settings.CreateEntity(); base.AddEntity(Heart); font = Content.Load<SpriteFont>("UIFont"); base.Initialize(game); IconMoveRight.Visible = false; IconMoveLeft.Visible = false; }
public UnitManager(LevelScreen screen) { this.screen = screen; behaviours = new BehaviourManager(); Settings unitSettings = null; { unitSettings = new Settings { Health = 100, Damage = 30, AttackInterval = 0.1f, Speed = 4000 }; enemyClipNames[UnitType.Grunt] = "enemy"; settings[UnitType.Grunt] = unitSettings; unitLists[UnitType.Grunt] = new List <Unit>(20); } { unitSettings = new Settings { Health = 100, Damage = 30, AttackInterval = 0.1f, Speed = 4000 }; enemyClipNames[UnitType.Captain] = "enemy"; settings[UnitType.Captain] = unitSettings; unitLists[UnitType.Captain] = new List <Unit>(20); } { unitSettings = new Settings { Health = 100, Damage = 30, AttackInterval = 0.1f, Speed = 4000 }; enemyClipNames[UnitType.Boss] = "enemy"; settings[UnitType.Boss] = unitSettings; unitLists[UnitType.Boss] = new List <Unit>(20); } { unitSettings = new Settings { Health = 100, Damage = 40, AttackInterval = 0.1f, Speed = 4000 }; enemyClipNames[UnitType.Knight] = "knight"; settings[UnitType.Knight] = unitSettings; unitLists[UnitType.Knight] = new List <Unit>(20); } for (int i = 0; i < NUM_LANES; ++i) { lanes[i] = LANE_START + (i * LANE_OFFSET); } laneCategories[0] = (Category)SpinelessCollisionCategories.Lane1; laneCategories[1] = (Category)SpinelessCollisionCategories.Lane2; laneCategories[2] = (Category)SpinelessCollisionCategories.Lane3; for (int i = 0; i < 10; ++i) { Create(UnitType.Grunt); Create(UnitType.Captain); Create(UnitType.Boss); Create(UnitType.Knight); } }