- Timestamp:
- 2017-08-02 14:52:03 (5 years ago)
- Location:
- 2017/31/RoniM/New folder
- Files:
-
- 11 added
- 3 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
2017/31/RoniM/New folder/New folder/Bossfloors/Bossfloors/Bossfloors/Bossfloors.cs
r9309 r9351 39 39 40 40 const int RUUDUN_KOKO = 30; 41 41 int kenttaNro = 1; 42 42 public int Elamat { get; set; } 43 43 public bool OnHidas { get; set; } … … 50 50 51 51 52 53 52 public override void Begin() 54 53 { 55 LuoKentta(); 56 54 //LuoKentta("kentta"); 55 56 LataaKentta(); 57 58 } 59 60 class Rakennus : PhysicsObject 61 { 62 private IntMeter elamaLaskuri = new IntMeter(50, 0, 50); 63 public IntMeter ElamaLaskuri { get { return elamaLaskuri; } } 64 65 public Rakennus(double leveys, double korkeus) 66 : base(leveys, korkeus) 67 { 68 elamaLaskuri.LowerLimit += delegate { this.Destroy(); }; 69 } 70 71 } 72 void LataaKentta() 73 { 74 ClearAll(); 75 76 if (kenttaNro == 1) LuoKentta("kentta"); 77 else if (kenttaNro == 2) LuoKentta("dungeon 1"); 78 else if (kenttaNro == 3) LuoKentta("boss 1"); 79 else if (kenttaNro > 3) 80 { 81 Exit(); 82 return; 83 } 84 85 //LuoPistelaskuri(); 86 // LuoPistelaskuri2(); 87 //luoelamalaskuri2(); 88 57 89 Keyboard.Listen(Key.Left, ButtonState.Down, LiikutaPelaajaa, null, pelaaja1, new Vector(-1000, 0)); 58 90 Keyboard.Listen(Key.Right, ButtonState.Down, LiikutaPelaajaa, null, pelaaja1, new Vector(1000, 0)); … … 69 101 ControllerOne.Listen(Button.DPadDown, ButtonState.Down, LiikutaPelaajaa, null, pelaaja1, new Vector(0, -1000)); 70 102 ControllerOne.Listen(Button.A, ButtonState.Down, AmmuAseella, null, pelaaja1); 71 72 73 }74 class Rakennus : PhysicsObject75 {76 private IntMeter elamaLaskuri = new IntMeter(50, 0, 50);77 public IntMeter ElamaLaskuri { get { return elamaLaskuri; } }78 79 public Rakennus(double leveys, double korkeus)80 : base(leveys, korkeus)81 {82 elamaLaskuri.LowerLimit += delegate { this.Destroy(); };83 }84 103 85 104 } … … 100 119 pelaaja1.CollisionIgnoreGroup = 1; 101 120 AddCollisionHandler(pelaaja1, "vihollinen", pelaajaosui); 121 AddCollisionHandler(pelaaja1, "rakennus", TormasiMaaliin); 102 122 103 // luoelamalaskuri2(); 123 124 // 104 125 105 126 Mouse.ListenMovement(0.1, Tahtaa, "Tähtää aseella"); 106 // LuoPistelaskuri();107 // LuoPistelaskuri2();127 // 128 // 108 129 109 130 pelaaja1.Ase = new AssaultRifle(0, 0); … … 115 136 116 137 Timer aikaLaskuri = new Timer(); 117 aikaLaskuri.Interval = 1.0;138 aikaLaskuri.Interval = 0.3333; 118 139 aikaLaskuri.Timeout += delegate 119 140 { … … 123 144 124 145 pelaaja1.Ase.Power.DefaultValue = 80; 125 pelaaja1.Ase.FireRate = 5 ;146 pelaaja1.Ase.FireRate = 50; 126 147 pelaaja1.Add(pelaaja1.Ase); 127 148 … … 131 152 132 153 } 154 155 void TormasiMaaliin(PhysicsObject pelaaja, PhysicsObject dungeon) 156 { 157 //Kasvatetaan kenttänumeroa yhdellä ja siirrytään seuraavaan kenttään: 158 kenttaNro++; 159 LataaKentta(); 160 } 161 162 133 163 void Tahtaa(AnalogState hiirenLiike) 134 164 { … … 137 167 Mouse.IsCursorVisible = true; 138 168 } 169 170 171 139 172 void AmmuAseella(Pelaaja pelaaja) 140 173 { … … 150 183 ammus.Color = (Color.Gold); 151 184 152 ammus.MaximumLifetime = TimeSpan.FromSeconds( 30.0);185 ammus.MaximumLifetime = TimeSpan.FromSeconds(0.1); 153 186 } 154 187 } … … 209 242 210 243 211 void LuoKentta( )212 { 213 ColorTileMap ruudut = ColorTileMap.FromLevelAsset( "map1 valmis melkein");244 void LuoKentta(string nimi) 245 { 246 ColorTileMap ruudut = ColorTileMap.FromLevelAsset(nimi); 214 247 ruudut.SetTileMethod(Color.FromHexCode("FF006E"), LuoPelaaja1); 215 248 //ruudut.SetTileMethod(Color.FromHexCode("0019FF"), LuoPelaaja2); … … 219 252 ruudut.SetTileMethod(Color.FromHexCode("000000"), LuoSeina); 220 253 ruudut.SetTileMethod(Color.FromHexCode("FA00FF"), LuoSyotava); 254 221 255 ruudut.SetTileMethod(Color.FromHexCode("AD77FF"), luomonster); 222 ruudut.SetTileMethod(Color.FromHexCode(" 3AFFC0"), luozombi);256 ruudut.SetTileMethod(Color.FromHexCode("B60000"), luozombi); 223 257 ruudut.SetTileMethod(Color.FromHexCode("FF6A00"), dungeon); 224 258 ruudut.SetTileMethod(Color.FromHexCode("FFFFFF"), safezone); … … 226 260 227 261 ruudut.Execute(30, 30); 228 Camera.ZoomFactor = 2.45;262 Camera.ZoomFactor = 0.45; 229 263 Camera.Follow(pelaaja1); 230 264 } 265 266 //void SeuraavaKentta(PhysicsObject pelaaja, PhysicsObject maali) 267 //{ 268 // kenttaNro++; 269 // LataaKentta(); 270 //} 271 272 231 273 void LuoPelaaja1(Vector paikka, double leveys, double korkeus) 232 274 { … … 329 371 monster.Image = vihu5; 330 372 monster.Color = Color.Red; 331 373 LabyrinthWandererBrain labyrinttiAivot = new LabyrinthWandererBrain(RUUDUN_KOKO); 332 374 labyrinttiAivot.Speed = 150.0; 333 375 monster.LifetimeLeft = TimeSpan.FromSeconds(20.0); … … 354 396 { 355 397 Timer aikaLaskuri = new Timer(); 356 aikaLaskuri.Interval = 40;357 aikaLaskuri.Timeout += delegate398 aikaLaskuri.Interval = (10); 399 aikaLaskuri.Timeout += delegate 358 400 { 359 401 PhysicsObject zombi = new PhysicsObject(17, 17); … … 362 404 zombi.Tag = "zombi"; 363 405 364 365 366 LabyrinthWandererBrain labyrinttiAivot = new LabyrinthWandererBrain(RUUDUN_KOKO); 367 labyrinttiAivot.Speed = 70.0; 406 FollowerBrain seuraajanAivot = new FollowerBrain(pelaaja1); 407 RandomMoverBrain satunnaisAivot = new RandomMoverBrain(200); 408 seuraajanAivot.Speed = 30; // Millä nopeudella kohdetta seurataan 409 seuraajanAivot.DistanceFar = 600; // Etäisyys jolla aletaan seurata kohdetta 410 seuraajanAivot.DistanceClose = 200; // Etäisyys jolloin ollaan lähellä kohdetta 411 seuraajanAivot.StopWhenTargetClose = false; // Pysähdytään kun ollaan lähellä kohdetta 412 seuraajanAivot.FarBrain = satunnaisAivot; // Käytetään satunnaisaivoja kun ollaan kaukana 413 414 ; 415 satunnaisAivot.ChangeMovementSeconds = 5; 368 416 zombi.Image = zzombi; 369 zombi.LifetimeLeft = TimeSpan.FromSeconds( 80.0);417 zombi.LifetimeLeft = TimeSpan.FromSeconds(60.0); 370 418 AddCollisionHandler(zombi, "pelaaja", pelaajaosui2); 371 labyrinttiAivot.LabyrinthWallTag = "seina"; 372 zombi.Brain = labyrinttiAivot; 373 Add(zombi); 419 satunnaisAivot.WanderRadius = 200; 420 //seuraajanAivot.TargetClose += mitaTapahtuuKunOllaanLahella; 421 zombi.Brain = satunnaisAivot; 422 zombi.Brain = seuraajanAivot; 423 Add(zombi, +1); 374 424 }; 375 425 aikaLaskuri.Start(); 376 426 377 427 378 } 379 428 429 } 430 // void mitaTapahtuuKunOllaanLahella() 431 // { 432 // zombi.Color = Color.Red; 433 // } 380 434 381 435 void dungeon(Vector paikka, double leveys, double korkeus) … … 385 439 rakennus.MakeStatic(); 386 440 rakennus.Color = Color.Brown; 387 rakennus.CollisionIgnoreGroup = 1;441 rakennus.CollisionIgnoreGroup = 2; 388 442 rakennus.Tag = "rakennus"; 389 443 Add(rakennus); -
2017/31/RoniM/New folder/New folder/Bossfloors/Bossfloors/Bossfloors/Bossfloors.csproj.Debug.cachefile
r9309 r9351 1 Content\map1 valmis melkein.xnb2 1 Content\kpelaaja1.xnb 2 Content\kentta.xnb 3 Content\dungeon 1.xnb 4 Content\boss 1.xnb 5 Content\zzombi.xnb -
2017/31/RoniM/New folder/New folder/Bossfloors/Bossfloors/Bossfloors/obj/x86/Debug/Bossfloors.csproj.FileListAbsolute.txt
r9309 r9351 6 6 C:\MyTemp\RoniM\New folder\New folder\Bossfloors\Bossfloors\Bossfloors\obj\x86\Debug\Bossfloors.exe 7 7 C:\MyTemp\RoniM\New folder\New folder\Bossfloors\Bossfloors\Bossfloors\obj\x86\Debug\Bossfloors.pdb 8 C:\MyTemp\RoniM\New folder\New folder\Bossfloors\Bossfloors\Bossfloors\bin\x86\Debug\Content\map1 valmis melkein.xnb9 8 C:\MyTemp\RoniM\New folder\New folder\Bossfloors\Bossfloors\Bossfloors\bin\x86\Debug\Content\kpelaaja1.xnb 10 9 C:\MyTemp\RoniM\New folder\New folder\Bossfloors\Bossfloors\Bossfloors\obj\x86\Debug\Bossfloors.csprojResolveAssemblyReference.cache 10 C:\MyTemp\RoniM\New folder\New folder\Bossfloors\Bossfloors\Bossfloors\bin\x86\Debug\Content\kentta.xnb 11 C:\MyTemp\RoniM\New folder\New folder\Bossfloors\Bossfloors\Bossfloors\bin\x86\Debug\Content\dungeon 1.xnb 12 C:\MyTemp\RoniM\New folder\New folder\Bossfloors\Bossfloors\Bossfloors\bin\x86\Debug\Content\boss 1.xnb 13 C:\MyTemp\RoniM\New folder\New folder\Bossfloors\Bossfloors\Bossfloors\bin\x86\Debug\Content\zzombi.xnb -
2017/31/RoniM/New folder/New folder/Bossfloors/Bossfloors/Bossfloors/obj/x86/Debug/ContentPipeline-{0253B4D2-116D-48F6-AF9A-D0C2B420673F}.xml
r9309 r9351 2 2 <XnaContent xmlns:Pipeline="Microsoft.Xna.Framework.Content.Pipeline"> 3 3 <Asset Type="Pipeline:BuildItemCollection"> 4 <Item>5 <Source>map1 valmis melkein.png</Source>6 <Name>map1 valmis melkein</Name>7 <Importer>TextureImporter</Importer>8 <Processor>TextureProcessor</Processor>9 <Options>None</Options>10 <Output>C:\MyTemp\RoniM\New folder\New folder\Bossfloors\Bossfloors\Bossfloors\bin\x86\Debug\Content\map1 valmis melkein.xnb</Output>11 <Time>2017-08-01T11:02:49.6208871+03:00</Time>12 </Item>13 4 <Item> 14 5 <Source>kpelaaja1.png</Source> … … 19 10 <Output>C:\MyTemp\RoniM\New folder\New folder\Bossfloors\Bossfloors\Bossfloors\bin\x86\Debug\Content\kpelaaja1.xnb</Output> 20 11 <Time>2017-08-01T11:09:50.4133735+03:00</Time> 12 </Item> 13 <Item> 14 <Source>kentta.png</Source> 15 <Name>kentta</Name> 16 <Importer>TextureImporter</Importer> 17 <Processor>TextureProcessor</Processor> 18 <Options>None</Options> 19 <Output>C:\MyTemp\RoniM\New folder\New folder\Bossfloors\Bossfloors\Bossfloors\bin\x86\Debug\Content\kentta.xnb</Output> 20 <Time>2017-08-02T10:31:40.879871+03:00</Time> 21 </Item> 22 <Item> 23 <Source>dungeon 1.png</Source> 24 <Name>dungeon 1</Name> 25 <Importer>TextureImporter</Importer> 26 <Processor>TextureProcessor</Processor> 27 <Options>None</Options> 28 <Output>C:\MyTemp\RoniM\New folder\New folder\Bossfloors\Bossfloors\Bossfloors\bin\x86\Debug\Content\dungeon 1.xnb</Output> 29 <Time>2017-08-02T13:47:08.1604193+03:00</Time> 30 </Item> 31 <Item> 32 <Source>boss 1.png</Source> 33 <Name>boss 1</Name> 34 <Importer>TextureImporter</Importer> 35 <Processor>TextureProcessor</Processor> 36 <Options>None</Options> 37 <Output>C:\MyTemp\RoniM\New folder\New folder\Bossfloors\Bossfloors\Bossfloors\bin\x86\Debug\Content\boss 1.xnb</Output> 38 <Time>2017-08-02T11:19:19.0443749+03:00</Time> 39 </Item> 40 <Item> 41 <Source>zzombi.png</Source> 42 <Name>zzombi</Name> 43 <Importer>TextureImporter</Importer> 44 <Processor>TextureProcessor</Processor> 45 <Options>None</Options> 46 <Output>C:\MyTemp\RoniM\New folder\New folder\Bossfloors\Bossfloors\Bossfloors\bin\x86\Debug\Content\zzombi.xnb</Output> 47 <Time>2017-07-31T10:32:34.1899278+03:00</Time> 21 48 </Item> 22 49 <BuildSuccessful>true</BuildSuccessful> -
2017/31/RoniM/New folder/New folder/Bossfloors/Bossfloors/Bossfloors/obj/x86/Debug/cachefile-{0253B4D2-116D-48F6-AF9A-D0C2B420673F}-targetpath.txt
r9309 r9351 1 Content\map1 valmis melkein.xnb2 1 Content\kpelaaja1.xnb 2 Content\kentta.xnb 3 Content\dungeon 1.xnb 4 Content\boss 1.xnb 5 Content\zzombi.xnb -
2017/31/RoniM/New folder/New folder/Bossfloors/Bossfloors/BossfloorsContent/BossfloorsContent.contentproj
r9309 r9351 46 46 </ItemGroup> 47 47 <ItemGroup> 48 <Compile Include=" map1 valmis melkein.png">49 <Name> map1 valmis melkein</Name>48 <Compile Include="kpelaaja1.png"> 49 <Name>kpelaaja1</Name> 50 50 <Importer>TextureImporter</Importer> 51 51 <Processor>TextureProcessor</Processor> … … 53 53 </ItemGroup> 54 54 <ItemGroup> 55 <Compile Include="kpelaaja1.png"> 56 <Name>kpelaaja1</Name> 55 <Compile Include="kentta.png"> 56 <Name>kentta</Name> 57 <Importer>TextureImporter</Importer> 58 <Processor>TextureProcessor</Processor> 59 </Compile> 60 </ItemGroup> 61 <ItemGroup> 62 <Compile Include="dungeon 1.png"> 63 <Name>dungeon 1</Name> 64 <Importer>TextureImporter</Importer> 65 <Processor>TextureProcessor</Processor> 66 </Compile> 67 </ItemGroup> 68 <ItemGroup> 69 <Compile Include="boss 1.png"> 70 <Name>boss 1</Name> 71 <Importer>TextureImporter</Importer> 72 <Processor>TextureProcessor</Processor> 73 </Compile> 74 </ItemGroup> 75 <ItemGroup> 76 <Compile Include="zzombi.png"> 77 <Name>zzombi</Name> 57 78 <Importer>TextureImporter</Importer> 58 79 <Processor>TextureProcessor</Processor> -
2017/31/RoniM/New folder/New folder/LegendOfDesertBase/LegendOfDesertBase/LegendOfDesertBase/LegendOfDesertBase.cs
r9294 r9351 135 135 //pelaaja1 on PlatformCharacter-tyyppinen 136 136 pelaaja1.Weapon = new AssaultRifle(30, 10); 137 pelaaja1.Weapon.FireRate = 0.5;137 pelaaja1.Weapon.FireRate = 30.5; 138 138 pelaaja1.Weapon.AmmoIgnoresGravity = false; 139 139 //Ammusten määrä aluksi: 140 pelaaja1.Weapon.Ammo.Value = 200 ;141 pelaaja1.Weapon.Ammo.MaxValue = 300 ;140 pelaaja1.Weapon.Ammo.Value = 2000; 141 pelaaja1.Weapon.Ammo.MaxValue = 30000; 142 142 143 143 //Mitä tapahtuu kun ammus osuu johonkin?
Note: See TracChangeset
for help on using the changeset viewer.