Changeset 6014
- Timestamp:
- 2015-06-11 11:35:21 (8 years ago)
- Location:
- 2014/koodauskerho/38/OttoR/Last Light
- Files:
-
- 20 added
- 8 deleted
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
2014/koodauskerho/38/OttoR/Last Light/Last Light/Last Light/Last Light.csproj.Debug.cachefile
r6002 r6014 23 23 Content\healthkit.xnb 24 24 Content\LootaKuva.xnb 25 Content\sydan.xnb -
2014/koodauskerho/38/OttoR/Last Light/Last Light/Last Light/Last_Light.cs
r6002 r6014 17 17 18 18 PlatformCharacter pelaaja1; 19 GameObject TAHTAIN; 20 19 21 Direction edellinenKavelysuunta = Direction.Right; 20 22 IntMeter elamat = new IntMeter(100, 0, 100); 23 IntMeter tappomittari = new IntMeter(0); 21 24 22 25 Image puukotuskuva = LoadImage("puukotus"); … … 39 42 Image luotikuva = LoadImage("ammus"); 40 43 Image TAHTAINkuva = LoadImage("TAHTAIN"); 44 Image sydankuva = LoadImage("sydan"); 45 Image[] sydanKuvat = LoadImages("sydan", "sydan1", "sydan2"); 46 Image tappokuva = LoadImage("tapot"); 41 47 PhysicsObject puukko; 42 48 AssaultRifle pelaajan1Ase; … … 47 53 public override void Begin() 48 54 { 49 Gravity = new Vector(0, - 450);55 Gravity = new Vector(0, -1400); 50 56 SmoothTextures = false; 51 57 IsMouseVisible = true; … … 54 60 LisaaNappaimet(); 55 61 LisaaElamaLaskuri(); 62 LisaaTappoLaskuri(); 56 63 57 64 58 65 LisaaHiiriKuva(); 59 IsMouseVisible = true;66 IsMouseVisible = false; 60 67 Camera.Follow(pelaaja1); 61 Camera.ZoomFactor = 1. 5;68 Camera.ZoomFactor = 1.2; 62 69 Camera.StayInLevel = true; 63 70 … … 100 107 101 108 109 102 110 Level.Background.CreateGradient(Color.White, Color.SkyBlue); 103 111 } … … 105 113 void LisaaHiiriKuva() 106 114 { 107 GameObject TAHTAIN = new GameObject(10, 10);115 TAHTAIN = new GameObject(20, 20); 108 116 TAHTAIN.Image = TAHTAINkuva; 109 Add(TAHTAIN); 110 111 Mouse.ListenMovement(0.2, LiikutaTAHTAIN, null); 112 } 113 void LiikutaTAHTAIN 117 Add(TAHTAIN, 1); 118 119 Mouse.ListenMovement(0.0, LiikutaTAHTAIN, null); 120 } 121 122 void LiikutaTAHTAIN(AnalogState Hiiri) 123 { 124 TAHTAIN.Position += Hiiri.MouseMovement; 125 126 //double raja = Camera.ScreenToWorld(new Vector(Window.ClientBounds.Width, Window.ClientBounds.Height)).Y; 127 //Vector suunta = TAHTAIN.Position - pelaaja1.Position; 128 //if (suunta.Magnitude > raja) 129 //{ 130 // TAHTAIN.Position = pelaaja1.Position + suunta.Normalize() * raja; 131 //} 132 133 /* 134 Vector min = Camera.ScreenToWorld(new Vector(Screen.Left, Screen.Bottom)); 135 Vector max = Camera.ScreenToWorld(new Vector(Screen.Right, Screen.Top)); 136 137 if (TAHTAIN.X < min.X) TAHTAIN.X = min.X; 138 if (TAHTAIN.Y < min.Y) TAHTAIN.X = min.Y; 139 if (TAHTAIN.X > max.X) TAHTAIN.X = max.X; 140 if (TAHTAIN.X > max.Y) TAHTAIN.X = max.Y; 141 */ 142 } 114 143 115 144 void LisaaTaso(Vector paikka, double leveys, double korkeus) … … 124 153 void LisaaLoota(Vector paikka, double leveys, double korkeus) 125 154 { 126 PhysicsObject loota = new PhysicsObject(RUUDUN_KOKO, RUUDUN_KOKO);155 Loota loota = new Loota (leveys, korkeus); 127 156 loota.Position = paikka; 128 loota.Mass = 10.0;157 loota.Mass = 20.0; 129 158 loota.Image = LootaKuva; 130 159 loota.Tag = "loota"; … … 184 213 pisteNaytto.TextColor = Color.Black; 185 214 pisteNaytto.Color = Color.White; 186 187 pisteNaytto.BindTo(elamat); 188 Add(pisteNaytto); 189 215 216 pisteNaytto.BindTo(elamat); 217 Add(pisteNaytto); 218 Label kuva = new Label(); 219 kuva.Image = sydankuva; 220 kuva.X = Screen.Left + 60; 221 kuva.Y = Screen.Bottom + 100; 222 kuva.Width = sydankuva.Width *2; 223 kuva.Height = sydankuva.Height *2; 224 Add(kuva); 225 } 226 227 void LisaaTappoLaskuri() 228 { 229 Label tapot = new Label(); 230 tapot.BindTo(tappomittari); 231 tapot.X = Screen.Left + 200; 232 tapot.Y = Screen.Bottom + 100; 233 Add(tapot); 190 234 } 191 235 … … 205 249 zombi.CanRotate = false; 206 250 zombi.Tag = "zombi"; 207 208 209 RandomMoverBrain satunnaisAivot = new RandomMoverBrain(100);251 252 253 PlatformWandererBrain satunnaisAivot = new PlatformWandererBrain(); 210 254 FollowerBrain seurausaivot = new FollowerBrain(pelaaja1); 211 212 213 255 satunnaisAivot.TriesToJump = true; 256 257 214 258 //Ominaisuuksien muokkaaminen 215 satunnaisAivot.ChangeMovementSeconds = 5; 259 //satunnaisAivot.ChangeMovementSeconds = 5; 260 216 261 217 262 //Aivot käyttöön oliolle 218 263 zombi.Brain = satunnaisAivot; 264 219 265 220 266 … … 227 273 { 228 274 ajastin.Stop(); 275 tappomittari.Value++; 229 276 return; 230 277 } … … 328 375 if (pelaajan1Ase != null) 329 376 { 330 pelaajan1Ase.AbsoluteAngle = ( Mouse.PositionOnWorld- pelaaja1.Position).Angle;377 pelaajan1Ase.AbsoluteAngle = (TAHTAIN.Position - pelaaja1.Position).Angle; 331 378 } 332 379 } … … 360 407 AddCollisionHandler(puukko, "zombi", PuukkoOsui); 361 408 AddCollisionHandler(puukko, "seina", SeinaanOsui); 409 AddCollisionHandler(puukko, "loota", LootaanOsui); 362 410 if (hahmo.FacingDirection == Direction.Left) puukko.MirrorImage(); 363 411 Add(puukko); … … 399 447 seina.ElamaLaskuri.Value -= 4; 400 448 } 449 450 void LootaanOsui(PhysicsObject puukko, PhysicsObject kohdeloota) 451 { 452 Loota loota = (Loota)kohdeloota; 453 loota.ElamaLaskuri.Value -= 4; 454 455 } 401 456 void AvaaLaatikko() 402 457 { … … 448 503 zombi.ElamaLaskuri.Value -= 5.0; 449 504 } 450 451 } 505 506 507 if (kohde is Loota) 508 { 509 Loota loota = (Loota)kohde; 510 loota.ElamaLaskuri.Value -= 5.0; 511 512 } 513 514 452 515 } 453 516 … … 477 540 } 478 541 } 479 480 481 542 class Loota : PhysicsObject 543 { 544 private DoubleMeter elamaLaskuri = new DoubleMeter(20, 0, 20); 545 public DoubleMeter ElamaLaskuri { get { return elamaLaskuri; } } 546 547 public Loota(double leveys, double korkeus) 548 : base(leveys, korkeus) 549 { 550 elamaLaskuri.LowerLimit += delegate { this.Destroy(); }; 551 } 552 553 } 554 555 } 556 557 558 -
2014/koodauskerho/38/OttoR/Last Light/Last Light/Last Light/obj/x86/Debug/ContentPipeline-{1C34B668-D9F3-4304-A5FC-ECD367C2BC30}.xml
r6002 r6014 63 63 <Options>None</Options> 64 64 <Output>C:\MyTemp\OttoR\Last Light\Last Light\Last Light\bin\x86\Debug\Content\zombi.xnb</Output> 65 <Time>2015-06-1 0T12:28:34.786543+03:00</Time>65 <Time>2015-06-11T10:59:42.5666403+03:00</Time> 66 66 </Item> 67 67 <Item> … … 72 72 <Options>None</Options> 73 73 <Output>C:\MyTemp\OttoR\Last Light\Last Light\Last Light\bin\x86\Debug\Content\zombi1.xnb</Output> 74 <Time>2015-06-1 0T12:29:10.8780567+03:00</Time>74 <Time>2015-06-11T11:00:14.6846403+03:00</Time> 75 75 </Item> 76 76 <Item> … … 81 81 <Options>None</Options> 82 82 <Output>C:\MyTemp\OttoR\Last Light\Last Light\Last Light\bin\x86\Debug\Content\zombi2.xnb</Output> 83 <Time>2015-06-1 0T12:29:36.470733+03:00</Time>83 <Time>2015-06-11T11:00:26.6782403+03:00</Time> 84 84 </Item> 85 85 <Item> … … 162 162 <Options>None</Options> 163 163 <Output>C:\MyTemp\OttoR\Last Light\Last Light\Last Light\bin\x86\Debug\Content\kentta1.xnb</Output> 164 <Time>2015-06-1 0T13:08:29.3388302+03:00</Time>164 <Time>2015-06-11T11:22:09.9158403+03:00</Time> 165 165 </Item> 166 166 <Item> … … 189 189 <Options>None</Options> 190 190 <Output>C:\MyTemp\OttoR\Last Light\Last Light\Last Light\bin\x86\Debug\Content\TAHTAIN.xnb</Output> 191 <Time>2015-06- 09T13:42:13.6529687+03:00</Time>191 <Time>2015-06-11T09:14:16.8556403+03:00</Time> 192 192 </Item> 193 193 <Item> … … 217 217 <Output>C:\MyTemp\OttoR\Last Light\Last Light\Last Light\bin\x86\Debug\Content\LootaKuva.xnb</Output> 218 218 <Time>2015-06-10T13:45:27.9439622+03:00</Time> 219 </Item> 220 <Item> 221 <Source>sydan.png</Source> 222 <Name>sydan</Name> 223 <Importer>TextureImporter</Importer> 224 <Processor>TextureProcessor</Processor> 225 <Options>None</Options> 226 <Output>C:\MyTemp\OttoR\Last Light\Last Light\Last Light\bin\x86\Debug\Content\sydan.xnb</Output> 227 <Time>2015-06-11T10:49:24.9160403+03:00</Time> 219 228 </Item> 220 229 <BuildSuccessful>true</BuildSuccessful> -
2014/koodauskerho/38/OttoR/Last Light/Last Light/Last Light/obj/x86/Debug/Last Light.csproj.FileListAbsolute.txt
r6002 r6014 31 31 C:\MyTemp\OttoR\Last Light\Last Light\Last Light\bin\x86\Debug\Content\healthkit.xnb 32 32 C:\MyTemp\OttoR\Last Light\Last Light\Last Light\bin\x86\Debug\Content\LootaKuva.xnb 33 C:\MyTemp\OttoR\Last Light\Last Light\Last Light\bin\x86\Debug\Content\sydan.xnb -
2014/koodauskerho/38/OttoR/Last Light/Last Light/Last Light/obj/x86/Debug/cachefile-{1C34B668-D9F3-4304-A5FC-ECD367C2BC30}-targetpath.txt
r6002 r6014 23 23 Content\healthkit.xnb 24 24 Content\LootaKuva.xnb 25 Content\sydan.xnb -
2014/koodauskerho/38/OttoR/Last Light/Last Light/Last LightContent/Last LightContent.contentproj
r6002 r6014 209 209 </Compile> 210 210 </ItemGroup> 211 <ItemGroup> 212 <Compile Include="sydan.png"> 213 <Name>sydan</Name> 214 <Importer>TextureImporter</Importer> 215 <Processor>TextureProcessor</Processor> 216 </Compile> 217 </ItemGroup> 211 218 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 212 219 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2014/koodauskerho/38/OttoR/Last Light/Last Light/Last LightContent/kentta1.txt
r6002 r6014 15 15 # S Z ZZZ 16 16 ######### ### 17 # # 18 # S 19 # # S 20 #Z Z Z ## S 21 ## ########## 22 # S N 23 # P S 24 # # S ## ########## 25 # ############ ZZZ ## S 26 # S S ##### #Z S 27 # S ## #L LZ S LZ Z ZZ P 28 ## Z SZZ #LLZ LL ##### #### #### ######### 17 # # ####### 18 # S S 19 # # S S ##### 20 #Z Z Z ## S #### # 21 ## ########## S # # 22 # S N S # 23 # P S S # 24 # # S ## ########## ############ # 25 # ############ ZZZ ## S # ## 26 # S S ##### #Z S # 27 # S ## #L LZ S LZ Z ZZ P # 28 ## Z SZZ #LLZ LL ##### #### #### ######### #### 29 29 ######### ##### ############ # # # 30 # # ### ### S # ## ## Z ## ## Z S 30 # # ### ### S # ## ## Z ## ## Z S # # 31 31 # S # ## ### ## ### S # 32 32 # # S Z A P ZL # L ## Z ## S ZZZ # 33 # Z ## S ########### ######### ######## ###### ##### #### L ## ## P Z######### 33 # Z ## S ########### ######### ######## ###### ##### #### L ## ## P Z########## # 34 34 ### ######## # ### ### ## ### ###### ##### ##### ###### ## # 35 35 # S S S S S ## S S ZZ Z S S S Z #
Note: See TracChangeset
for help on using the changeset viewer.