- Timestamp:
- 2016-06-16 15:01:27 (7 years ago)
- Location:
- 2016/24/IlariJ/ShootIO
- Files:
-
- 9 added
- 3 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
2016/24/IlariJ/ShootIO/ShootIO/ShootIO/ShootIO.cs
r7343 r7393 9 9 public class ShootIO : PhysicsGame 10 10 { 11 EasyHighScore topLista = new EasyHighScore(); 11 12 Image zompi1 = LoadImage("zompi1"); 12 13 Image zompi2 = LoadImage("zompi2"); 13 14 Image zompi3 = LoadImage("zompi3"); 14 15 List<Image> vihuKuvat; 15 Image taustaKuva = LoadImage("tausta ");16 Image taustaKuva = LoadImage("tausta678"); 16 17 AssaultRifle pyssy; 17 18 private double liikkumisnopeus = 100; 18 19 private int zompiLeveys = 10; 19 20 private int zompiKorkeus = 12; 20 Image tankinKuva = LoadImage("tankki ");21 Image tankinKuva = LoadImage("tankki2"); 21 22 Tankki pelaaja; 22 23 … … 38 39 void AloitaPeli() 39 40 { 41 ClearAll(); 42 IsFullScreen = false; 40 43 LuoKentta(); 41 44 LuoPelaaja(); … … 48 51 Camera.Follow(pelaaja); 49 52 Camera.Zoom(4); 53 Camera.StayInLevel=true; 50 54 51 55 // TODO: Kirjoita ohjelmakoodisi tähän … … 55 59 56 60 } 61 62 void AloitaPeli(Window sender) 63 { 64 AloitaPeli(); 65 } 57 66 void ParhaatPisteet() 58 67 { 59 68 topLista.Show(); 60 69 } 61 70 … … 83 92 void LuoPelaaja() 84 93 { 85 pelaaja = new Tankki(1 0, 10);94 pelaaja = new Tankki(16, 10, this); 86 95 pelaaja.Position = new Vector(0,0); 87 96 AddCollisionHandler(pelaaja, "pommi", TormaaPommiin); … … 89 98 Add(pelaaja); 90 99 pelaaja.Image = tankinKuva; 100 pelaaja.Destroyed += PelaajaKuoli; 91 101 pelaaja.IgnoresExplosions = false; 92 102 pelaaja.CanRotate = false; … … 97 107 void TormaaVihuun(PhysicsObject pelaaja, PhysicsObject vihu) 98 108 { 99 elamaLaskuri.Value -= 1;109 PelaajaanOsuu(1); 100 110 vihu.Destroy(); 101 111 112 } 113 114 void PelaajaanOsuu(int maara) 115 { 116 elamaLaskuri.Value -= maara; 117 102 118 } 103 119 … … 147 163 pommi.Destroy(); 148 164 //this.pelaaja.ElamaLaskuri.Value -=2; 149 elamaLaskuri.Value -=2;165 PelaajaanOsuu(2); 150 166 rajahdys.Speed = 100.0; 151 167 rajahdys.Force = 100; … … 249 265 250 266 Timer ajastin = new Timer(); 251 ajastin.Interval = 0. 3;267 ajastin.Interval = 0.25; 252 268 ajastin.Timeout += delegate { 253 269 RandomGen.Shuffle(vihuKuvat); … … 258 274 } 259 275 260 IntMeter pisteLaskuri;276 DoubleMeter pisteLaskuri; 261 277 void LuoPistelaskuri() 262 278 { 263 pisteLaskuri = new IntMeter(0);279 pisteLaskuri = new DoubleMeter(0); 264 280 265 281 Label pisteNaytto = new Label(); … … 267 283 pisteNaytto.Y = Screen.Top - 100; 268 284 pisteNaytto.TextColor = Color.White; 269 pisteNaytto.Color = Color. Black;285 pisteNaytto.Color = Color.DarkGray; 270 286 271 287 pisteNaytto.BindTo(pisteLaskuri); 272 288 Add(pisteNaytto); 273 289 } 290 291 void PelaajaKuoli() 292 { 293 this.StopAll(); 294 this.topLista.EnterAndShow(pisteLaskuri.Value); 295 this.topLista.HighScoreWindow.Closed += AloitaPeli; 296 } 297 298 274 299 } 275 300 … … 278 303 private DoubleMeter elamaLaskuri = new DoubleMeter(10, 0, 20); 279 304 public DoubleMeter ElamaLaskuri { get { return elamaLaskuri; } } 280 281 public Tankki(double leveys, double korkeus) 305 private ShootIO io; 306 307 public Tankki(double leveys, double korkeus, ShootIO peli) 282 308 : base(leveys, korkeus) 283 309 { 310 io = peli; 284 311 elamaLaskuri.LowerLimit += delegate { this.Destroy(); }; 285 312 } 313 286 314 287 315 -
2016/24/IlariJ/ShootIO/ShootIO/ShootIO/ShootIO.csproj.Debug.cachefile
r7289 r7393 3 3 Content\pommi.xnb 4 4 Content\este.xnb 5 Content\tausta.xnb6 5 Content\zompi1.xnb 7 6 Content\zompi2.xnb 8 7 Content\zompi3.xnb 8 Content\tausta678.xnb 9 Content\tankki2.xnb -
2016/24/IlariJ/ShootIO/ShootIO/ShootIO/obj/x86/Debug/ContentPipeline-{8CBB56FE-761C-42CC-99C2-D82A0DF5B03E}.xml
r7343 r7393 39 39 </Item> 40 40 <Item> 41 <Source>tausta.png</Source>42 <Name>tausta</Name>43 <Importer>TextureImporter</Importer>44 <Processor>TextureProcessor</Processor>45 <Options>None</Options>46 <Output>C:\MyTemp\IlariJ\ShootIO\ShootIO\ShootIO\bin\x86\Debug\Content\tausta.xnb</Output>47 <Time>2016-06-15T10:12:15.4576855+03:00</Time>48 </Item>49 <Item>50 41 <Source>zompi1.png</Source> 51 42 <Name>zompi1</Name> … … 73 64 <Output>C:\MyTemp\IlariJ\ShootIO\ShootIO\ShootIO\bin\x86\Debug\Content\zompi3.xnb</Output> 74 65 <Time>2016-06-15T10:12:15.4576855+03:00</Time> 66 </Item> 67 <Item> 68 <Source>tausta678.png</Source> 69 <Name>tausta678</Name> 70 <Importer>TextureImporter</Importer> 71 <Processor>TextureProcessor</Processor> 72 <Options>None</Options> 73 <Output>C:\MyTemp\IlariJ\ShootIO\ShootIO\ShootIO\bin\x86\Debug\Content\tausta678.xnb</Output> 74 <Time>2016-06-16T13:00:19.9797685+03:00</Time> 75 </Item> 76 <Item> 77 <Source>tankki2.png</Source> 78 <Name>tankki2</Name> 79 <Importer>TextureImporter</Importer> 80 <Processor>TextureProcessor</Processor> 81 <Options>None</Options> 82 <Output>C:\MyTemp\IlariJ\ShootIO\ShootIO\ShootIO\bin\x86\Debug\Content\tankki2.xnb</Output> 83 <Time>2016-06-16T14:46:27.7857685+03:00</Time> 75 84 </Item> 76 85 <BuildSuccessful>true</BuildSuccessful> -
2016/24/IlariJ/ShootIO/ShootIO/ShootIO/obj/x86/Debug/ShootIO.csproj.FileListAbsolute.txt
r7289 r7393 11 11 C:\MyTemp\IlariJ\ShootIO\ShootIO\ShootIO\obj\x86\Debug\ShootIO.pdb 12 12 C:\MyTemp\IlariJ\ShootIO\ShootIO\ShootIO\bin\x86\Debug\Content\este.xnb 13 C:\MyTemp\IlariJ\ShootIO\ShootIO\ShootIO\bin\x86\Debug\Content\tausta.xnb14 13 C:\MyTemp\IlariJ\ShootIO\ShootIO\ShootIO\bin\x86\Debug\Content\zompi1.xnb 15 14 C:\MyTemp\IlariJ\ShootIO\ShootIO\ShootIO\bin\x86\Debug\Content\zompi2.xnb 16 15 C:\MyTemp\IlariJ\ShootIO\ShootIO\ShootIO\bin\x86\Debug\Content\zompi3.xnb 16 C:\MyTemp\IlariJ\ShootIO\ShootIO\ShootIO\bin\x86\Debug\Content\tausta678.xnb 17 C:\MyTemp\IlariJ\ShootIO\ShootIO\ShootIO\bin\x86\Debug\Content\tankki2.xnb -
2016/24/IlariJ/ShootIO/ShootIO/ShootIO/obj/x86/Debug/cachefile-{8CBB56FE-761C-42CC-99C2-D82A0DF5B03E}-targetpath.txt
r7289 r7393 3 3 Content\pommi.xnb 4 4 Content\este.xnb 5 Content\tausta.xnb6 5 Content\zompi1.xnb 7 6 Content\zompi2.xnb 8 7 Content\zompi3.xnb 8 Content\tausta678.xnb 9 Content\tankki2.xnb -
2016/24/IlariJ/ShootIO/ShootIO/ShootIOContent/ShootIOContent.contentproj
r7289 r7393 16 16 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> 17 17 <PlatformTarget>x86</PlatformTarget> 18 <UseVSHostingProcess>true</UseVSHostingProcess> 18 19 </PropertyGroup> 19 20 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> … … 74 75 </ItemGroup> 75 76 <ItemGroup> 76 <Compile Include="tausta.png">77 <Name>tausta</Name>78 <Importer>TextureImporter</Importer>79 <Processor>TextureProcessor</Processor>80 </Compile>81 </ItemGroup>82 <ItemGroup>83 77 <Compile Include="zompi1.png"> 84 78 <Name>zompi1</Name> … … 101 95 </Compile> 102 96 </ItemGroup> 97 <ItemGroup> 98 <Compile Include="tausta678.png"> 99 <Name>tausta678</Name> 100 <Importer>TextureImporter</Importer> 101 <Processor>TextureProcessor</Processor> 102 </Compile> 103 </ItemGroup> 104 <ItemGroup> 105 <Compile Include="tankki2.png"> 106 <Name>tankki2</Name> 107 <Importer>TextureImporter</Importer> 108 <Processor>TextureProcessor</Processor> 109 </Compile> 110 </ItemGroup> 103 111 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 104 112 <!-- 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.