static DescriptionBag() { Add("TitleOnly", x => x.Title = "Only a title"); Add("TitleAndShortDescription", x => { x.Title = "The title text"; x.ShortDescription = "The short description"; }); Add("TitleAndShortAndLongDescription", x => { x.Title = "The title text"; x.ShortDescription = "The short description"; x.LongDescription = "A really long description that might be truncated later"; }); Add("WithProperties", x => { x.Title = "The title text"; x.ShortDescription = "The short description"; x.Properties["Color"] = "Red"; x.Properties["Direction"] = "South"; x.Properties["Order"] = "1"; }); Add("WithChildren", x => { x.Title = "Description with children"; x.ShortDescription = "More stuff here"; x.Children["One"] = _bag["TitleOnly"]; x.Children["Two"] = _bag["TitleAndShortAndLongDescription"]; x.Children["Three"] = _bag["WithProperties"]; }); Add("BulletList", x => { x.Title = "The title text"; x.ShortDescription = "The short description"; var list = new BulletList { Name = "Handlers" }; list.Children.Add(_bag["TitleOnly"]); list.Children.Add(_bag["TitleAndShortAndLongDescription"]); list.Children.Add(_bag["WithProperties"]); list.Children.Add(_bag["WithChildren"]); x.BulletLists.Add(list); }); }
// Use this for initialization void Start() { // 左右の魔法の種類を初期化 rightMagicNum = 1; leftMagicNum = 1; _BulletList = GameObject.Find("BulletList").GetComponent <BulletList>(); bulletKindRight = _BulletList._bulletList[0].normalBullet[1]; bulletKindLeft = _BulletList._bulletList[0].normalBullet[1]; }
public void SetUp() { theLibrary = new ConverterLibrary(); var basicConverterFamily = new BasicConverterFamily(theLibrary); theDescription = Description.For(basicConverterFamily); // Just lifts the Family list right off of ConverterLibrary theFamilyList = theDescription.BulletLists.Single(); }
// Use this for initialization void Start() { // ballRenderer = ball.GetComponent<Renderer>(); bulletList = GameObject.Find("BulletList").GetComponent <BulletList>(); // 右手の弾の初期値 // bulletKindRight = bulletList._bulletList[0].normalBullet[bulletNum]; bookAnim = GameObject.Find("BookRight").GetComponent <Animator>(); }
// // GET: /Bullet/ public ActionResult Index(int Id = 0) { BulletList bullet = new BulletList(); if (Id > 0) { bullet = MyDB.BulletLists.SingleOrDefault(m => m.Id == Id); } return(PartialView(bullet)); }
public ActionResult Create(BulletList bullet) { try { //if (ModelState.IsValid) //{ MyDB.BulletLists.Add(bullet); MyDB.SaveChanges(); //} } catch { } return(PartialView()); }
private void ClearEmitter() { for (int index = EnemyPlaneList.Count - 1; index >= 0; --index) { if (!(EnemyPlaneList[index] is BaseSpellCard)) { EnemyPlaneList[index].GiveEndEffect(); EnemyPlaneList.RemoveAt(index); } } foreach (BaseObject bullet in BulletList) { bullet.GiveEndEffect(); } BulletList.Clear(); }
public static string RenderList(List <BulletListItem> list) { var sb = new StringBuilder(); if (list != null && list.Count > 0) { sb.Append("<ul>"); foreach (var item in list) { sb.Append(item.Content); sb.Append(BulletList.RenderList(item.Children)); } sb.Append("</ul>"); } return(sb.ToString()); }
public static void KillBulletWithFirePort(int portIdx, RangerAgent ra) { BulletList bulletListSource = ra._bulletListSource; FirePort[] firePorts = ra._firePorts; if (firePorts != null && portIdx < firePorts.Length) { if (firePorts[portIdx]._fireCount != 0) { for (int i = 0; i < firePorts[portIdx]._bulletNames.Length; i++) { bulletListSource.KillABulletByNameAndFireport(firePorts[portIdx]._bulletNames[i], firePorts[portIdx]._portName); } } } }
public void accept_visitory_with_multiple_bullet_lists() { var repo = new MockRepository(); var visitor = repo.StrictMock <IDescriptionVisitor>(); var description = new Description(); var list = new BulletList(); list.Children.Add(new Description()); list.Children.Add(new Description()); list.Children.Add(new Description()); description.BulletLists.Add(list); description.BulletLists.Add(new BulletList()); using (repo.Record()) { visitor.Start(description); visitor.StartList(list); visitor.Start(list.Children[0]); visitor.End(); visitor.Start(list.Children[1]); visitor.End(); visitor.Start(list.Children[2]); visitor.End(); visitor.EndList(); visitor.StartList(description.BulletLists.Last()); visitor.EndList(); visitor.End(); } using (repo.Playback()) { description.AcceptVisitor(visitor); } }
static void BulletSample() { var list = new BulletList("lst"); list.Margin.All = 1; list.BackgroundColor = TWidgetColor.DarkBlue; list.ForegroundColor = TWidgetColor.White; list.Items = new string[] { "Uno", "Dos", "Tres" }; Player.Mount(list); Console.WriteLine("--END--"); }
public void Describe(Description description) { description.Title = "OWIN Settings"; description.ShortDescription = "Governs the attachment and ordering of OWIN middleware plus OWIN host properties"; Properties.Each(x => description.Properties[x.Key] = x.Value.ToString()); EnvironmentData.Each((key, value) => description.Properties[key] = value.ToString()); var middleware = new BulletList { Name = "Middleware", Label = "Middleware" }; Middleware.Each(x => middleware.Children.Add(x.ToDescription())); description.BulletLists.Add(middleware); }
public void bullet_list_accept_visitor_with_no_innards() { var repo = new MockRepository(); var visitor = repo.StrictMock <IDescriptionVisitor>(); var list = new BulletList(); using (repo.Record()) { visitor.StartList(list); visitor.EndList(); } using (repo.Playback()) { list.AcceptVisitor(visitor); } }
void DescribesItself.Describe(Description description) { var list = new BulletList { Name = "Assemblies" }; _assemblies.Each(assem => { list.Children.Add(new Description { Title = assem.FullName }); }); description.Title = "Action Source"; description.BulletLists.Add(list); description.LongDescription = _description.ToString(); }
public void BulletListTest() { var canvas = new Canvas(20, 10, '#'); var graphics = new Graphics(canvas); var widget = new BulletList("demo"); widget.Items = new string[] { "Four", "Five", "Nine" }; widget.Draw(graphics); Assert.Equal("■ Four##############", canvas.Map[0]); Assert.Equal("■ Five##############", canvas.Map[1]); Assert.Equal("■ Nine##############", canvas.Map[2]); Assert.Equal(3, canvas.Rows); canvas = new Canvas(20, 10, '#'); graphics = new Graphics(canvas); widget.TextAlign = Align.Center; widget.Draw(graphics); Assert.Equal("#######■ Four#######", canvas.Map[0]); Assert.Equal("#######■ Five#######", canvas.Map[1]); Assert.Equal("#######■ Nine#######", canvas.Map[2]); Assert.Equal(3, canvas.Rows); canvas = new Canvas(20, 10, '#'); graphics = new Graphics(canvas); widget.TextAlign = Align.Right; widget.Draw(graphics); Assert.Equal("##############■ Four", canvas.Map[0]); Assert.Equal("##############■ Five", canvas.Map[1]); Assert.Equal("##############■ Nine", canvas.Map[2]); Assert.Equal(3, canvas.Rows); }
/// <summary> /// Manages all the bullets and their collisions on screen as well as remove them from their list if they are inActive /// Does NOT move the bullets since that needs to be frame dependent and this can be on a different thread /// </summary> private void BulletManage() { //Manage enemy bullets if (BulletList.Count > 0) { int count = BulletList.Count; for (int i = 0; i < count; i++) { Bullet currB = BulletList[i]; currB.CheckCollision(P1); //Take the bullet out of the list if the collision check caused it to be inactive if (!currB.IsActive) { BulletList.Remove(currB); } count = BulletList.Count; } } //Manage player bullets if (PlayerBulletList.Count > 0) { int count = PlayerBulletList.Count; for (int i = 0; i < count; i++) { PlayerBullet currPB = PlayerBulletList[i]; currPB.CheckCollision(EnemyList); //Take the bullet out of the list if the collision check caused it to be inactive if (!currPB.IsActive) { PlayerBulletList.Remove(currPB); } //Updates the for loop boundary since a bullet could be added before it finishes count = PlayerBulletList.Count; } } }
public override void Ctrl() { if (Time % CtrlCircle == 0) { KC = new KeyClass { Key_Z = true }; Vector2 move = GenerateMove(); double num1 = -move.X; double num2 = -move.Y; if (move.Length() < 80.0) { KC.Key_Shift = true; } if (num1 > 1.0) { KC.ArrowLeft = true; } else if (num1 < -1.0) { KC.ArrowRight = true; } if (num2 > 1.0) { KC.ArrowUp = true; } else if (num2 < -1.0) { KC.ArrowDown = true; } } BulletList.ForEach(x => { if (!x.HitCheck(this, x.Region) && DeadTime <= Time) { return; } KC.Key_X = true; }); StageData.GlobalData.KClass.Hex2Key(KC.Key2Hex()); base.Ctrl(); }
public void BulletUpdate() { if (BulletList.Count != 0) { for (int i = BulletList.Count - 1; i >= 0; i--) { if (BulletList[i].BulletLocation.X > Globals.GameWindowX) { BulletList.RemoveAt(i); } else { BulletList[i].Update(); } } } if (CurBulletCoolDown < BulletCoolDown) { CurBulletCoolDown += 1; } }
void CustomActivity(bool firstTimeCalled) { if (InputManager.Keyboard.KeyDown(Keys.Left)) { var radians = PlayerInstance.RotationDegreesPerSecond * (Math.PI / 180) * TimeManager.SecondDifference; PlayerInstance.RotationZ += (float)radians; } if (InputManager.Keyboard.KeyDown(Keys.Right)) { var radians = PlayerInstance.RotationDegreesPerSecond * (Math.PI / 180) * TimeManager.SecondDifference; PlayerInstance.RotationZ -= (float)radians; } if (InputManager.Keyboard.KeyReleased(Keys.Space)) { var bullet = new Bullet(); bullet.Velocity.X = (float)(bullet.Speed * Math.Cos(PlayerInstance.RotationZ)); bullet.Velocity.Y = (float)(bullet.Speed * Math.Sin(PlayerInstance.RotationZ)); bullet.RotationZ = PlayerInstance.RotationZ; BulletList.Add(bullet); } if (InputManager.Keyboard.KeyReleased(Keys.Escape)) { if (IsPaused) { UnpauseThisScreen(); } else { PauseThisScreen(); } } if (InputManager.Keyboard.KeyReleased(Keys.F12)) { RestartScreen(true); } }
public void ClearList() { for (int i = NextLevelEntityList.Count - 1; i >= 0; i--) { NextLevelEntityList[i].Destroy(); } for (int x = ActionEntityList.Count - 1; x >= 0; x--) { ActionEntityList[x].Destroy(); } for (int z = BulletList.Count - 1; z >= 0; z--) { BulletList[z].Destroy(); } for (int y = SignEntityList.Count - 1; y >= 0; y--) { SignEntityList[y].Destroy(); } for (int g = EnemyCornerList.Count - 1; g >= 0; g--) { EnemyCornerList[g].Destroy(); } for (int h = GroundEnemyList.Count - 1; h >= 0; h--) { GroundEnemyList[h].Destroy(); } for (int o = EnemyBulletList.Count - 1; o >= 0; o--) { EnemyBulletList[o].Destroy(); } NextLevelEntityList.Clear(); ActionEntityList.Clear(); BulletList.Clear(); EnemyBulletList.Clear(); GroundEnemyList.Clear(); SignEntityList.Clear(); EnemyCornerList.Clear(); }
public override void Shoot() { if (DateTime.Now > nextAttackTime && ammunition >= 1) { ammunition--; nextAttackTime = DateTime.Now.AddMilliseconds(attackSpeed); float yValue = position.Y + ObjectSize.Height / 2 - standartBulletSize.Height / 2; Vector2 leftBulletPosition = new Vector2(position.X, yValue); Vector2 midleBulletPosition = new Vector2(position.X + ObjectSize.Width / 2 - standartBulletSize.Width / 2, yValue); Vector2 rightBulletPosition = new Vector2(position.X + ObjectSize.Width - standartBulletSize.Width, yValue); newBullet = new Bullet(BulletSkin, leftBulletPosition, standartBulletSize, 1, this); BulletList.Add(newBullet); newBullet = new Bullet(BulletSkin, midleBulletPosition, standartBulletSize, 0, this); BulletList.Add(newBullet); newBullet = new Bullet(BulletSkin, rightBulletPosition, standartBulletSize, 2, this); BulletList.Add(newBullet); } }
public void EndBulletList(BulletList list) { curLists.Pop(); }
private void writeBulletList(BulletList list) { Add("div").AddClass("desc-list-name").Text(list.Label ?? list.Name); list.Children.Each(writeBulletItem); }
private string FormatBulletList(BulletList comment) { return(formatInlineList(comment.Items, "<ul>{0}</ul>", "<li>{0}{1}</li>", "{0}", "{0}")); }
public void StartBulletList(BulletList list) { Write("list (type=bullet tight={0})", list.IsTight); indent += IndentBy; }
public void EndBulletList(BulletList list) { indent -= IndentBy; }
public static IDisposable UxBulletList(this HtmlHelper htmlHelper, bool customIcons = false, int columnCount = 1, string clientId = null) { var list = new BulletList(customIcons, columnCount, clientId); return RenderUxDispoableWebControl(htmlHelper, list); }
public override BulletList VisitBulletList(BulletList bulletList) { bulletList = bulletListDelegate?.Invoke(bulletList) ?? bulletList; return(base.VisitBulletList(bulletList)); }
public void StartBulletList(BulletList list) { curLists.Push(null); }
/// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) { Exit(); } currState = Keyboard.GetState(); //Update keyboard state //If the game is at the menu, only check if the player pressed enter. if (gameState == GameState.Menu) { if (currState.IsKeyUp(Keys.Enter) && prevState.IsKeyDown(Keys.Enter)) { gameState = GameState.Controls; } prevState = currState; //Set previous state to last current state } //If the game is at the controls else if (gameState == GameState.Controls) { if (currState.IsKeyUp(Keys.Enter) && prevState.IsKeyDown(Keys.Enter)) { gameState = GameState.InWave; } } //If the game is playing else if (gameState == GameState.InWave) { if (P1.Health <= 0) { gameState = GameState.GameOver; //Clear out the bullets BulletList.Clear(); PlayerBulletList.Clear(); } //Check if the player paused the game if (currState.IsKeyUp(Keys.P) && prevState.IsKeyDown(Keys.P)) { gameState = GameState.Pause; } // activate developer tool if (currState.IsKeyUp(Keys.F1) && prevState.IsKeyDown(Keys.F1)) { GameBalanceTool gameBalance = new GameBalanceTool(); gameBalance.Show(); } //Check for player movement P1.Movement(); //Move and Manage enemies and bullets MoveBullets(); MoveEnemies(); BulletManage(); EnemyManage(); //Manage the wave WaveManage(); /** Threading code to use if optimization needed * bulletThread = new Thread(BulletManage); * bulletThread.Start(); */ //keeps tank from moving past screen if (P1.position.X < 0) { P1.position.X = 0; } if (P1.position.X > GAME_WIDTH - P1.position.Width) { P1.position.X = GAME_WIDTH - P1.position.Width; } } else if (gameState == GameState.Pause) { //Check if player unpaused the game if (currState.IsKeyUp(Keys.P) && prevState.IsKeyDown(Keys.P)) { gameState = GameState.InWave; } } else if (gameState == GameState.GameOver) { if (currState.IsKeyUp(Keys.Enter) && prevState.IsKeyDown(Keys.Enter)) { //Reset player P1.Reset(); //Clear all active items off screen bulletList.Clear(); playerBulletList.Clear(); enemyList.Clear(); //Reset the wave currWave = new Wave(); enemyIndex = 0; currCoolDown = spawnCoolDown; gameState = GameState.InWave; //Go back to a new game } } prevState = currState; //Update prev keyboard state base.Update(gameTime); }
public void ShootBullet() { float x = EmitPoint.X; float y = EmitPoint.Y; PointF originalPosition; float num1; if (x == -99999.0) { originalPosition = MyPlane.OriginalPosition; num1 = originalPosition.X; } else if (x == -99998.0) { originalPosition = this.OriginalPosition; num1 = originalPosition.X; } else { num1 = (float)(x - 320.0 + 192.0); } float num2; if (y == -99999.0) { originalPosition = MyPlane.OriginalPosition; num2 = originalPosition.Y; } else if (y == -99998.0) { originalPosition = this.OriginalPosition; num2 = originalPosition.Y; } else { num2 = (float)(y - 240.0 + 224.0); } if (EmitterMode == EmitterMode.StraightLaser || EmitterMode == EmitterMode.RadialLaser || EmitterMode == EmitterMode.BendLaser) { originalPosition = this.OriginalPosition; num1 = originalPosition.X; originalPosition = this.OriginalPosition; num2 = originalPosition.Y; } PointF OriginalPosition = new PointF(num1 + RanX * (float)Ran.NextPMDouble(), num2 + RanY * (float)Ran.NextPMDouble()); double edi = EmitDirection != -99999.0 ? (EmitDirection + RanEmitDirection * Ran.NextPMDouble() + SubBullet.RanDirection * Ran.NextPMDouble()) * Math.PI / 180.0 : GetDirection(MyPlane) + (RanEmitDirection * Ran.NextPMDouble() + SubBullet.RanDirection * Ran.NextPMDouble()) * Math.PI / 180.0; double num3 = RadiusDirection != -99999.0 ? (RadiusDirection + RanRadiusDirection * Ran.NextPMDouble()) * Math.PI / 180.0 : GetDirection(MyPlane) + RanRadiusDirection * Ran.NextPMDouble() * Math.PI / 180.0; float num4 = EmitRadius + RanRadius * (float)Ran.NextPMDouble(); int num5 = Way + (int)(RanWay * Ran.NextPMDouble()); float num6 = SubBullet.Velocity + SubBullet.RanVelocity * (float)Ran.NextPMDouble(); float num7 = SubBullet.AccelerateCS + SubBullet.RanAccelerate * (float)Ran.NextPMDouble(); double num8 = SubBullet.AccDirection + SubBullet.RanAccDirection; double num9 = Range + RanRange * Ran.NextPMDouble(); if (RDirectionWithDirection) { num3 += edi; } double num10 = num9 * Math.PI / 180.0 / num5; edi -= (num5 - 1) * num10 / 2.0; double num11 = num3 - (num5 - 1) * num10 / 2.0; if (EffectType == 2) { EmitterSaveEnegy3D emitterSaveEnegy3D = new EmitterSaveEnegy3D(StageData, OriginalPosition, CSEffect.ColorValue); StageData.SoundPlay("se_ch02.wav"); } else if (EffectType == 3) { EmitterGiveOutEnegy3D emitterGiveOutEnegy3D = new EmitterGiveOutEnegy3D(StageData, OriginalPosition, CSEffect.ColorValue); StageData.SoundPlay("se_cat00.wav"); StageData.SoundPlay("se_enep02.wav"); } else { for (int index1 = 0; index1 < num5; ++index1) { PointF p = new PointF(OriginalPosition.X + num4 * (float)Math.Cos(num11), OriginalPosition.Y + num4 * (float)Math.Sin(num11)); for (int index2 = 0; index2 < Count; ++index2) { if (EmitterMode == EmitterMode.Bullet || EmitterMode == EmitterMode.StraightLaser || EmitterMode == EmitterMode.RadialLaser || EmitterMode == EmitterMode.BendLaser) { BaseBullet_Touhou b = new BaseBullet_Touhou(StageData); if (CSBullet != null) { b = (BaseBullet_Touhou)CSBullet.Clone(); b.OriginalPosition = p; b.GhostingCount = b.GhostingCount; b.AngleDegree += CSBullet.RanAngle * Ran.NextPMDouble(); } else if (CSLaserS != null) { b = (BaseBullet_Touhou)CSLaserS.Clone(); b.OriginalPosition = p; b.Angle = -1.0 * Math.PI / 2.0; b.Active = true; } else if (CSLaserR != null) { b = (BaseBullet_Touhou)CSLaserR.Clone(); b.OriginalPosition = p; b.Angle = Math.PI / 2.0; b.UnRemoveable = true; b.Active = true; } else if (CSLaserB != null) { b = (BaseBullet_Touhou)CSLaserB.Clone(); b.OriginalPosition = p; b.UnRemoveable = true; b.Active = true; } b.GhostingCount = b.GhostingCount; b.Velocity = num6 - index2 * DeltaV; b.Direction = edi; b.AccelerateCS = num7; b.AccDirection = num8; b.ID = ID; b.LayerID = LayerID; if (MotionBinding) { b.SetBinding(this); } BulletList.Add(b); if (EmitterMode == EmitterMode.Bullet) { CSData.EmitterList.ForEach(em => { if (em.BindingID != ID) { return; } b.UnRemoveable = true; BaseEmitter_CS baseEmitterCs = (BaseEmitter_CS)em.Clone(); StageData.EnemyPlaneList.Add(baseEmitterCs); baseEmitterCs.OriginalPosition = p; baseEmitterCs.LifeTime = SubBullet.LifeTime; baseEmitterCs.ColorValue = SubBullet.ColorValue; baseEmitterCs.TransparentValueF = SubBullet.TransparentValueF; baseEmitterCs.Direction = edi; baseEmitterCs.DestPoint = SubBullet.DestPoint; baseEmitterCs.Active = SubBullet.Active; baseEmitterCs.OutBound = SubBullet.OutBound; if (baseEmitterCs.BindWithDirection) { baseEmitterCs.EmitDirection += edi * 180.0 / Math.PI; } baseEmitterCs.SetBinding(b); if (!baseEmitterCs.DeepBinding) { baseEmitterCs.Time = Time; baseEmitterCs.LifeTime = Math.Min(SubBullet.LifeTime + Time, em.StartTime + em.Duration); } }); } } else if (EmitterMode == EmitterMode.Enemy) { BaseEnemyPlane_Touhou enemy = (BaseEnemyPlane_Touhou)SubBullet.Clone(); enemy.LifeTime = 0; enemy.OriginalPosition = p; enemy.GhostingCount = enemy.GhostingCount; enemy.Velocity = num6 - index2 * DeltaV; enemy.Direction = edi; enemy.AccelerateCS = num7; enemy.AccDirection = num8; enemy.ID = ID; enemy.LayerID = LayerID; if (MotionBinding) { enemy.SetBinding(this); } EnemyPlaneList.Add(enemy); CSData.EmitterList.ForEach(em => { if (em.BindingID != ID) { return; } BaseEmitter_CS baseEmitterCs = (BaseEmitter_CS)em.Clone(); StageData.EnemyPlaneList.Add(baseEmitterCs); baseEmitterCs.OriginalPosition = p; baseEmitterCs.LifeTime = SubBullet.LifeTime; baseEmitterCs.ColorValue = SubBullet.ColorValue; baseEmitterCs.TransparentValueF = SubBullet.TransparentValueF; baseEmitterCs.Direction = edi; baseEmitterCs.DestPoint = SubBullet.DestPoint; baseEmitterCs.Active = SubBullet.Active; baseEmitterCs.OutBound = SubBullet.OutBound; baseEmitterCs.SetBinding(enemy); if (baseEmitterCs.BindWithDirection) { baseEmitterCs.EmitDirection += edi * 180.0 / Math.PI; } if (!baseEmitterCs.DeepBinding) { baseEmitterCs.Time = Time; baseEmitterCs.LifeTime = Math.Min(SubBullet.LifeTime + Time, em.StartTime + em.Duration); } }); } else if (EmitterMode == EmitterMode.Effect) { BaseEffect_CS baseEffectCs = (BaseEffect_CS)CSEffect.Clone(); baseEffectCs.OriginalPosition = p; baseEffectCs.GhostingCount = baseEffectCs.GhostingCount; baseEffectCs.AngleDegree += CSEffect.RanAngle * Ran.NextPMDouble(); baseEffectCs.Velocity = num6 - index2 * DeltaV; baseEffectCs.Direction = edi; baseEffectCs.AccelerateCS = num7; baseEffectCs.AccDirection = num8; baseEffectCs.ID = ID; baseEffectCs.LayerID = LayerID; if (MotionBinding) { baseEffectCs.SetBinding(this); } EffectList.Add(baseEffectCs); } } num11 += num10; edi += num10; if (SpecifySE) { StageData.SoundPlay(SoundName); } else if (EmitterMode == EmitterMode.Bullet) { StageData.SoundPlay("se_tan00a.wav", OriginalPosition.X / BoundRect.Width); } else if (EmitterMode == EmitterMode.StraightLaser || EmitterMode == EmitterMode.RadialLaser) { StageData.SoundPlay("se_lazer00.wav", OriginalPosition.X / BoundRect.Width); } } } }
public void EndBulletList(BulletList list) { writer.WriteLine("</ul>"); }
/// <summary> /// Update scene logics /// </summary> /// <param name="gameTime"></param> public override void Update(GameTime gameTime) { this.camera.Update(gameTime.ElapsedGameTime, ref this.collisionMesh, GamePad.GetState(PlayerIndex.One), Keyboard.GetState()); this.player.Update(gameTime, this.collisionMesh); GamePadState gps = GamePad.GetState(PlayerIndex.One); KeyboardState kbs = Keyboard.GetState(); if (gps.Buttons.Y == ButtonState.Pressed || kbs.IsKeyDown(Keys.Enter)) { if (this.player.ActualGun != null) { Bullet b = this.player.ActualGun.Shot(); if (b != null) { Vector3 position = this.camera.GetWorldVector(3); Vector3 speed = -this.camera.GetWorldVector(2) * 1000.0f; b.Position = position; b.Speed = speed; this.bullets.Add(b); } } } this.CheckCollisions(gameTime); //Manages dead enemies EnemiesList deadEnemies = new EnemiesList(); foreach (KeyValuePair<String, Enemy> kvp in this.enemies) { if (kvp.Value.Dead) { deadEnemies.Add(kvp.Key, kvp.Value); } } foreach (string key in deadEnemies.Keys) { this.enemies.Remove(key); } foreach (Enemy e in this.enemies.Values) { e.Update(gameTime, this.camera.world.Translation, ref this.camera.view, ref this.camera.projection, ref this.collisionMesh); } ///Manages bullets BulletList deadBullets = new BulletList(); foreach (Bullet b in this.bullets) { if (b.Dead) { deadBullets.Add(b); } else { b.Update(gameTime, this.collisionMesh); } } foreach (Bullet b in deadBullets) { this.bullets.Remove(b); } }
public override void Update(GameTime gameTime) { foreach (BulletClass bullet in bulletList) //removing the bullet from the bulletlist once it travels far enough that player can't see it { bool breakOut = false; //is the bullet to be removed from the list? foreach (Walls wall in wallList) //check for each existing wall { if (bullet.BoundingBox.Intersects(wall.BoundingBox)) //if intersects { if (bullet.BulletFromWhatWeapon == WEAPONTYPE.GRENADE) //if the bullet fired is a grenade, it will expode and do damage regardless { explodeGrenade = true; grenadePosition = bullet.Position; BulletList.Remove(bullet); breakOut = true; break; } else if (!wall.IsDestroyable) //if the wall isn't destoryable, remove bullet { MediaPlayer.Play(sfxBulletImpactConcrete); bulletList.Remove(bullet); //remove this bullet breakOut = true; //set break out of foreach loop break; //break out of this first loop } else if (wall.IsDestroyable && wall.WallHealth > 0) { MediaPlayer.Play(sfxBulletImpactWood); wall.WallHealth -= bullet.BulletWallDmg; bullet.BulletDmg = (int)(bullet.BulletDmg * 0.75f); bullet.BulletWallDmg = (int)(bullet.BulletWallDmg * 0.5f); } } } if (breakOut) //if breakout of foreach bullet loop is true { break; //break } else { bullet.Position += bullet.Increment; //if not, increment the bullet } if ((bullet.Position.X > 100 || bullet.Position.Z > 100) || (bullet.Position.X < -100 || bullet.Position.Z < -100)) //if the bullet is too far outside of player view { bulletList.Remove(bullet); //remove bullet break; //break out of list so it doesn't error out } Vector3 bbMin = bullet.BoundingBox.Min + bullet.Increment; //incrementing the bullet bounding box Vector3 bbMax = bullet.BoundingBox.Max + bullet.Increment; bullet.BoundingBox = new BoundingBox(bbMin, bbMax); } //if grenade is exploding, this happens when grenade impacts the wall if (explodeGrenade) { sfxGrenadeExplosion.Play(); sfxGrenadeTinnitus.Play(); //the bounding boxes for deciding how much damage to apply BoundingBox grenadeRadiusHalfDMG = new BoundingBox(bbMinHalf + grenadePosition, bbMaxHalf + grenadePosition); BoundingBox grenadeRadiusFullDMG = new BoundingBox(bbMinFull + grenadePosition, bbMaxFull + grenadePosition); BoundingBox playerHalfDMG = new BoundingBox(bbPMinHalf + grenadePosition, bbPMaxHalf + grenadePosition); BoundingBox playerFullDMG = new BoundingBox(bbPMinFull + grenadePosition, bbPMaxFull + grenadePosition); foreach (Walls wall in wallList) //see if walls are destoryable { if (wall.IsDestroyable && wall.BoundingBox.Intersects(grenadeRadiusFullDMG)) { wall.WallHealth -= 200; //magic numbers for wall damage } else if (wall.IsDestroyable && wall.BoundingBox.Intersects(grenadeRadiusHalfDMG)) { wall.WallHealth -= 70; } } //for player damage, uses difference bounding boxes for max and half damage if (playerFullDMG.Intersects(playerBoundingBox)) { playerHealth -= 50; } else if (playerHalfDMG.Intersects(playerBoundingBox)) { playerHealth -= 25; } explodeGrenade = false; } base.Update(gameTime); }
// Use this for initialization void Start() { reserveList = BulletList.GetBulletList(BULLET_MAX, "bullet"); activeList = new LinkedList <Bullet>(); }
public override void FireBullet() { //System.Diagnostics.Debug.WriteLine("Shots Fired"); BulletList.Add(new Bullet(new Vector2(shipLocation.X + Width, shipLocation.Y + Height / 2), Globals.GameWindowY / BulletScale, (Globals.GameWindowY / BulletScale) * (int)(bulletTexture.Bounds.Height / bulletTexture.Bounds.Width), 35, 0)); }
// Use this for initialization void Start() { reserveList = BulletList.GetBulletList(BULLET_MAX, "en_bullet"); activeList = new LinkedList <Bullet>(); audioEffect = GetComponents <AudioSource>(); }
private string FormatBulletList(BulletList comment) { return formatInlineList(comment.Items, "<ul>{0}</ul>", "<li>{0}{1}</li>", "{0}", "{0}"); }
public void StartBulletList(BulletList list) { // make sure a list starts at the beginning of the line: EnsureNewlineEnding(writer); writer.Write("<ul>"); }