Changeset 1158
- Timestamp:
- 2010-07-07 15:02:52 (13 years ago)
- Location:
- 2010/24/arhetaka/AcesHigh/AcesHigh
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/24/arhetaka/AcesHigh/AcesHigh/Content/Content.contentproj
r1097 r1158 101 101 </Compile> 102 102 </ItemGroup> 103 <ItemGroup> 104 <Compile Include="vih_aija.png"> 105 <Name>vih_aija</Name> 106 <Importer>TextureImporter</Importer> 107 <Processor>TextureProcessor</Processor> 108 </Compile> 109 </ItemGroup> 110 <ItemGroup> 111 <Compile Include="vih_tankki.png"> 112 <Name>vih_tankki</Name> 113 <Importer>TextureImporter</Importer> 114 <Processor>TextureProcessor</Processor> 115 </Compile> 116 </ItemGroup> 103 117 </Project> -
2010/24/arhetaka/AcesHigh/AcesHigh/Peli.cs
r1097 r1158 30 30 Level.Height = Screen.Height; 31 31 Level.Width = 20000; 32 Level.CreateBorders(); 33 //Camera.ZoomToLevel(); 34 //Level.CreateBottomBorder(); 35 PhysicsObject maa = new PhysicsObject(Level.Width, 50); 32 Level.CreateBorders(); 33 Level.CreateBottomBorder(); 34 Level.Background.CreateGradient(Color.White, Color.Blue); 35 Level.CreateGround(100, 200, 50, Color.Green); 36 /* 37 PhysicsObject maa = PhysicsObject.CreateStaticObject(Level.Width, 50); 36 38 //maa.CollisionIgnorer. 37 39 maa.Color = Color.Green; 38 40 maa.Tag = "maailma"; 39 maa.Y = Level.Bottom; 40 41 Add(maa); 41 maa.Y = Level.Bottom; 42 Add(maa);*/ 43 42 44 kone1 = TeeLentokone(true); 43 45 kone1.Image = LoadImage("kone1"); … … 47 49 //Camera.FollowedObject = kone1.; 48 50 49 51 /* 50 52 kone2 = TeeLentokone(true); 51 53 kone2.Image = LoadImage("kone2"); … … 54 56 kone2.X = 100; 55 57 Add(kone2); 56 58 */ 57 59 Image[] kone1_kaantyy_kuvat = LoadImages("kone1_nurin", "kone1_nurin_2", "kone1_nurin_3", "kone1_nurin_4", "kone1"); 58 60 kone1_kaantyy_animation = new Animation(kone1_kaantyy_kuvat); … … 63 65 64 66 TeeOhjaimet(); 67 68 Camera.StayInLevel = true; 69 65 70 66 71 systeemi = new ExplosionSystem(LoadImage("rajahdys"), 100, false); … … 71 76 Add(systeemi); 72 77 78 for (int a = 0; a < 100; a++) 79 { 80 LuoVihollinen(RandomGen.NextInt(2)); 81 } 82 73 83 } 74 84 PhysicsObject TeeLentokone(bool ihminen) … … 83 93 void TeeOhjaimet() 84 94 { 95 //pelaaja 1 85 96 Keyboard.Listen(Key.Up, ButtonState.Down, LiikutaPelaajaa, null, kone1); 86 Keyboard.Listen(Key.Right, ButtonState.Down, KaannaPelaajaa, null, kone1, - 1);87 Keyboard.Listen(Key.Left, ButtonState.Down, KaannaPelaajaa, null, kone1, 1);97 Keyboard.Listen(Key.Right, ButtonState.Down, KaannaPelaajaa, null, kone1, -2); 98 Keyboard.Listen(Key.Left, ButtonState.Down, KaannaPelaajaa, null, kone1, 2); 88 99 Keyboard.Listen(Key.Right, ButtonState.Up, KaannaPelaajaa, null, kone1, 0); 89 100 Keyboard.Listen(Key.Left, ButtonState.Up, KaannaPelaajaa, null, kone1, 0); … … 91 102 Keyboard.Listen(Key.RightControl, ButtonState.Pressed, Ammu, null, kone1, 1); 92 103 104 //pelaaja 2 105 /* 93 106 Keyboard.Listen(Key.W, ButtonState.Down, LiikutaPelaajaa, null, kone2); 94 107 Keyboard.Listen(Key.D, ButtonState.Down, KaannaPelaajaa, null, kone2, -1); … … 97 110 Keyboard.Listen(Key.A, ButtonState.Up, KaannaPelaajaa, null, kone2, 0); 98 111 Keyboard.Listen(Key.S, ButtonState.Pressed, PyoritaPelaajaa, null, kone2); 99 Keyboard.Listen(Key.LeftControl, ButtonState.Pressed, Ammu, null, kone2, 1); 112 Keyboard.Listen(Key.LeftControl, ButtonState.Pressed, Ammu, null, kone2, 1);*/ 100 113 } 101 114 … … 197 210 void AmmusOsuu(PhysicsObject ammus, PhysicsObject kohde) 198 211 { 212 199 213 if (kohde.Tag != "") 200 214 { 201 215 string ampuja = ammus.Tag.ToString(); 202 216 string uhri = kohde.Tag.ToString(); 203 204 205 if (ampuja[4] != uhri[4] && kohde.Tag != "ajopiste") 206 { 207 systeemi.AddEffect(ammus.X, ammus.Y, 5); 208 ammus.Destroy(); 209 } 217 if (uhri == "viho_aija" || uhri == "viho_tankki") 218 { 219 220 kohde.MaximumLifetime = TimeSpan.FromMilliseconds(2000) + kohde.Lifetime; 221 //Remove(kohde); 222 } 223 else 224 { 225 if (ampuja[4] != uhri[4] && kohde.Tag != "ajopiste") 226 { 227 systeemi.AddEffect(ammus.X, ammus.Y, 5); 228 ammus.Destroy(); 229 } 230 } 231 } 232 if (kohde.Tag != "kone1") 233 { 234 systeemi.AddEffect(ammus.X, ammus.Y, 5); 235 ammus.Destroy(); 210 236 } 211 237 } … … 214 240 { 215 241 PaivitaKoneenNoste(kone1); 216 PaivitaKoneenNoste(kone2);242 //PaivitaKoneenNoste(kone2); 217 243 Camera.X = kone1.X; 218 244 base.Update(time); 219 245 } 246 void LuoVihollinen(int tyyppi) 247 { 248 PhysicsObject vihollinen = new PhysicsObject(30, 30); 249 vihollinen.Shape = Shapes.Triangle; 250 vihollinen.KineticFriction = 1; 251 vihollinen.Mass = 1; 252 vihollinen.X = RandomGen.NextDouble(Level.Left + 20, Level.Right -20); 253 vihollinen.Y = Level.Bottom + 200; 254 vihollinen.AngularDamping = 1; 255 if (tyyppi == 1) 256 { 257 vihollinen.Image = LoadImage("vih_aija"); 258 vihollinen.Tag = "viho_aija"; 259 } 260 else 261 { 262 vihollinen.Image = LoadImage("vih_tankki"); 263 vihollinen.Tag = "viho_tankki"; 264 } 265 266 Add(vihollinen); 267 } 268 220 269 }
Note: See TracChangeset
for help on using the changeset viewer.