Changeset 2302
- Timestamp:
- 2011-06-29 14:46:54 (12 years ago)
- Location:
- 2011/26/HenriH
- Files:
-
- 3 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2011/26/HenriH/Alien Empire/Alien Empire/Alien Empire/Peli.cs
r2282 r2302 11 11 12 12 Image taustakuva = LoadImage("SpaceJAText_Modified"); 13 Image taustakuva2 = LoadImage("Space 1"); 13 14 List<Label> valikonKohdat; 14 15 PhysicsObject alus1; … … 18 19 Image kiihdytys1 = LoadImage("alus1_kaasuttaa"); 19 20 Image kiihdytys2 = LoadImage("alus2_kaasuttaa"); 20 21 Image plasma_ammus1 = LoadImage("plasma"); 22 Image plasma_ammus2 = LoadImage("plasma2"); 23 AssaultRifle Plasma1; 24 AssaultRifle Plasma2; 21 25 public override void Begin() 22 26 { 23 27 // TODO: Kirjoita ohjelmakoodisi tähän 24 28 Valikko(); 25 IsFullScreen = true; 26 27 29 28 30 } 29 31 … … 33 35 valikonKohdat = new List<Label>(); 34 36 37 IsFullScreen = true; 38 Level.Background.Image = taustakuva; 39 Level.Background.FitToLevel(); 40 Camera.ZoomToLevel(); 41 35 42 Label kohta1 = new Label("Aloita uusi peli"); 36 kohta1.Position = new Vector(0, 40);43 kohta1.Position = new Vector(0, -80); 37 44 valikonKohdat.Add(kohta1); 38 45 39 46 Label kohta2 = new Label("Lopeta"); 40 kohta2.Position = new Vector(0, - 40);47 kohta2.Position = new Vector(0, -160); 41 48 valikonKohdat.Add(kohta2); 42 49 … … 64 71 else 65 72 { 66 kohta.TextColor = Color.Black; 73 kohta.TextColor = Color.White; 74 kohta.Font = Font.DefaultLargeBold; 67 75 } 68 76 } … … 75 83 76 84 Camera.ZoomToLevel(); 77 Level.Background.Image = taustakuva ;85 Level.Background.Image = taustakuva2; 78 86 Level.Background.FitToLevel(); 79 87 Level.CreateBorders(); … … 90 98 alus1.Restitution = 0.2; 91 99 alus2.Restitution = 0.2; 92 100 101 Plasma1 = new AssaultRifle(20, 5); 102 Plasma2 = new AssaultRifle(20, 5); 103 alus1.Add(Plasma1); 104 alus2.Add(Plasma2); 105 93 106 Add(alus1); 94 107 Add(alus2); … … 102 115 Keyboard.Listen(Key.W, ButtonState.Released, ajaalus2, null, alus2); 103 116 Keyboard.Listen(Key.D, ButtonState.Down, kaannaalus4, "Käännä alusta Oikealle.", alus2); 117 Keyboard.Listen(Key.RightShift, ButtonState.Down, AmmuAseella, "Ammu pelaajan 1 asetta", Plasma1); 118 // Keyboard.Listen(Key.LeftShift, ButtonState.Down, AmmuAseella, "Ammu Pelaajan 2 asetta"); 119 120 121 104 122 } 105 123 void kiihdytaalus(PhysicsObject alus) … … 142 160 alus2.Push(voima); 143 161 } 162 void AmmuAseella(Weapon Plasma1) 163 { 164 PhysicsObject ammus = Plasma1.Shoot(); 165 166 167 168 if (ammus != null) 169 { 170 ammus.Size *= 3; 171 ammus.Image = plasma_ammus1; 172 Plasma1.Ammo.Value = 3000; 173 Plasma1.ProjectileCollision = AmmusOsui; 174 } 175 } 176 void AmmusOsui(PhysicsObject ammus, PhysicsObject kohde) 177 { 178 ammus.Destroy(); 179 Explosion rajahdys = new Explosion(15); 180 rajahdys.Position = ammus.Position; 181 Add(rajahdys); 182 } 144 183 145 184 } -
2011/26/HenriH/Alien Empire/Alien Empire/Alien EmpireContent/Alien EmpireContent.contentproj
r2282 r2302 188 188 </Compile> 189 189 </ItemGroup> 190 <ItemGroup> 191 <Compile Include="Space 1.png"> 192 <Name>Space 1</Name> 193 <Importer>TextureImporter</Importer> 194 <Processor>TextureProcessor</Processor> 195 </Compile> 196 </ItemGroup> 190 197 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 191 198 <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Note: See TracChangeset
for help on using the changeset viewer.