- Timestamp:
- 2015-06-24 14:53:22 (6 years ago)
- Location:
- 2015/26/RasmusP/DungeonClasher/DungeonClasher/DungeonClasher
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/26/RasmusP/DungeonClasher/DungeonClasher/DungeonClasher/DungeonClasher.cs
r6241 r6260 9 9 class mob : PhysicsObject 10 10 { 11 private IntMeter elamaLaskuri = new IntMeter( 3, 0, 3);11 private IntMeter elamaLaskuri = new IntMeter(50,0, 50); 12 12 public IntMeter ElamaLaskuri { get { return elamaLaskuri; } } 13 13 … … 26 26 { 27 27 Image tiiliskivi = LoadImage("Tiiliskivi"); 28 Image miekkaKuva = LoadImage("Miekka"); 28 29 PlatformCharacter pelaaja; 29 30 PhysicsObject miekka; 30 31 private IntMeter elamaLaskuri = new IntMeter(10, 0, 10); 31 32 33 34 private IntMeter elamaLaskuri = new IntMeter(20, 0, 20); 32 35 33 36 int kenttaNro = 1; … … 38 41 public override void Begin() 39 42 { 40 43 SmoothTextures = false; 41 44 42 45 LuoKentta(); … … 64 67 ruudut.SetTileMethod('*', LisaaLattia); 65 68 ruudut.SetTileMethod('P', LuoPelaaja); 69 ruudut.SetTileMethod('B', LuoBossi); 70 ruudut.SetTileMethod('k', LisaaKallio); 66 71 ruudut.Execute(40, 40); 67 72 … … 85 90 Keyboard.Listen(Key.Right, ButtonState.Released, PysaytaPelaaja, null, new Vector()); 86 91 Keyboard.Listen(Key.A, ButtonState.Pressed, IskeMiekalla, null); 87 //Keyboard.Listen(Key.A, ButtonState.Released, TuhoaMiekka, null);92 88 93 89 94 } … … 121 126 { 122 127 //darkKnight 123 Hirvio = new mob( 40, 120);128 Hirvio = new mob(128, 128); 124 129 Hirvio.Elamat = 3; 125 130 Hirvio.Shape = Shape.Rectangle; … … 169 174 170 175 } 176 177 void LisaaKallio(Vector paikka, Double leveys, Double korkeus) 178 { 179 PhysicsObject kallio = PhysicsObject.CreateStaticObject(leveys, korkeus); 180 kallio.Position = paikka; 181 kallio.Color = Color.HotPink; 182 Add(kallio); 183 } 184 185 void LuoBossi(Vector paikka, Double leveys, double korkeus) 186 { 187 mob Boss = new mob(150, 150); 188 Boss.Position = paikka; 189 Boss.Elamat = 75; 190 Boss.Shape = Shape.Rectangle; 191 Boss.Color = Color.Pink; 192 Boss.Y -= 20 - Boss.Height * 0.5; 193 194 Boss.MaxAngularVelocity = 0; 195 Boss.MaxVelocity = 1000; 196 197 Boss.Tag = "Boss"; 198 Boss.Tag = "Enimy"; 199 200 201 Add(Boss); 202 203 204 205 FollowerBrain seuraajaAivo = new FollowerBrain(pelaaja); 206 seuraajaAivo.Speed = 100; 207 208 Boss.Brain = seuraajaAivo; 209 seuraajaAivo.StopWhenTargetClose = true; 210 seuraajaAivo.Active = true; 211 212 213 214 215 } 171 216 void LuoPelaaja(Vector paikka, Double leveys, Double korkeus) 172 217 { … … 192 237 193 238 AddCollisionHandler(pelaaja, "Enimy", PelaajaOsui); 239 AddCollisionHandler(pelaaja, "Boss", PelaajaOsuiBossiin); 194 240 195 241 } … … 198 244 elamaLaskuri.Value -= RandomGen.SelectOne(1, 2, 3, 4); 199 245 200 201 } 246 } 247 void PelaajaOsuiBossiin(PhysicsObject pelaaja, PhysicsObject kohdde) 248 { 249 elamaLaskuri.Value -= RandomGen.SelectOne(2, 3, 5, 7, 9); 250 251 } 252 202 253 void IskeMiekalla() 203 254 { … … 205 256 { 206 257 miekkaEsille = true; 207 miekka = new PhysicsObject(70, 20);258 miekka = new PhysicsObject(70, 64); 208 259 miekka.X = pelaaja.X + pelaaja.Width / 2; 260 miekka.Image = miekkaKuva; 209 261 miekka.IgnoresCollisionResponse = true; 210 262 miekka.IgnoresGravity = true; … … 229 281 { 230 282 mob vihu = vihollinen as mob; 231 int pudotus = RandomGen.NextInt( 5);283 int pudotus = RandomGen.NextInt(10); 232 284 vihu.ElamaLaskuri.Value -= pudotus; 233 285 } -
2015/26/RasmusP/DungeonClasher/DungeonClasher/DungeonClasher/DungeonClasher.csproj.Debug.cachefile
r6241 r6260 6 6 Content\kentta5.xnb 7 7 Content\kentta6.xnb 8 Content\Miekka.xnb 9 Content\Ritari.xnb 8 10 Content\kentta1.txt 9 11 Content\kentta2.txt -
2015/26/RasmusP/DungeonClasher/DungeonClasher/DungeonClasher/bin/x86/Debug/Content/kentta6.txt
r6241 r6260 8 8 ............................................... 9 9 ............................................... 10 .P....................B........................ 10 ............................................... 11 ............................................... 12 ............................................... 13 .P............................................B 11 14 *********************************************** -
2015/26/RasmusP/DungeonClasher/DungeonClasher/DungeonClasher/obj/x86/Debug/ContentPipeline-{9E8A5BF1-0124-4B72-B960-7241168C215B}.xml
r6241 r6260 63 63 <Options>None</Options> 64 64 <Output>C:\MyTemp\RasmusP\Hi\DungeonClasher\DungeonClasher\DungeonClasher\bin\x86\Debug\Content\kentta6.xnb</Output> 65 <Time>2015-06-24T11:32:26.4526062+03:00</Time> 65 <Time>2015-06-24T13:42:24.3553564+03:00</Time> 66 </Item> 67 <Item> 68 <Source>Miekka.png</Source> 69 <Name>Miekka</Name> 70 <Importer>TextureImporter</Importer> 71 <Processor>TextureProcessor</Processor> 72 <Options>None</Options> 73 <Output>C:\MyTemp\RasmusP\Hi\DungeonClasher\DungeonClasher\DungeonClasher\bin\x86\Debug\Content\Miekka.xnb</Output> 74 <Time>2015-06-24T12:32:11.4715564+03:00</Time> 75 </Item> 76 <Item> 77 <Source>Ritari.png</Source> 78 <Name>Ritari</Name> 79 <Importer>TextureImporter</Importer> 80 <Processor>TextureProcessor</Processor> 81 <Options>None</Options> 82 <Output>C:\MyTemp\RasmusP\Hi\DungeonClasher\DungeonClasher\DungeonClasher\bin\x86\Debug\Content\Ritari.xnb</Output> 83 <Time>2015-06-24T14:38:31.5025564+03:00</Time> 66 84 </Item> 67 85 <BuildSuccessful>true</BuildSuccessful> -
2015/26/RasmusP/DungeonClasher/DungeonClasher/DungeonClasher/obj/x86/Debug/DungeonClasher.csproj.FileListAbsolute.txt
r6241 r6260 30 30 C:\MyTemp\RasmusP\Hi\DungeonClasher\DungeonClasher\DungeonClasher\bin\x86\Debug\Content\kentta5.txt 31 31 C:\MyTemp\RasmusP\Hi\DungeonClasher\DungeonClasher\DungeonClasher\bin\x86\Debug\Content\kentta6.txt 32 C:\MyTemp\RasmusP\Hi\DungeonClasher\DungeonClasher\DungeonClasher\bin\x86\Debug\Content\Miekka.xnb 33 C:\MyTemp\RasmusP\Hi\DungeonClasher\DungeonClasher\DungeonClasher\bin\x86\Debug\Content\Ritari.xnb -
2015/26/RasmusP/DungeonClasher/DungeonClasher/DungeonClasher/obj/x86/Debug/cachefile-{9E8A5BF1-0124-4B72-B960-7241168C215B}-targetpath.txt
r6241 r6260 6 6 Content\kentta5.xnb 7 7 Content\kentta6.xnb 8 Content\Miekka.xnb 9 Content\Ritari.xnb 8 10 Content\kentta1.txt 9 11 Content\kentta2.txt
Note: See TracChangeset
for help on using the changeset viewer.