- Timestamp:
- 2016-06-16 13:45:29 (7 years ago)
- Location:
- 2016/24/TaneliL
- Files:
-
- 2 added
- 4 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
2016/24/TaneliL/2016peli/2016peli/2016peliContent/_2016peliContent.contentproj
r7326 r7371 46 46 </ItemGroup> 47 47 <ItemGroup> 48 <Compile Include="Kentta2.png"> 49 <Name>Kentta2</Name> 50 <Importer>TextureImporter</Importer> 51 <Processor>TextureProcessor</Processor> 52 </Compile> 53 </ItemGroup> 54 <ItemGroup> 48 55 <Compile Include="Kentta1.png"> 49 56 <Name>Kentta1</Name> … … 53 60 </ItemGroup> 54 61 <ItemGroup> 55 <Compile Include="Kentta 2.png">56 <Name>Kentta 2</Name>62 <Compile Include="Kentta3.png"> 63 <Name>Kentta3</Name> 57 64 <Importer>TextureImporter</Importer> 58 65 <Processor>TextureProcessor</Processor> -
2016/24/TaneliL/2016peli/2016peli/_2016peli/_2016peli.cs
r7326 r7371 14 14 IntMeter pisteLaskuri = new IntMeter(0); 15 15 16 int kenttaNro = 1;16 IntMeter kenttaNro = new IntMeter(1); 17 17 18 18 PhysicsObject pelaaja; 19 19 PhysicsObject este; 20 20 PhysicsObject vihu; 21 PhysicsObject pommi; 21 22 22 23 AssaultRifle pelaajanAse; … … 27 28 Window.Height = 600; 28 29 30 pisteLaskuri.Changed += tarkistaLaskuri; 31 29 32 seuraavaKentta(); 30 33 luoPistelaskuri(); 31 luoAjastin();34 32 35 nappaimet(); 33 36 } … … 41 44 pelaaja.Y = -270; 42 45 pelaaja.CanRotate = false; 43 AddCollisionHandler(pelaaja, "vihu",pelaajaaOsui);46 AddCollisionHandler(pelaaja, pelaajaaOsui); 44 47 Add(pelaaja); 45 48 … … 59 62 ruudut.SetTileMethod(Color.Black, luoEste); 60 63 ruudut.SetTileMethod(Color.Red, luoVihu); 64 ruudut.SetTileMethod(Color.Harlequin, luoPommi); 61 65 ruudut.Execute(30, 30); 62 66 … … 70 74 if (kenttaNro == 1) luoMaailma("Kentta1"); 71 75 else if (kenttaNro == 2) luoMaailma("Kentta2"); 76 else if (kenttaNro == 3) luoMaailma("Kentta3"); 72 77 luoPelaaja(); 78 //luoAjastin(); 79 luoPistelaskuri(); 73 80 nappaimet(); 74 luoPistelaskuri();75 81 } 76 82 … … 86 92 } 87 93 88 void tarkistaLaskuri() 89 { 90 if (pisteLaskuri > 900) 91 { 92 kenttaNro++; 94 void lisaaPisteita() 95 { 96 pisteLaskuri.Value += 200; 97 } 98 99 void tarkistaLaskuri(int a, int b) 100 { 101 if (pisteLaskuri == 900) 102 { 103 kenttaNro.Value = 2; 93 104 seuraavaKentta(); 94 105 } 95 } 96 97 void luoAjastin() 98 { 99 Timer ajasti = new Timer(); 100 ajasti.Interval = 1; 101 ajasti.Timeout += tarkistaLaskuri; 102 ajasti.Start(); 103 } 106 107 else if (pisteLaskuri == 1300) 108 { 109 kenttaNro.Value = 3; 110 seuraavaKentta(); 111 } 112 } 113 114 //void luoAjastin() 115 //{ 116 // Timer ajasti = new Timer(); 117 // ajasti.Interval = 1; 118 // //ajasti.Timeout += tarkistaLaskuri; 119 // ajasti.Start(); 120 //} 104 121 105 122 void nappaimet() … … 111 128 Keyboard.Listen(Key.A, ButtonState.Down, liikkuminen, null, new Vector(-100, 0)); 112 129 Keyboard.Listen(Key.D, ButtonState.Down, liikkuminen, null, new Vector(100, 0)); 130 Keyboard.Listen(Key.Space, ButtonState.Pressed, lisaaPisteita, null); 113 131 Mouse.Listen(MouseButton.Left, ButtonState.Down, ammu, "", pelaajanAse); 114 132 Mouse.ListenMovement(0.1, tahtaa, ""); … … 154 172 } 155 173 174 void luoPommi(Vector paikka, double leveys, double korkeus) 175 { 176 pommi = new PhysicsObject(30, 30); 177 pommi.Position = paikka; 178 pommi.Color = Color.Green; 179 //pommi.IsVisible = false; 180 pommi.Tag = "pommi"; 181 Add(pommi); 182 } 183 156 184 void ammusOsui(PhysicsObject ammus, PhysicsObject kohde) 157 185 { … … 166 194 void pelaajaaOsui(PhysicsObject pelaaja, PhysicsObject kohde) 167 195 { 168 pelaaja.Destroy(); 169 kohde.Destroy(); 170 pisteLaskuri.Value -= 500; 196 if (kohde.Tag == "vihu") 197 { 198 kohde.Destroy(); 199 pelaaja.Destroy(); 200 pisteLaskuri.Value -= 500; 201 } 202 203 else if (kohde.Tag == "pommi") 204 { 205 pelaaja.Destroy(); 206 kohde.Destroy(); 207 Explosion rajahdys = new Explosion(60); 208 rajahdys.Position = kohde.Position; 209 Add(rajahdys); 210 } 171 211 } 172 212 -
2016/24/TaneliL/2016peli/2016peli/_2016peli/_2016peli.csproj.Debug.cachefile
r7326 r7371 1 1 Content\Kentta1.xnb 2 2 Content\Kentta2.xnb 3 Content\Kentta3.xnb -
2016/24/TaneliL/2016peli/2016peli/_2016peli/obj/x86/Debug/ContentPipeline-{0D4F2033-685B-4930-A22D-603ABE9F6C9A}.xml
r7326 r7371 9 9 <Options>None</Options> 10 10 <Output>C:\MyTemp\TaneliL\2016peli\2016peli\_2016peli\bin\x86\Debug\Content\Kentta1.xnb</Output> 11 <Time>2016-06-1 4T13:03:07.2117497+03:00</Time>11 <Time>2016-06-15T16:53:13.4414881+03:00</Time> 12 12 </Item> 13 13 <Item> … … 19 19 <Output>C:\MyTemp\TaneliL\2016peli\2016peli\_2016peli\bin\x86\Debug\Content\Kentta2.xnb</Output> 20 20 <Time>2016-06-15T11:15:02.6048584+03:00</Time> 21 </Item> 22 <Item> 23 <Source>Kentta3.png</Source> 24 <Name>Kentta3</Name> 25 <Importer>TextureImporter</Importer> 26 <Processor>TextureProcessor</Processor> 27 <Options>None</Options> 28 <Output>C:\MyTemp\TaneliL\2016peli\2016peli\_2016peli\bin\x86\Debug\Content\Kentta3.xnb</Output> 29 <Time>2016-06-16T09:46:26.1023235+03:00</Time> 21 30 </Item> 22 31 <BuildSuccessful>true</BuildSuccessful> -
2016/24/TaneliL/2016peli/2016peli/_2016peli/obj/x86/Debug/_2016peli.csproj.FileListAbsolute.txt
r7326 r7371 9 9 C:\MyTemp\TaneliL\2016peli\2016peli\_2016peli\bin\x86\Debug\Content\Kentta1.xnb 10 10 C:\MyTemp\TaneliL\2016peli\2016peli\_2016peli\bin\x86\Debug\Content\Kentta2.xnb 11 C:\MyTemp\TaneliL\2016peli\2016peli\_2016peli\bin\x86\Debug\Content\Kentta3.xnb -
2016/24/TaneliL/2016peli/2016peli/_2016peli/obj/x86/Debug/cachefile-{0D4F2033-685B-4930-A22D-603ABE9F6C9A}-targetpath.txt
r7326 r7371 1 1 Content\Kentta1.xnb 2 2 Content\Kentta2.xnb 3 Content\Kentta3.xnb
Note: See TracChangeset
for help on using the changeset viewer.