Changeset 5818
- Timestamp:
- 2015-03-14 14:54:36 (8 years ago)
- Location:
- 2014/koodauskerho/38/JaakkoS/FarmDefense
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
2014/koodauskerho/38/JaakkoS/FarmDefense/FarmDefense/FarmDefense/FarmDefense.cs
r5811 r5818 18 18 List<Vector> pisteet; 19 19 Vector[] pisteTaulu; 20 List<Vector> rahat; 21 Vector[] rahaTaulu; 20 22 21 23 int aalto = 1; 22 24 IntMeter elämät; 25 IntMeter rahaLaskuri; 23 26 24 27 GameObject cursor; … … 41 44 42 45 elämät = new IntMeter(10, 0, 10); 46 43 47 Label pisteNaytto = new Label(); 44 48 pisteNaytto.X = Screen.Left + 100; … … 46 50 pisteNaytto.TextColor = Color.Black; 47 51 pisteNaytto.Color = Color.White; 48 49 52 pisteNaytto.BindTo(elämät); 50 53 Add(pisteNaytto); 51 54 52 55 elämät.LowerLimit += GameOver; 56 57 58 rahaLaskuri = new IntMeter(20, 0, 9999 ); 59 60 Label rahaNaytto = new Label(); 61 rahaNaytto.X = Screen.Right - 100; 62 rahaNaytto.Y = Screen.Top - 100; 63 rahaNaytto.TextColor = Color.White; 64 rahaNaytto.Color = Color.Blue; 65 rahaNaytto.Title = "Rahat"; 66 rahaNaytto.BindTo(rahaLaskuri); 67 Add(rahaNaytto); 53 68 54 69 … … 77 92 } 78 93 79 Timer.SingleShot( 10, Luoaalto);94 Timer.SingleShot(2, Luoaalto); 80 95 81 96 Luopainikkeet(); … … 115 130 if (vihut.Count > 0) 116 131 { 117 ase.AbsoluteAngle = (vihut[0].Position -kana.Position).Angle;132 ase.AbsoluteAngle = (vihut[0].Position - kana.Position).Angle; 118 133 AmmuAseella(ase); 119 134 } … … 129 144 if (kohde.Tag == "susi") 130 145 { 131 ((Vihu)kohde).Elamalaskuri.Value --; 146 Vihu vihu = (Vihu)kohde; 147 vihu.Elamalaskuri.Value--; 148 if (vihu.Elamalaskuri.Value == vihu.Elamalaskuri.MinValue) rahaLaskuri.Value += 1; 132 149 } 133 150 } … … 160 177 Mouse.ListenOn(kana, MouseButton.Left, ButtonState.Pressed, delegate 161 178 { 162 cursor.Image = kana.Image; 179 if (rahaLaskuri.Value >= 10) 180 { 181 rahaLaskuri.Value -= 10; 182 cursor.Image = kana.Image; 183 } 163 184 164 185 }, null); … … 237 258 { 238 259 susia--; 239 LuoSusi(3* (aalto / 2)); 260 MessageDisplay.Add("Uusi susi energiamäärällä: " + 3 * (aalto / 2.0)); 261 LuoSusi(3 * (aalto / 2.0 )); 240 262 } 241 263 else 242 264 { 243 265 ajastin.Stop(); 266 MessageDisplay.Add("Aalto loppui, seuraava 10s kuluttua!"); 244 267 aalto++; 245 268 Timer.SingleShot(10, Luoaalto); … … 250 273 } 251 274 252 void LuoSusi( intkestavyys)275 void LuoSusi(double kestavyys) 253 276 { 254 277 Vihu susi = new Vihu(70, 100); 255 278 susi.Image = Sudenkuvat[0]; 256 279 Animation animaatio = new Animation(Sudenkuvat); 257 animaatio.FPS = 5;280 animaatio.FPS = 4; 258 281 susi.Animation = animaatio; 259 282 susi.Position = pisteet[0]; … … 263 286 susi.Tag = "susi"; 264 287 susi.MuutaElamamaara(kestavyys); 265 Add(susi); 288 Add(susi); 289 290 Timer sudenkaanto = new Timer(); 291 sudenkaanto.Interval = 0.1; 292 sudenkaanto.Timeout += delegate { KaannaSusi(susi); }; 293 sudenkaanto.Start(); 266 294 267 295 … … 271 299 Aivo.ArrivedAtEnd += delegate 272 300 { 301 273 302 elämät.Value--; 274 303 susi.Destroy(); 275 304 }; 276 305 susi.Brain = Aivo; 277 } 278 } 306 } 307 void KaannaSusi(Vihu susi) 308 { 309 susi.Angle = susi.Velocity.Angle; 310 } 311 312 313 } 314 -
2014/koodauskerho/38/JaakkoS/FarmDefense/FarmDefense/FarmDefense/FarmDefense.csproj.Debug.cachefile
r5811 r5818 1 1 Content\tie.xnb 2 2 Content\nurmikko.xnb 3 Content\kenttÀ1.xnb4 3 Content\sus1.xnb 5 4 Content\sus2.xnb 6 5 Content\kana.xnb 7 6 Content\muna1.xnb 7 Content\kenttÀ1.xnb -
2014/koodauskerho/38/JaakkoS/FarmDefense/FarmDefense/FarmDefense/Vihu.cs
r5811 r5818 10 10 class Vihu : PhysicsObject 11 11 { 12 private IntMeter elamaLaskuri = new IntMeter(3, 0, 10);13 public IntMeter Elamalaskuri { get { return elamaLaskuri; } }12 private DoubleMeter elamaLaskuri = new DoubleMeter(3, 0, 10); 13 public DoubleMeter Elamalaskuri { get { return elamaLaskuri; } } 14 14 15 15 public Vihu(double leveys, double korkeus) … … 18 18 elamaLaskuri.LowerLimit += delegate { this.Destroy(); }; 19 19 } 20 public void MuutaElamamaara (int uusimaara) 20 21 22 public void MuutaElamamaara (double uusimaara) 21 23 { 22 24 this.elamaLaskuri.Value = uusimaara; -
2014/koodauskerho/38/JaakkoS/FarmDefense/FarmDefense/FarmDefense/obj/x86/Debug/ContentPipeline-{2A79B1E6-582D-4907-808F-C874DEC572F7}.xml
r5811 r5818 9 9 <Options>None</Options> 10 10 <Output>C:\MyTemp\JaakkoS\FarmDefense\FarmDefense\FarmDefense\bin\x86\Debug\Content\tie.xnb</Output> 11 <Time>2015-0 2-14T10:02:27.1354147+02:00</Time>11 <Time>2015-03-14T09:48:48.2649817+02:00</Time> 12 12 </Item> 13 13 <Item> … … 18 18 <Options>None</Options> 19 19 <Output>C:\MyTemp\JaakkoS\FarmDefense\FarmDefense\FarmDefense\bin\x86\Debug\Content\nurmikko.xnb</Output> 20 <Time>2015-02-14T10:02:27.1354147+02:00</Time> 20 <Time>2015-03-14T09:48:48.2493816+02:00</Time> 21 </Item> 22 <Item> 23 <Source>sus1.png</Source> 24 <Name>sus1</Name> 25 <Importer>TextureImporter</Importer> 26 <Processor>TextureProcessor</Processor> 27 <Options>None</Options> 28 <Output>C:\MyTemp\JaakkoS\FarmDefense\FarmDefense\FarmDefense\bin\x86\Debug\Content\sus1.xnb</Output> 29 <Time>2015-03-14T11:33:40.4577022+02:00</Time> 30 </Item> 31 <Item> 32 <Source>sus2.png</Source> 33 <Name>sus2</Name> 34 <Importer>TextureImporter</Importer> 35 <Processor>TextureProcessor</Processor> 36 <Options>None</Options> 37 <Output>C:\MyTemp\JaakkoS\FarmDefense\FarmDefense\FarmDefense\bin\x86\Debug\Content\sus2.xnb</Output> 38 <Time>2015-03-14T11:33:16.9352115+02:00</Time> 39 </Item> 40 <Item> 41 <Source>kana.png</Source> 42 <Name>kana</Name> 43 <Importer>TextureImporter</Importer> 44 <Processor>TextureProcessor</Processor> 45 <Options>None</Options> 46 <Output>C:\MyTemp\JaakkoS\FarmDefense\FarmDefense\FarmDefense\bin\x86\Debug\Content\kana.xnb</Output> 47 <Time>2015-03-14T09:48:48.3585823+02:00</Time> 48 </Item> 49 <Item> 50 <Source>muna1.png</Source> 51 <Name>muna1</Name> 52 <Importer>TextureImporter</Importer> 53 <Processor>TextureProcessor</Processor> 54 <Options>None</Options> 55 <Output>C:\MyTemp\JaakkoS\FarmDefense\FarmDefense\FarmDefense\bin\x86\Debug\Content\muna1.xnb</Output> 56 <Time>2015-03-14T09:48:48.2649817+02:00</Time> 21 57 </Item> 22 58 <Item> … … 27 63 <Options>None</Options> 28 64 <Output>C:\MyTemp\JaakkoS\FarmDefense\FarmDefense\FarmDefense\bin\x86\Debug\Content\kenttä1.xnb</Output> 29 <Time>2015-02-14T10:43:08.0282976+02:00</Time> 30 </Item> 31 <Item> 32 <Source>sus1.png</Source> 33 <Name>sus1</Name> 34 <Importer>TextureImporter</Importer> 35 <Processor>TextureProcessor</Processor> 36 <Options>None</Options> 37 <Output>C:\MyTemp\JaakkoS\FarmDefense\FarmDefense\FarmDefense\bin\x86\Debug\Content\sus1.xnb</Output> 38 <Time>2015-02-14T10:09:24.4685913+02:00</Time> 39 </Item> 40 <Item> 41 <Source>sus2.png</Source> 42 <Name>sus2</Name> 43 <Importer>TextureImporter</Importer> 44 <Processor>TextureProcessor</Processor> 45 <Options>None</Options> 46 <Output>C:\MyTemp\JaakkoS\FarmDefense\FarmDefense\FarmDefense\bin\x86\Debug\Content\sus2.xnb</Output> 47 <Time>2015-02-14T10:09:32.5184692+02:00</Time> 48 </Item> 49 <Item> 50 <Source>kana.png</Source> 51 <Name>kana</Name> 52 <Importer>TextureImporter</Importer> 53 <Processor>TextureProcessor</Processor> 54 <Options>None</Options> 55 <Output>C:\MyTemp\JaakkoS\FarmDefense\FarmDefense\FarmDefense\bin\x86\Debug\Content\kana.xnb</Output> 56 <Time>2015-02-14T11:52:17.3808976+02:00</Time> 57 </Item> 58 <Item> 59 <Source>muna1.png</Source> 60 <Name>muna1</Name> 61 <Importer>TextureImporter</Importer> 62 <Processor>TextureProcessor</Processor> 63 <Options>None</Options> 64 <Output>C:\MyTemp\JaakkoS\FarmDefense\FarmDefense\FarmDefense\bin\x86\Debug\Content\muna1.xnb</Output> 65 <Time>2015-02-14T11:52:34.3754976+02:00</Time> 65 <Time>2015-03-14T09:48:48.3429822+02:00</Time> 66 66 </Item> 67 67 <BuildSuccessful>true</BuildSuccessful> … … 112 112 <Assembly> 113 113 <Key>C:\Windows\Microsoft.Net\assembly\GAC_32\Microsoft.Xna.Framework.Content.Pipeline\v4.0_4.0.0.0__842cf8be1de50553\Microsoft.Xna.Framework.Content.Pipeline.dll</Key> 114 <Value>2014-04-23T0 1:01:53.8831999+03:00</Value>114 <Value>2014-04-23T00:30:18.4504836+03:00</Value> 115 115 </Assembly> 116 116 </Assemblies> -
2014/koodauskerho/38/JaakkoS/FarmDefense/FarmDefense/FarmDefense/obj/x86/Debug/cachefile-{2A79B1E6-582D-4907-808F-C874DEC572F7}-targetpath.txt
r5811 r5818 1 1 Content\tie.xnb 2 2 Content\nurmikko.xnb 3 Content\kenttÀ1.xnb4 3 Content\sus1.xnb 5 4 Content\sus2.xnb 6 5 Content\kana.xnb 7 6 Content\muna1.xnb 7 Content\kenttÀ1.xnb
Note: See TracChangeset
for help on using the changeset viewer.