Changeset 3865 for 2012/09-22
- Timestamp:
- 2012-10-20 15:56:28 (8 years ago)
- Location:
- 2012/09-22/JariK/Jimmy The Survivor!
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/09-22/JariK/Jimmy The Survivor!/Jimmy The Survivor!/Jimmy The Survivor!/Jimmy_The_Survivor_.cs
r3854 r3865 12 12 PhysicsObject Jimmy; 13 13 PlasmaCannon Jimmyase; 14 EasyHighScore topLista = new EasyHighScore(); 15 16 DoubleMeter elamaLaskuri; 14 17 15 18 public override void Begin() 16 19 { 20 LuoElamaLaskuri(); 21 LuoPistelaskuri(); 22 17 23 IsMouseVisible = true; 24 MultiSelectWindow alkuValikko = new MultiSelectWindow("Jimmy The Survivor", "Start game", "Top ten", "Exit game"); 25 26 alkuValikko.AddItemHandler(0, AloitaPeli); 27 alkuValikko.AddItemHandler(1, ParhaatPisteet); 28 alkuValikko.AddItemHandler(2, Exit); 29 alkuValikko.DefaultCancel = 2; 30 Add(alkuValikko); 18 31 19 32 Gravity = new Vector(0.0, -800.0); … … 23 36 Jimmy.Restitution = 1.0; 24 37 Add(Jimmy); 25 AddCollisionHandler(Jimmy, PelaajaTormasi);38 AddCollisionHandler(Jimmy, VihollinenTormasi); 26 39 Jimmyase = new PlasmaCannon(30, 10); 40 Jimmyase.Ammo.Value = 1000; 27 41 Jimmy.Add(Jimmyase); 28 42 29 PhysicsObject Vihollinen = new PhysicsObject(50, 50); 30 Vihollinen.Shape = Shape.Ellipse; 31 Vihollinen.Color = Color.Blue; 32 Vihollinen.Position = new Vector(250, 30); 33 Add(Vihollinen); 34 Vihollinen.Tag = "Vihollinen"; 35 43 44 45 36 46 37 47 Surface alaReuna = Surface.CreateBottom(Level); … … 47 57 oikeareuna.Color = Color.LightBlue; 48 58 Add(oikeareuna); 49 59 FollowerBrain seuraajanAivot = new FollowerBrain(Jimmy); 60 seuraajanAivot.Speed = 10; 61 seuraajanAivot.Active = true; 62 seuraajanAivot.DistanceClose = 2000; 63 seuraajanAivot.StopWhenTargetClose = false; 64 seuraajanAivot.TargetClose += mitaTapahtuuKunOllaanLahella; 50 65 Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, "Poistu"); 51 66 Keyboard.Listen(Key.Space, ButtonState.Down, AmmuAseella, "Ammu", Jimmyase); 52 67 Mouse.ListenMovement(0.1, Tahtaa, "Tähtää aseella"); 53 54 } 55 56 57 58 59 void LiikutaPelaajaa(Vector vektori) 60 { 61 Jimmy.Push(vektori); 62 } 63 68 LisaaVihollisia(); 69 } 64 70 void CreateBorders() 65 71 { 66 67 } 68 void PelaajaTormasi(PhysicsObject Vihollinen, PhysicsObject Jimmy) 69 { 70 72 73 } 74 void VihollinenTormasi(PhysicsObject Jimmy, PhysicsObject kohde) 75 { 76 //AddCollisionHandler(Jimmy, "Vihollinen", CollisionHandler.AddMeterValue(elamaLaskuri, -1)); 77 elamaLaskuri.Value -= 1; 78 71 79 } 72 80 void AmmuAseella(PlasmaCannon ase) 73 81 { 74 82 PhysicsObject ammus = ase.Shoot(); 75 83 76 84 if (ammus != null) 77 85 { … … 79 87 } 80 88 81 ase.FireRate = 3.0;89 ase.FireRate = 10; 82 90 } 83 91 void AmmusOsui(PhysicsObject ammus, PhysicsObject Vihollinen) … … 92 100 void Tahtaa(AnalogState hiirenLiike) 93 101 { 94 102 95 103 Vector suunta = (Mouse.PositionOnWorld - Jimmyase.AbsolutePosition).Normalize(); 96 104 Jimmyase.Angle = suunta.Angle; … … 98 106 void Vihollinenkuolee(PhysicsObject ammus, PhysicsObject Vihollinen) 99 107 { 100 Vihollinen.Destroy(); 108 Vihollinen.Destroy(); 109 pisteLaskuri.Value += 1; 101 110 } 102 111 void LisaaVihollisia() 103 112 { 104 113 Timer ajastin = new Timer(); 105 ajastin.Interval = 1.0;106 ajastin.Timeout += LisaaViholli sia;114 ajastin.Interval = 0.5; 115 ajastin.Timeout += LisaaVihollinen; 107 116 ajastin.Start(); 108 117 } 118 void LisaaVihollinen() 119 { 120 PhysicsObject Vihollinen = new PhysicsObject(50, 50); 121 Vihollinen.Shape = Shape.Ellipse; 122 Vihollinen.Color = Color.Blue; 123 Vihollinen.Position = new Vector(250, 30); 124 Add(Vihollinen); 125 Vihollinen.Tag = "Vihollinen"; 126 127 128 129 130 131 } 132 void mitaTapahtuuKunOllaanLahella() 133 { 134 135 136 } 137 void AloitaPeli() 138 { 139 } 140 void ParhaatPisteet() 141 { 142 } 143 144 IntMeter pisteLaskuri; 145 146 void LuoPistelaskuri() 147 { 148 pisteLaskuri = new IntMeter(0); 149 150 Label pisteNaytto = new Label(); 151 pisteNaytto.X = Screen.Left + 100; 152 pisteNaytto.Y = Screen.Top - 100; 153 pisteNaytto.TextColor = Color.Black; 154 pisteNaytto.Color = Color.White; 155 156 pisteNaytto.BindTo(pisteLaskuri); 157 Add(pisteNaytto); 158 159 160 161 162 } 163 void PainettiinValikonNappia(int valinta) 164 { 165 switch (valinta) 166 { 167 case 0: 168 // AloitaPeli(); 169 break; 170 case 1: 171 // ParhaatPisteet(); 172 break; 173 case 2: 174 Exit(); 175 break; 176 } 177 178 } 179 void LuoElamaLaskuri() 180 { 181 elamaLaskuri = new DoubleMeter(10); 182 elamaLaskuri.MaxValue = 100; 183 elamaLaskuri.LowerLimit += ElamaLoppui; 184 185 186 ProgressBar elamaPalkki = new ProgressBar(150, 20); 187 elamaPalkki.X = Screen.Left + 150; 188 elamaPalkki.Y = Screen.Top - 20; 189 elamaPalkki.BindTo(elamaLaskuri); 190 Add(elamaPalkki); 191 } 192 193 void ElamaLoppui() 194 { 195 ClearGameObjects(); 196 MessageDisplay.Add("Jimmy you fool! You can't never stop my army! Muahhahhahhahhahhaa! "); 197 topLista.EnterAndShow(pisteLaskuri.Value); 198 topLista.HighScoreWindow.Closed += delegate { Exit(); }; 199 200 } 201 202 203 109 204 } -
2012/09-22/JariK/Jimmy The Survivor!/Jimmy The Survivor!/Jimmy The Survivor!/bin/x86/Debug/Jypeli.xml
r3854 r3865 2345 2345 <member name="M:Jypeli.Game.ClearGameObjects"> 2346 2346 <summary> 2347 Tu ohoaa ja poistaa pelistÀ kaikki pelioliot (ml. fysiikkaoliot).2347 Tuhoaa ja poistaa pelistÀ kaikki pelioliot (ml. fysiikkaoliot). 2348 2348 </summary> 2349 2349 </member> … … 2437 2437 <summary> 2438 2438 Kerrokset, joilla pelioliot viihtyvÀt. 2439 </summary> 2440 </member> 2441 <member name="P:Jypeli.Game.StaticLayers"> 2442 <summary> 2443 Kerrokset, joilla olevat pelioliot eivÀt liiku kameran mukana. 2444 </summary> 2445 </member> 2446 <member name="P:Jypeli.Game.DynamicLayers"> 2447 <summary> 2448 Kerrokset, joilla olevat pelioliot liikkuvat kameran mukana. 2439 2449 </summary> 2440 2450 </member> … … 5681 5691 </summary> 5682 5692 </member> 5693 <member name="M:Jypeli.FileManager.ChDir(System.String)"> 5694 <summary> 5695 Vaihtaa nykyistÀ hakemistoa. 5696 </summary> 5697 <param name="path">Hakemistopolku</param> 5698 <returns>Vaihdettiinko hakemistoa</returns> 5699 </member> 5700 <member name="M:Jypeli.FileManager.MkDir(System.String)"> 5701 <summary> 5702 Luo uuden hakemiston. 5703 </summary> 5704 <param name="path">Luotavan hakemiston nimi.</param> 5705 </member> 5706 <member name="M:Jypeli.FileManager.RmDir(System.String)"> 5707 <summary> 5708 Poistaa hakemiston. 5709 </summary> 5710 <param name="path">Poistettavan hakemiston nimi.</param> 5711 </member> 5712 <member name="M:Jypeli.FileManager.PushDir(System.String)"> 5713 <summary> 5714 Vaihtaa työhakemistoa jÀttÀen edellisen hakemiston muistiin. 5715 Kutsu PopDir kun haluat palauttaa työhakemiston edelliseen arvoonsa. 5716 </summary> 5717 <param name="dir"></param> 5718 </member> 5719 <member name="M:Jypeli.FileManager.PopDir"> 5720 <summary> 5721 Palauttaa edellisen työhakemiston. 5722 Jos edellistÀ työhakemistoa ei ole tallennettu, sÀilytetÀÀn nykyinen. 5723 </summary> 5724 </member> 5725 <member name="M:Jypeli.FileManager.DoWith(System.String,System.Action{Jypeli.StorageFile})"> 5726 <summary> 5727 Avaa tiedoston (lukua varten) ja tekee sillÀ jotain. 5728 </summary> 5729 <param name="fileName">Tiedoston nimi</param> 5730 <param name="callback">MitÀ tehdÀÀn (aliohjelman nimi)</param> 5731 <example> 5732 { 5733 DoWith( "kuva.png", AsetaKuva ); 5734 } 5735 5736 void AsetaKuva( StorageFile kuva ) 5737 { 5738 olio.Image = new Image( kuva ); 5739 } 5740 </example> 5741 </member> 5742 <member name="M:Jypeli.FileManager.DoWithURL(System.String,System.Action{Jypeli.StorageFile})"> 5743 <summary> 5744 Avaa tiedoston netistÀ (lukua varten) ja tekee sillÀ jotain. 5745 </summary> 5746 <param name="url">Nettiosoite</param> 5747 <param name="callback">MitÀ tehdÀÀn (aliohjelman nimi)</param> 5748 <example> 5749 { 5750 DoWith( "http://www.google.fi/images/srpr/logo3w.png", AsetaKuva ); 5751 } 5752 5753 void AsetaKuva( StorageFile kuva ) 5754 { 5755 olio.Image = new Image( kuva ); 5756 } 5757 </example> 5758 </member> 5759 <member name="M:Jypeli.FileManager.DoWithURL(System.String,System.TimeSpan,System.Action{Jypeli.StorageFile})"> 5760 <summary> 5761 Avaa tiedoston netistÀ (lukua varten) ja tekee sillÀ jotain. 5762 </summary> 5763 <param name="url">Nettiosoite</param> 5764 <param name="callback">MitÀ tehdÀÀn (aliohjelman nimi)</param> 5765 <example> 5766 { 5767 DoWith( "http://www.google.fi/images/srpr/logo3w.png", AsetaKuva ); 5768 } 5769 5770 void AsetaKuva( StorageFile kuva ) 5771 { 5772 olio.Image = new Image( kuva ); 5773 } 5774 </example> 5775 </member> 5776 <member name="M:Jypeli.FileManager.TriggerOnComplete(System.Action,Jypeli.FileManager.AsyncOperation[])"> 5777 <summary> 5778 Laukaisee aliohjelman kun annetut operaatiot on suoritettu. 5779 </summary> 5780 <param name="callback">Aliohjelma</param> 5781 <param name="actions">Operaatiot</param> 5782 </member> 5783 <member name="M:Jypeli.FileManager.TriggerOnComplete(System.Action,System.TimeSpan,Jypeli.FileManager.AsyncOperation[])"> 5784 <summary> 5785 Laukaisee aliohjelman kun annetut operaatiot on suoritettu. 5786 </summary> 5787 <param name="callback">Aliohjelma</param> 5788 <param name="timeout">Kuinka pitkÀÀn odotetaan yksittÀistÀ operaatiota ennen kuin luovutetaan</param> 5789 <param name="actions">Operaatiot</param> 5790 </member> 5791 <member name="M:Jypeli.FileManager.Export(System.IO.Stream,System.String)"> 5792 <summary> 5793 Vie virran sisÀllön tiedostoon. 5794 </summary> 5795 <param name="objStream">Virta</param> 5796 <param name="fileName">Tiedoston nimi</param> 5797 </member> 5798 <member name="P:Jypeli.FileManager.CurrentDirectory"> 5799 <summary> 5800 Nykyinen työhakemisto. 5801 </summary> 5802 </member> 5683 5803 <member name="T:Jypeli.Widgets.Background"> 5684 5804 <summary> … … 6403 6523 </member> 6404 6524 <member name="M:Jypeli.Widgets.MessageDisplay.Add(System.String)"> 6525 <summary> 6526 LisÀÀ uuden viestin nÀkymÀÀn. 6527 </summary> 6528 </member> 6529 <member name="M:Jypeli.Widgets.MessageDisplay.Add(System.String,Jypeli.Color)"> 6405 6530 <summary> 6406 6531 LisÀÀ uuden viestin nÀkymÀÀn. … … 14158 14283 </summary> 14159 14284 </member> 14160 <member name="M:Jypeli.FileManager.PushDir(System.String)">14161 <summary>14162 Vaihtaa työhakemistoa jÀttÀen edellisen hakemiston muistiin.14163 Kutsu PopDir kun haluat palauttaa työhakemiston edelliseen arvoonsa.14164 </summary>14165 <param name="dir"></param>14166 </member>14167 <member name="M:Jypeli.FileManager.PopDir">14168 <summary>14169 Palauttaa edellisen työhakemiston.14170 Jos edellistÀ työhakemistoa ei ole tallennettu, sÀilytetÀÀn nykyinen.14171 </summary>14172 </member>14173 <member name="M:Jypeli.FileManager.DoWith(System.String,System.Action{Jypeli.StorageFile})">14174 <summary>14175 Avaa tiedoston (lukua varten) ja tekee sillÀ jotain.14176 </summary>14177 <param name="fileName">Tiedoston nimi</param>14178 <param name="callback">MitÀ tehdÀÀn (aliohjelman nimi)</param>14179 <example>14180 {14181 DoWith( "kuva.png", AsetaKuva );14182 }14183 14184 void AsetaKuva( StorageFile kuva )14185 {14186 olio.Image = new Image( kuva );14187 }14188 </example>14189 </member>14190 <member name="M:Jypeli.FileManager.DoWithURL(System.String,System.Action{Jypeli.StorageFile})">14191 <summary>14192 Avaa tiedoston netistÀ (lukua varten) ja tekee sillÀ jotain.14193 </summary>14194 <param name="url">Nettiosoite</param>14195 <param name="callback">MitÀ tehdÀÀn (aliohjelman nimi)</param>14196 <example>14197 {14198 DoWith( "http://www.google.fi/images/srpr/logo3w.png", AsetaKuva );14199 }14200 14201 void AsetaKuva( StorageFile kuva )14202 {14203 olio.Image = new Image( kuva );14204 }14205 </example>14206 </member>14207 <member name="M:Jypeli.FileManager.DoWithURL(System.String,System.TimeSpan,System.Action{Jypeli.StorageFile})">14208 <summary>14209 Avaa tiedoston netistÀ (lukua varten) ja tekee sillÀ jotain.14210 </summary>14211 <param name="url">Nettiosoite</param>14212 <param name="callback">MitÀ tehdÀÀn (aliohjelman nimi)</param>14213 <example>14214 {14215 DoWith( "http://www.google.fi/images/srpr/logo3w.png", AsetaKuva );14216 }14217 14218 void AsetaKuva( StorageFile kuva )14219 {14220 olio.Image = new Image( kuva );14221 }14222 </example>14223 </member>14224 <member name="M:Jypeli.FileManager.TriggerOnComplete(System.Action,Jypeli.FileManager.AsyncOperation[])">14225 <summary>14226 Laukaisee aliohjelman kun annetut operaatiot on suoritettu.14227 </summary>14228 <param name="callback">Aliohjelma</param>14229 <param name="actions">Operaatiot</param>14230 </member>14231 <member name="M:Jypeli.FileManager.TriggerOnComplete(System.Action,System.TimeSpan,Jypeli.FileManager.AsyncOperation[])">14232 <summary>14233 Laukaisee aliohjelman kun annetut operaatiot on suoritettu.14234 </summary>14235 <param name="callback">Aliohjelma</param>14236 <param name="timeout">Kuinka pitkÀÀn odotetaan yksittÀistÀ operaatiota ennen kuin luovutetaan</param>14237 <param name="actions">Operaatiot</param>14238 </member>14239 <member name="M:Jypeli.FileManager.Export(System.IO.Stream,System.String)">14240 <summary>14241 Vie virran sisÀllön tiedostoon.14242 </summary>14243 <param name="objStream">Virta</param>14244 <param name="fileName">Tiedoston nimi</param>14245 </member>14246 <member name="P:Jypeli.FileManager.CurrentDirectory">14247 <summary>14248 Nykyinen työhakemisto.14249 </summary>14250 </member>14251 14285 <member name="T:Jypeli.StorageFile"> 14252 14286 <summary> … … 14280 14314 </summary> 14281 14315 <param name="path"></param> 14316 </member> 14317 <member name="M:Jypeli.WindowsFileManager.GetFileList"> 14318 <summary> 14319 Antaa listan nykyisessÀ hakemistossa olevista tiedostoista. 14320 </summary> 14321 <returns></returns> 14282 14322 </member> 14283 14323 <member name="M:Jypeli.WindowsFileManager.Open(System.String,System.Boolean)"> … … 14829 14869 </summary> 14830 14870 </member> 14871 <member name="P:Jypeli.ScreenView.Size"> 14872 <summary> 14873 NÀytön koko vektorina. 14874 </summary> 14875 </member> 14831 14876 <member name="P:Jypeli.ScreenView.Left"> 14832 14877 <summary> -
2012/09-22/JariK/Jimmy The Survivor!/Jimmy The Survivor!/Jimmy The Survivor!/obj/x86/Debug/Jimmy The Survivor!.csproj.FileListAbsolute.txt
r3854 r3865 7 7 c:\MyTemp\ohjelmointikerho\Jimmy The Survivor!\Jimmy The Survivor!\Jimmy The Survivor!\obj\x86\Debug\Jimmy The Survivor!.exe 8 8 c:\MyTemp\ohjelmointikerho\Jimmy The Survivor!\Jimmy The Survivor!\Jimmy The Survivor!\obj\x86\Debug\Jimmy The Survivor!.pdb 9 C:\MyTemp\JariK\Jimmy The Survivor!\Jimmy The Survivor!\Jimmy The Survivor!\bin\x86\Debug\Jimmy The Survivor!.exe 10 C:\MyTemp\JariK\Jimmy The Survivor!\Jimmy The Survivor!\Jimmy The Survivor!\bin\x86\Debug\Jimmy The Survivor!.pdb 11 C:\MyTemp\JariK\Jimmy The Survivor!\Jimmy The Survivor!\Jimmy The Survivor!\bin\x86\Debug\Jypeli.dll 12 C:\MyTemp\JariK\Jimmy The Survivor!\Jimmy The Survivor!\Jimmy The Survivor!\bin\x86\Debug\Jypeli.xml 13 C:\MyTemp\JariK\Jimmy The Survivor!\Jimmy The Survivor!\Jimmy The Survivor!\obj\x86\Debug\ResolveAssemblyReference.cache 14 C:\MyTemp\JariK\Jimmy The Survivor!\Jimmy The Survivor!\Jimmy The Survivor!\obj\x86\Debug\Microsoft.Xna.Framework.RuntimeProfile.txt 15 C:\MyTemp\JariK\Jimmy The Survivor!\Jimmy The Survivor!\Jimmy The Survivor!\obj\x86\Debug\Jimmy The Survivor!.exe 16 C:\MyTemp\JariK\Jimmy The Survivor!\Jimmy The Survivor!\Jimmy The Survivor!\obj\x86\Debug\Jimmy The Survivor!.pdb
Note: See TracChangeset
for help on using the changeset viewer.