Changeset 7602 for 2016/26/VeetiK
- Timestamp:
- 2016-06-30 15:01:02 (5 years ago)
- Location:
- 2016/26/VeetiK/CaveRun/CaveRun
- Files:
-
- 4 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
2016/26/VeetiK/CaveRun/CaveRun/CaveRun/CaveRun/CaveRun.cs
r7588 r7602 11 11 { 12 12 const int RUUDUN_KOKO = 30; 13 14 bool aseSaatu = false; 13 15 14 16 double nopeus = 1000; … … 29 31 Image seinänkuva = LoadImage("seinäkivi"); 30 32 SoundEffect AseAani = LoadSoundEffect("Laatikkomusa"); 31 33 Image veri = LoadImage("nimetön"); 32 34 DoubleMeter pelaajanHP; 33 35 … … 98 100 void LuoPelaaja(Vector paikka, double leveys, double korkeus) 99 101 { 100 pelaaja = new PhysicsObject(leveys / 3, korkeus / 3);102 pelaaja = new PhysicsObject(leveys / 0.5, korkeus / 0.75); 101 103 pelaaja.Position = paikka; 102 104 Add(pelaaja); … … 122 124 123 125 AddCollisionHandler(pelaaja, "zombi", delegate(PhysicsObject p, PhysicsObject kohde) { 124 pelaajanHP.Value -= 1.0; ControllerOne.Vibrate(0.5, 0.5, 0.0, 0.0, 30);126 pelaajanHP.Value -= 50.0; ControllerOne.Vibrate(0.5, 0.5, 0.0, 0.0, 0.5); 125 127 }); 126 128 129 AddCollisionHandler(pelaaja, "ovi", delegate (PhysicsObject ovi, PhysicsObject p) { 130 int avaimia = GetObjectsWithTag("avain").Count; 131 if (avaimia == 0) 132 { 133 // seuraava kenttä / voitit pelin 134 // VoititPelin(); 135 //AloitaAlusta("Voitit pelin"); 136 seuraavaKenttä(); 137 } 138 else 139 { 140 MessageDisplay.Add("Tarvitset avaimet"); 141 } 142 }); 143 144 if (aseSaatu) 145 OtaAse(); 127 146 128 147 Keyboard.Listen(Key.Left, ButtonState.Down, … … 183 202 void LuoOvi(Vector paikka, double leveys, double korkeus) 184 203 { 185 PhysicsObject LuoOvi = new PhysicsObject(leveys , 10);186 LuoOvi.Position = paikka ;204 PhysicsObject LuoOvi = new PhysicsObject(leveys * 4, 10); 205 LuoOvi.Position = paikka + new Vector(RUUDUN_KOKO * 1.5, 0); 187 206 LuoOvi.Color = Color.Red; 207 LuoOvi.Tag = "ovi"; 188 208 Add(LuoOvi); 189 209 LuoOvi.MakeStatic(); 190 191 AddCollisionHandler(LuoOvi, "pelaaja", delegate(PhysicsObject ovi, PhysicsObject p) {192 if (keys.Count == 0)193 {194 // seuraava kenttä / voitit pelin195 // VoititPelin();196 //AloitaAlusta("Voitit pelin");197 seuraavaKenttä();198 }199 else200 {201 MessageDisplay.Add("Tarvitset avaimet");202 }203 });204 210 } 205 211 … … 260 266 { 261 267 MessageDisplay.Add("Löysit aseen"); 262 263 268 AseAani.Play(); 264 pelaajanAse = new AssaultRifle(30, 10); 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 //Ammusten määrä aluksi: 283 pelaajanAse.Ammo.Value = 10; 284 // pelaajanAse.InfiniteAmmo = false; 285 286 287 288 //Mitä tapahtuu kun ammus osuu johonkin? 289 pelaajanAse.ProjectileCollision = AmmusOsui; 290 291 pelaaja.Add(pelaajanAse); 292 pelaajanAse.IsVisible = false; 269 270 aseSaatu = true; 271 OtaAse(); 293 272 294 273 a.Destroy(); … … 297 276 298 277 }); 278 } 279 280 void OtaAse() 281 { 282 pelaajanAse = new AssaultRifle(30, 10); 283 pelaajanAse.InfiniteAmmo = false; 284 pelaajanAse.ProjectileCollision = AmmusOsui; 285 pelaajanAse.Ammo.Value = 10; 286 pelaaja.Image=Pelaajakuva; 287 pelaaja.Add(pelaajanAse); 288 pelaajanAse.IsVisible = false; 289 ammuslaskuri = new IntMeter(0); 290 291 Label pisteNaytto = new Label(); 292 pisteNaytto.X = Screen.Left + 100; 293 pisteNaytto.Y = Screen.Top - 100; 294 pisteNaytto.TextColor = Color.Black; 295 pisteNaytto.Color = Color.White; 296 297 pisteNaytto.BindTo(pelaajanAse); 298 Add(pisteNaytto); 299 300 299 301 } 300 302 … … 305 307 Avain.Color = Color.Orange; 306 308 Avain.IgnoresCollisionResponse = true; 309 Avain.Tag = "avain"; 307 310 Add(Avain); 308 311 Avain.Image = AvainKuva; 312 Avain.IgnoresExplosions = true; 309 313 keys.Add(Avain); 310 314 … … 363 367 { 364 368 //ammus.Destroy(); 369 365 370 } 366 371 void AmmuAseella() … … 375 380 ammus.Image = luodinKuva; 376 381 ammus.Size = new Vector(25 / 2.0, 8 / 2.0); 377 //ammus.MaximumLifetime = TimeSpan.FromSeconds(2.0); 378 379 AddCollisionHandler(ammus, delegate(PhysicsObject a, PhysicsObject b) 382 AddCollisionHandler(ammus, delegate(PhysicsObject a, PhysicsObject kohde) 380 383 { 381 384 a.Destroy(); 382 385 383 if ( b.Tag.ToString() == "zombi")386 if (kohde.Tag.ToString() == "zombi") 384 387 { 385 b.Destroy(); 388 kohde.Destroy(); 389 Explosion rajahdys = new Explosion(25); 390 rajahdys.Position = kohde.Position; 391 rajahdys.Image = veri; 392 pelaaja.IgnoresExplosions = true; 393 Add(rajahdys); 386 394 } 387 395 }); -
2016/26/VeetiK/CaveRun/CaveRun/CaveRun/CaveRun/CaveRun.csproj.Debug.cachefile
r7588 r7602 13 13 Content\seinÀkivi.xnb 14 14 Content\pelaaja.xnb 15 Content\Map2.xnb 15 Content\map3.xnb 16 Content\map2.xnb 17 Content\Nimetön.xnb 16 18 Content\Taustamusiikki.wma -
2016/26/VeetiK/CaveRun/CaveRun/CaveRun/CaveRun/obj/x86/Debug/CaveRun.csproj.FileListAbsolute.txt
r7588 r7602 46 46 C:\MyTemp\VeetiK\CaveRun\CaveRun\CaveRun\CaveRun\bin\x86\Debug\Content\seinÀkivi.xnb 47 47 C:\MyTemp\VeetiK\CaveRun\CaveRun\CaveRun\CaveRun\bin\x86\Debug\Content\pelaaja.xnb 48 C:\MyTemp\VeetiK\CaveRun\CaveRun\CaveRun\CaveRun\bin\x86\Debug\Content\Map2.xnb 48 C:\MyTemp\VeetiK\CaveRun\CaveRun\CaveRun\CaveRun\bin\x86\Debug\Content\map3.xnb 49 C:\MyTemp\VeetiK\CaveRun\CaveRun\CaveRun\CaveRun\bin\x86\Debug\Content\map2.xnb 50 C:\MyTemp\VeetiK\CaveRun\CaveRun\CaveRun\CaveRun\bin\x86\Debug\Content\Nimetön.xnb -
2016/26/VeetiK/CaveRun/CaveRun/CaveRun/CaveRun/obj/x86/Debug/ContentPipeline-{6A862D89-0D3E-4451-B01A-26F629755B8E}.xml
r7588 r7602 9 9 <Options>None</Options> 10 10 <Output>C:\MyTemp\VeetiK\CaveRun\CaveRun\CaveRun\CaveRun\bin\x86\Debug\Content\Map1.xnb</Output> 11 <Time>2016-06- 29T14:44:42.7180689+03:00</Time>11 <Time>2016-06-30T12:27:27.2519665+03:00</Time> 12 12 </Item> 13 13 <Item> … … 127 127 <Options>None</Options> 128 128 <Output>C:\MyTemp\VeetiK\CaveRun\CaveRun\CaveRun\CaveRun\bin\x86\Debug\Content\pelaaja.xnb</Output> 129 <Time>2016-06-30T11:13:39.4840519+03:00</Time> 130 </Item> 131 <Item> 132 <Source>Map2.png</Source> 133 <Name>Map2</Name> 134 <Importer>TextureImporter</Importer> 135 <Processor>TextureProcessor</Processor> 136 <Options>None</Options> 137 <Output>C:\MyTemp\VeetiK\CaveRun\CaveRun\CaveRun\CaveRun\bin\x86\Debug\Content\Map2.xnb</Output> 138 <Time>2016-06-30T10:05:10.2914866+03:00</Time> 129 <Time>2016-06-30T14:19:29.507367+03:00</Time> 130 </Item> 131 <Item> 132 <Source>map3.png</Source> 133 <Name>map3</Name> 134 <Importer>TextureImporter</Importer> 135 <Processor>TextureProcessor</Processor> 136 <Options>None</Options> 137 <Output>C:\MyTemp\VeetiK\CaveRun\CaveRun\CaveRun\CaveRun\bin\x86\Debug\Content\map3.xnb</Output> 138 <Time>2016-06-30T14:38:15.906904+03:00</Time> 139 </Item> 140 <Item> 141 <Source>map2.png</Source> 142 <Name>map2</Name> 143 <Importer>TextureImporter</Importer> 144 <Processor>TextureProcessor</Processor> 145 <Options>None</Options> 146 <Output>C:\MyTemp\VeetiK\CaveRun\CaveRun\CaveRun\CaveRun\bin\x86\Debug\Content\map2.xnb</Output> 147 <Time>2016-06-30T14:38:15.938104+03:00</Time> 148 </Item> 149 <Item> 150 <Source>Nimetön.png</Source> 151 <Name>Nimetön</Name> 152 <Importer>TextureImporter</Importer> 153 <Processor>TextureProcessor</Processor> 154 <Options>None</Options> 155 <Output>C:\MyTemp\VeetiK\CaveRun\CaveRun\CaveRun\CaveRun\bin\x86\Debug\Content\Nimetön.xnb</Output> 156 <Time>2016-06-30T13:32:36.011338+03:00</Time> 139 157 </Item> 140 158 <BuildSuccessful>true</BuildSuccessful> -
2016/26/VeetiK/CaveRun/CaveRun/CaveRun/CaveRun/obj/x86/Debug/cachefile-{6A862D89-0D3E-4451-B01A-26F629755B8E}-targetpath.txt
r7588 r7602 14 14 Content\seinÀkivi.xnb 15 15 Content\pelaaja.xnb 16 Content\Map2.xnb 16 Content\map3.xnb 17 Content\map2.xnb 18 Content\Nimetön.xnb -
2016/26/VeetiK/CaveRun/CaveRun/CaveRun/CaveRunContent/CaveRunContent.contentproj
r7588 r7602 44 44 <Reference Include="TextFileContentExtension" /> 45 45 <Reference Include="AnimationExtension" /> 46 </ItemGroup>47 <ItemGroup>48 <Compile Include="Map1.png">49 <Name>Map1</Name>50 <Importer>TextureImporter</Importer>51 <Processor>TextureProcessor</Processor>52 </Compile>53 46 </ItemGroup> 54 47 <ItemGroup> … … 144 137 </ItemGroup> 145 138 <ItemGroup> 146 <Compile Include="Map2.png"> 147 <Name>Map2</Name> 139 <Compile Include="Map1.png"> 140 <Name>Map1</Name> 141 <Importer>TextureImporter</Importer> 142 <Processor>TextureProcessor</Processor> 143 </Compile> 144 </ItemGroup> 145 <ItemGroup> 146 <Compile Include="map2.png"> 147 <Name>map2</Name> 148 <Importer>TextureImporter</Importer> 149 <Processor>TextureProcessor</Processor> 150 </Compile> 151 </ItemGroup> 152 <ItemGroup> 153 <Compile Include="Map3.png"> 154 <Name>Map3</Name> 155 <Importer>TextureImporter</Importer> 156 <Processor>TextureProcessor</Processor> 157 </Compile> 158 </ItemGroup> 159 <ItemGroup> 160 <Compile Include="Nimetön.png"> 161 <Name>Nimetön</Name> 148 162 <Importer>TextureImporter</Importer> 149 163 <Processor>TextureProcessor</Processor>
Note: See TracChangeset
for help on using the changeset viewer.