- Timestamp:
- 2015-06-11 14:01:22 (8 years ago)
- Location:
- 2015/24/TuroR/Omapeli
- Files:
-
- 6 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/24/TuroR/Omapeli/Omapeli/Omapeli/Omapeli.cs
r5997 r6028 9 9 public class Omapeli : PhysicsGame 10 10 { 11 Image taustaKuva = LoadImage(" ");11 Image taustaKuva = LoadImage("kokki"); 12 12 13 13 Image ukkoAmpuu = LoadImage("ukko ampuu2"); … … 18 18 Image panoksenKuva = LoadImage("panos"); 19 19 20 Image[] pallonKuvat = LoadImages("apina", "UUS APINA", "sukkamato", "silma", "kännykkä", "Cannon", "possu", "tamm", "putin", "pall o o" );20 Image[] pallonKuvat = LoadImages("apina", "UUS APINA", "sukkamato", "silma", "kännykkä", "Cannon", "possu", "tamm", "putin", "pall o o", "kiekko"); 21 21 22 22 AssaultRifle pelaajan1Ase; 23 23 24 24 Image ukonKuva = LoadImage("ukko"); 25 25 26 EasyHighScore topLista = new EasyHighScore(); 26 27 27 28 28 29 public override void Begin() 29 30 { 30 31 31 topLista.HighScoreWindow.Closed += _ => LuoAlkuvalikko(); 32 LuoAlkuvalikko(); 33 } 34 35 void AloitaPeli() 36 { 37 ClearAll(); 32 38 LuoUusiApina(); 33 39 … … 44 50 Level.CreateLeftBorder(1.0, false); 45 51 PhysicsObject ylaReuna = Level.CreateTopBorder(1.0, false); 46 47 52 53 Level.Background.Image = taustaKuva; 54 Level.Background.FitToLevel(); 48 55 Surface alaReuna = Surface.CreateBottom(Level, 30, 100, 40, 10); 49 alaReuna.Y = Screen.Bottom + 100; 56 // vaiha tota jos eri näyttö !!\/ 57 alaReuna.Y = Screen.Bottom + 50; 50 58 Add(alaReuna); 51 59 … … 70 78 LuoAmmusLaskuri(); 71 79 72 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli");73 80 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 74 81 Mouse.Listen(MouseButton.Left, ButtonState.Down, AmmuAseella, "Ammu",ukko, pelaajan1Ase); 75 82 Mouse.Listen(MouseButton.Left, ButtonState.Released, AmpumisenLopetus, null, ukko); 76 83 Keyboard.Listen(Key.W, ButtonState.Down, Hyppääukolla, "Hyppää", ukko); 77 Keyboard.Listen(Key.A, ButtonState.Down, Liiku, "Liiku ", ukko, Direction.Left);78 Keyboard.Listen(Key.D, ButtonState.Down, Liiku, "Liiku ", ukko, Direction.Right);84 Keyboard.Listen(Key.A, ButtonState.Down, Liiku, "Liiku Vasemmalle", ukko, Direction.Left); 85 Keyboard.Listen(Key.D, ButtonState.Down, Liiku, "Liiku Oikealle", ukko, Direction.Right); 79 86 Mouse.ListenMovement(0.0, HiirenLiikutus, "Tahtaa", ukko); 87 Keyboard.Listen(Key.R, ButtonState.Pressed, AloitaAlusta, "Aloita alusta"); 80 88 } 81 89 … … 90 98 Timer.SingleShot(2.0, delegate { LuoUusiApina(); }); 91 99 kohde.Destroy(); 92 Explosion rajahdys = new Explosion(1 100);100 Explosion rajahdys = new Explosion(100); 93 101 rajahdys.Position = ammus.Position; 102 94 103 Add(rajahdys); 95 104 … … 121 130 void Hyppääukolla(PlatformCharacter2 ukko) 122 131 { 123 ukko. ForceJump(500.0);132 ukko.Jump(500.0); 124 133 } 125 134 … … 167 176 void LuoAmmusLaskuri() 168 177 { 169 ammusLaskuri = new IntMeter(0); 178 ammusLaskuri = new IntMeter(0, 0, 50); 179 ammusLaskuri.UpperLimit += PeliOhi; 170 180 171 181 Label ammusNaytto = new Label(); … … 178 188 Add(ammusNaytto); 179 189 } 190 191 void PeliOhi() 192 { 193 Timer.SingleShot(2.0, delegate 194 { 195 ClearAll(); 196 topLista.EnterAndShow(pisteLaskuri.Value); 197 }); 198 } 199 200 void ParhaatPisteet() 201 { 202 topLista.Show(); 203 } 204 205 206 void LuoAlkuvalikko() 207 { 208 MultiSelectWindow alkuValikko = new MultiSelectWindow("Pelin alkuvalikko", "Aloita peli", "Parhaat pisteet", "Lopeta"); 209 Add(alkuValikko); 210 alkuValikko.AddItemHandler(0, AloitaPeli); 211 alkuValikko.AddItemHandler(1, ParhaatPisteet); 212 alkuValikko.AddItemHandler(2, Exit); 213 } 214 215 void AloitaAlusta() 216 { 217 AloitaPeli(); 218 } 180 219 } -
2015/24/TuroR/Omapeli/Omapeli/Omapeli/Omapeli.csproj.Debug.cachefile
r5997 r6028 12 12 Content\putin.xnb 13 13 Content\pall o o.xnb 14 Content\kokki.xnb 15 Content\kiekko.xnb -
2015/24/TuroR/Omapeli/Omapeli/Omapeli/obj/x86/Debug/ContentPipeline-{595E6F62-26BF-42FB-ABC6-C9280882E6ED}.xml
r5997 r6028 119 119 <Time>2015-06-10T12:37:40.4670799+03:00</Time> 120 120 </Item> 121 <Item> 122 <Source>kokki.jpg</Source> 123 <Name>kokki</Name> 124 <Importer>TextureImporter</Importer> 125 <Processor>TextureProcessor</Processor> 126 <Options>None</Options> 127 <Output>C:\MyTemp\TuroR\UusiPeli\Omapeli\Omapeli\Omapeli\bin\x86\Debug\Content\kokki.xnb</Output> 128 <Time>2015-06-11T12:32:54.4095624+03:00</Time> 129 </Item> 130 <Item> 131 <Source>kiekko.png</Source> 132 <Name>kiekko</Name> 133 <Importer>TextureImporter</Importer> 134 <Processor>TextureProcessor</Processor> 135 <Options>None</Options> 136 <Output>C:\MyTemp\TuroR\UusiPeli\Omapeli\Omapeli\Omapeli\bin\x86\Debug\Content\kiekko.xnb</Output> 137 <Time>2015-06-11T12:45:59.864619+03:00</Time> 138 </Item> 121 139 <BuildSuccessful>true</BuildSuccessful> 122 140 <Settings> -
2015/24/TuroR/Omapeli/Omapeli/Omapeli/obj/x86/Debug/Omapeli.csproj.FileListAbsolute.txt
r5997 r6028 30 30 C:\MyTemp\TuroR\UusiPeli\Omapeli\Omapeli\Omapeli\bin\x86\Debug\Content\putin.xnb 31 31 C:\MyTemp\TuroR\UusiPeli\Omapeli\Omapeli\Omapeli\bin\x86\Debug\Content\pall o o.xnb 32 C:\MyTemp\TuroR\UusiPeli\Omapeli\Omapeli\Omapeli\bin\x86\Debug\Content\kokki.xnb 33 C:\MyTemp\TuroR\UusiPeli\Omapeli\Omapeli\Omapeli\bin\x86\Debug\Content\kiekko.xnb -
2015/24/TuroR/Omapeli/Omapeli/Omapeli/obj/x86/Debug/cachefile-{595E6F62-26BF-42FB-ABC6-C9280882E6ED}-targetpath.txt
r5997 r6028 12 12 Content\putin.xnb 13 13 Content\pall o o.xnb 14 Content\kokki.xnb 15 Content\kiekko.xnb -
2015/24/TuroR/Omapeli/Omapeli/OmapeliContent/OmapeliContent.contentproj
r5997 r6028 136 136 </Compile> 137 137 </ItemGroup> 138 <ItemGroup> 139 <Compile Include="kokki.jpg"> 140 <Name>kokki</Name> 141 <Importer>TextureImporter</Importer> 142 <Processor>TextureProcessor</Processor> 143 </Compile> 144 </ItemGroup> 145 <ItemGroup> 146 <Compile Include="kiekko.png"> 147 <Name>kiekko</Name> 148 <Importer>TextureImporter</Importer> 149 <Processor>TextureProcessor</Processor> 150 </Compile> 151 </ItemGroup> 138 152 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 139 153 <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Note: See TracChangeset
for help on using the changeset viewer.