void playcommands() { time_caculate++; #region Normal Level if (Datas._GameLevel == GameLevel.normal) foreach (TCset tcs in commands) { if (tcs.interval == time_caculate) { tcs.useable = true; } if (tcs.useable) { if (tcs.Name == "fire01") { tcs.TickRun(); //所有计时周期进一格 #region fire01 if (tcs.Tick01 == 10) { int color = 2; if (turnleft) color = 4; //1 Vector2D v = new Vector2D(0, -1); v.rotate(15); Bullet b = new Stage1.Bullet1(texturemanager, v, new Vector2D(Position.X, Position.Y), color, 150); bullet_toAdd.Add(b); //2 v = new Vector2D(0, -1); v.rotate(30); b = new Stage1.Bullet1(texturemanager, v, new Vector2D(Position.X, Position.Y), color, 150); bullet_toAdd.Add(b); //3 v = new Vector2D(0, -1); v.rotate(-15); b = new Stage1.Bullet1(texturemanager, v, new Vector2D(Position.X, Position.Y), color, 150); bullet_toAdd.Add(b); //4 v = new Vector2D(0, -1); v.rotate(-30); b = new Stage1.Bullet1(texturemanager, v, new Vector2D(Position.X, Position.Y), color, 150); bullet_toAdd.Add(b); //5 v = new Vector2D(0, -1); b = new Stage1.Bullet1(texturemanager, v, new Vector2D(Position.X, Position.Y), color, 150); bullet_toAdd.Add(b); tcs.Tick01 = 0; //(Tick01专门控制定周期发射子弹) } #endregion } } if (tcs.caculateTime == time_caculate) { tcs.useable = false; } } #endregion }
void playcommands() { time_caculate++; #region Normal Level if (Datas._GameLevel == GameLevel.normal) foreach (TCset tcs in commands) { if (tcs.interval == time_caculate) { tcs.useable = true; } if (tcs.useable) { if (tcs.Name == "fire01") { tcs.TickRun(); //所有计时周期进一格 #region fire01 if (tcs.Tick01 == 10) { //1 Vector2D v = new Vector2D(0, -1); v.rotate(15); Bullet b = new Stage1.Bullet1(texturemanager, v, new Vector2D(Position.X, Position.Y), 2); bullet_toAdd.Add(b); //2 v = new Vector2D(0, -1); v.rotate(30); b = new Stage1.Bullet1(texturemanager, v, new Vector2D(Position.X, Position.Y), 2); bullet_toAdd.Add(b); //3 v = new Vector2D(0, -1); v.rotate(-15); b = new Stage1.Bullet1(texturemanager, v, new Vector2D(Position.X, Position.Y), 2); bullet_toAdd.Add(b); //4 v = new Vector2D(0, -1); v.rotate(-30); b = new Stage1.Bullet1(texturemanager, v, new Vector2D(Position.X, Position.Y), 2); bullet_toAdd.Add(b); //5 v = new Vector2D(0, -1); b = new Stage1.Bullet1(texturemanager, v, new Vector2D(Position.X, Position.Y), 2); bullet_toAdd.Add(b); tcs.Tick01 = 0; //(Tick01专门控制定周期发射子弹) } #endregion } else if (tcs.Name == "fire02") { tcs.TickRun(); //所有计时周期进一格 #region fire02 if (tcs.Tick01 == 10) { //1 Vector2D v = new Vector2D(0, -1); v.rotate(15); Bullet b = new Stage1.Bullet1(texturemanager, v, new Vector2D(Position.X, Position.Y), 2); bullet_toAdd.Add(b); //2 v = new Vector2D(0, -1); v.rotate(30); b = new Stage1.Bullet1(texturemanager, v, new Vector2D(Position.X, Position.Y), 2); bullet_toAdd.Add(b); //3 v = new Vector2D(0, -1); v.rotate(-15); b = new Stage1.Bullet1(texturemanager, v, new Vector2D(Position.X, Position.Y), 2); bullet_toAdd.Add(b); //4 v = new Vector2D(0, -1); v.rotate(-30); b = new Stage1.Bullet1(texturemanager, v, new Vector2D(Position.X, Position.Y), 2); bullet_toAdd.Add(b); //5 v = new Vector2D(0, -1); b = new Stage1.Bullet1(texturemanager, v, new Vector2D(Position.X, Position.Y), 2); bullet_toAdd.Add(b); tcs.Tick01 = 0; //(Tick01专门控制定周期发射子弹) } #endregion } else if (tcs.Name == "fire03") { tcs.TickRun(); //所有计时周期进一格 #region fire03 if (tcs.Tick01 == 10) { //1 Vector2D v = new Vector2D(0, -1); v.rotate(15); Bullet b = new Stage1.Bullet1(texturemanager, v, new Vector2D(Position.X, Position.Y), 2); bullet_toAdd.Add(b); //2 v = new Vector2D(0, -1); v.rotate(30); b = new Stage1.Bullet1(texturemanager, v, new Vector2D(Position.X, Position.Y), 2); bullet_toAdd.Add(b); //3 v = new Vector2D(0, -1); v.rotate(-15); b = new Stage1.Bullet1(texturemanager, v, new Vector2D(Position.X, Position.Y), 2); bullet_toAdd.Add(b); //4 v = new Vector2D(0, -1); v.rotate(-30); b = new Stage1.Bullet1(texturemanager, v, new Vector2D(Position.X, Position.Y), 2); bullet_toAdd.Add(b); //5 v = new Vector2D(0, -1); b = new Stage1.Bullet1(texturemanager, v, new Vector2D(Position.X, Position.Y), 2); bullet_toAdd.Add(b); tcs.Tick01 = 0; //(Tick01专门控制定周期发射子弹) } #endregion } else if (tcs.Name == "fire04") { tcs.TickRun(); //所有计时周期进一格 #region fire04 if (tcs.Tick01 == 60) { //获取瞄准玩家的方向 vct = new Vector2D(Datas.CurrentPlayer.Position.X - Position.X, Datas.CurrentPlayer.Position.Y - Position.Y).GetNormalize(); Bullet b = new Stage1.Bullet1(texturemanager, new Vector2D(vct.X, vct.Y), new Vector2D(Position.X, Position.Y)); bullet_toAdd.Add(b); tcs.Tick01 = 0; //(Tick01专门控制定周期发射子弹) } #endregion } } if (tcs.caculateTime == time_caculate) { tcs.useable = false; } } #endregion }