今キー入力でシーン移動なのですが
Enemyを倒したらクリアにしたいです
どのようにしたらいいのでしょう
宜しければ知恵をお貸しください
public
1 { 2 if (Keyboard.GetState().IsKeyDown(Keys.Space)) 3 { 4 this.isEnd = true; 5 6 } 7 } 8 9class Enemy2 : Character 10 { 11 private Vector2 velocity; 12 13 14 public static int Length { get; internal set; } 15 16 17 public Enemy2(Vector2 position) 18 : base("敵", new Vector2(150f, 350.0f), 32.0f) 19 { 20 21 } 22 23 24 public override void Update() 25 { 26 velocity = Vector2.Zero; 27 position = new Vector2( 28 rnd.Next(Screen.Width - 64), 29 (Screen.Height - 64)); 30 velocity = new Vector2(-10f, -450f); 31 32 33 34 35 36 37 if (position.X < 0) 38 { 39 velocity = -velocity; 40 41 42 } 43 else if (position.X >= Screen.Width - 64) 44 { 45 velocity = -velocity; 46 47 48 } 49 position += velocity; 50 var min = new Vector2(radius, radius); 51 var max = new Vector2(828.0f - 100.0f, 792.0f - 100.0f); 52 position = Vector2.Clamp(position, min, max); 53 54 } 55 public override void Hit(Character character) 56 { 57 if (character is Bullet || character is Player) 58 { 59 isDead = true; 60 } 61 62 63 64 } 65 public override Character New() 66 { 67 return null; 68 } 69 } 70 71 class Enemy : Character 72 { 73 private Vector2 velocity; 74 75 76 public static int Length { get; internal set; } 77 public static object PlayerPos { get; internal set; } 78 79 public Enemy(Vector2 position) 80 : base("敵", new Vector2(350f, 50.0f), 32.0f) 81 { 82 83 } 84 85 86 public override void Update() 87 { 88 velocity = Vector2.Zero; 89 position = new Vector2( 90 rnd.Next(Screen.Width - 64), 91 (Screen.Height - 64)); 92 velocity = new Vector2(-110f, -650f); 93 94 95 96 97 98 99 100 101 if (position.X < 0) 102 { 103 velocity = -velocity; 104 105 106 } 107 else if (position.X >= Screen.Width - 64) 108 { 109 velocity = -velocity; 110 111 112 } 113 position += velocity; 114 var min = new Vector2(radius, radius); 115 var max = new Vector2(828.0f - 100.0f, 792.0f - 100.0f); 116 position = Vector2.Clamp(position, min, max); 117 118 } 119 public override void Hit(Character character) 120 { 121 if (character is Bullet || character is Player) 122 { 123 isDead = true; 124 125 } 126 127 128 } 129 public override Character New() 130 { 131 return null; 132 } 133 } 134 135コード
なにをクリアにするんでしょうか
また、提示のコードの説明も付けましょう