Changeset 6967
- Timestamp:
- 2015-07-23 11:48:46 (8 years ago)
- Location:
- 2015/30/EliasHu/RescueRanger
- Files:
-
- 4 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/30/EliasHu/RescueRanger/RescueRanger/RescueRanger/RescueRanger.cs
r6929 r6967 15 15 Label pisteNaytto; 16 16 IntMeter pistelaskuri; 17 int kenttanumero = 1; 18 19 17 int kenttanumero = 1; // tämä numero kertoo kentän aloitusnumeron 18 int kenttaNumeroMax = 2; 19 20 IntMeter pisteetkaikki = new IntMeter(0); 21 22 EasyHighScore topLista = new EasyHighScore(); 23 20 24 IntMeter pisteLaskuri2; 21 25 … … 25 29 //TODO vikaan kenttään metsäpalo 26 30 //TODO musiikki taustalle 27 //TODO maali texture 28 //TODO lääkäri asema loppuun 31 //TODO käännä laskuri 29 32 30 33 … … 37 40 Image rangerz = LoadImage ("ranger"); 38 41 Image fly = LoadImage ("Flybomb"); 42 Image Asem = LoadImage ("Asema"); 39 43 40 44 SoundEffect maaliAani = LoadSoundEffect ("maali"); … … 45 49 { 46 50 pisteLaskuri2 = new IntMeter(0); 47 aloitapeli(); 48 } 49 50 void aloitapeli() 51 AlkuValikko(); 52 53 } 54 55 void AloitaPeli() 51 56 { 52 57 ClearAll(); 58 if (kenttanumero > kenttaNumeroMax) 59 { 60 topLista.EnterAndShow(pisteetkaikki); 61 return; 62 } 53 63 Gravity = new Vector(0, -1000); 54 64 … … 59 69 60 70 71 61 72 Camera.Follow(pelaaja1); 62 73 Camera.ZoomFactor = 1.2; 63 74 Camera.StayInLevel = true; 64 75 } 76 77 void AlkuValikko(Window sender = null) 78 { 79 MultiSelectWindow alkuValikko = new MultiSelectWindow("Pelin alkuvalikko", 80 "Aloita peli", "Parhaat pisteet", "Lopeta"); 81 Add(alkuValikko); 82 alkuValikko.AddItemHandler(0, AloitaPeli); 83 alkuValikko.AddItemHandler(1, ParhaatPisteet); 84 alkuValikko.AddItemHandler(2, Exit); 85 } 86 87 void ParhaatPisteet() 88 { 89 topLista.Show(); 90 topLista.HighScoreWindow.Closed += AlkuValikko; 91 92 93 } 94 95 96 65 97 66 98 void LuoKentta() … … 77 109 kentta.SetTileMethod('r', LisaaRanger) ; 78 110 kentta.SetTileMethod('V', LisaaVihollinen); 111 kentta.SetTileMethod('a', LisaaAsema) ; 79 112 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO) ; 80 113 Level.CreateBorders(); … … 123 156 Add(talo); 124 157 158 } 159 160 void LisaaAsema(Vector paikka, double leveys, double korkeus) 161 { 162 GameObject asema = new GameObject(leveys * 6.5, korkeus * 3.2); 163 asema.Position = paikka; 164 asema.Image = Asem; 165 Add(asema); 125 166 } 126 167 … … 153 194 pelaaja1.Destroy() ; 154 195 vihollinen.Destroy() ; 155 Timer.SingleShot(2, aloitapeli); 196 pisteLaskuri2.Value += 1; 197 Timer.SingleShot(2, AloitaPeli); 156 198 } 157 199 … … 202 244 Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, "Näytä ohjeet"); 203 245 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 246 Keyboard.Listen(Key.N, ButtonState.Pressed, NoClip, "Älä tee sitä!", true); 247 Keyboard.Listen(Key.N, ButtonState.Released, NoClip, "Älä tee sitä!", false); 204 248 205 249 Keyboard.Listen(Key.Left, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, -nopeus); … … 225 269 hahmo.ForceJump(nopeus); 226 270 } 271 272 void NoClip(bool noclip) 273 { 274 pelaaja1.IgnoresCollisionResponse = noclip; 275 } 276 227 277 228 278 void TormaaElaimeen(PhysicsObject hahmo, PhysicsObject Elain) … … 238 288 if (pistelaskuri.Value == pistelaskuri.MaxValue) 239 289 { 240 290 pisteetkaikki.Value += pisteLaskuri2.Value; // lisää kaikenkaikkisiin yrityksiin tähä kenttään kuluneet yritykset. 241 291 kenttanumero++; 242 aloitapeli();292 AloitaPeli(); 243 293 } 244 294 } 245 295 void TormaaPuuhun(PhysicsObject hahmo, PhysicsObject Puu) 246 296 { 247 pisteLaskuri2.Value += 1; 248 hitmarker.Play(); 249 aloitapeli(); 250 } 297 if (!pelaaja1.IgnoresCollisionResponse) 298 { 299 pisteLaskuri2.Value += 1; 300 hitmarker.Play(); 301 AloitaPeli(); 302 } 303 } 304 251 305 252 306 void LuoPisteLaskuri() -
2015/30/EliasHu/RescueRanger/RescueRanger/RescueRanger/RescueRanger.csproj.Debug.cachefile
r6929 r6967 16 16 Content\Flybomb.xnb 17 17 Content\Barrels.xnb 18 Content\Asema.xnb -
2015/30/EliasHu/RescueRanger/RescueRanger/RescueRanger/obj/x86/Debug/RescueRanger.csproj.FileListAbsolute.txt
r6929 r6967 24 24 C:\MyTemp\EliasHu\RescueRanger\RescueRanger\RescueRanger\bin\x86\Debug\Content\Flybomb.xnb 25 25 C:\MyTemp\EliasHu\RescueRanger\RescueRanger\RescueRanger\bin\x86\Debug\Content\Barrels.xnb 26 C:\MyTemp\EliasHu\RescueRanger\RescueRanger\RescueRanger\bin\x86\Debug\Content\Asema.xnb -
2015/30/EliasHu/RescueRanger/RescueRanger/RescueRanger/obj/x86/Debug/cachefile-{D77DA1D7-8701-41C1-98B2-08AF5C040485}-targetpath.txt
r6929 r6967 16 16 Content\Flybomb.xnb 17 17 Content\Barrels.xnb 18 Content\Asema.xnb -
2015/30/EliasHu/RescueRanger/RescueRanger/RescueRangerContent/RescueRangerContent.contentproj
r6929 r6967 158 158 </Compile> 159 159 </ItemGroup> 160 <ItemGroup> 161 <Compile Include="Asema.png"> 162 <Name>Asema</Name> 163 <Importer>TextureImporter</Importer> 164 <Processor>TextureProcessor</Processor> 165 </Compile> 166 </ItemGroup> 160 167 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 161 168 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2015/30/EliasHu/RescueRanger/RescueRanger/RescueRangerContent/kentta1.txt
r6929 r6967 1 ###############iiiiii## ########################2 # ##iiii########3 # ##ii## V#####4 # #### ######### ##########5 # ## ##iiiiiiii### #iiiii#######6 # ## ###iiiiiiii#### ####iiiiiii#######7 # N ## ###iiiiiiii#################iiiii########8 # tttttttt # ## ############ ##iiiii###9 # ## # uuuu uuu ###10 # #i# uuuu###11 # #i# uuuu *###12 # #i# V uuuu =====####13 # #i### uuuu########14 # #iiii## uuuu uuu############1 ###############iiiiii##...............#############.............########### 2 #.............##iiii##......................V........................###### 3 #..............##ii##.................................................##### 4 #...............####.......########..................#####............##### 5 #................##.......#iiiiiiii###.............#iiiii###...........#### 6 #...a............##......##iiiiiiii####.........####iiiiiii###.........#### 7 #......N.........##.....###iiiiiiii#################iiiii#####..........### 8 #.tttttttt..#.....#.....############..............##iiiii#...............## 9 #..........##...............uuuu....................uuu.#................## 10 #.........#i#...............uuuu........................................### 11 #.........#i#...............uuuu.........*..............................### 12 #.........#i#.....V.........uuuu.......=====...........................#### 13 #.........#i###.............uuuu...................................######## 14 #.........#iiii##...........uuuu....................uuu........############ 15 15 ##########iiiiii########################################################### -
2015/30/EliasHu/RescueRanger/RescueRanger/RescueRangerContent/kentta2.txt
r6868 r6967 1 ###################### ############## ################################################ 2 3 * 4 ######### 5 * ############ 6 ############# 7 N ############# 8 ttttttt # ############ 9 ## #### 10 ### #### 11 ### * #### 12 ### #### 13 ##### #### === 14 ####### #### 15 ############################################################################################################## 1 ######################################### 2 #.....................#.................# 3 #..a...................#................# 4 #.....N..................##.............# 5 #ttttttttt..................##..........# 6 #.......#.....................########### 7 #.....#...........####.........#........# 8 #...###..........#iiii#.......#.........# 9 #.######.........#iiii#.......#.........# 10 ###uu####........#iiii#......#....####### 11 ##u#####..........####...........#iiiuui# 12 #u####...........................#iiiuui# 13 u###.....u..........V............##iiuui# 14 #......uu.........................##iuui# 15 #uuuuuu..........#####..............##u.# 16 #u...............#####......###........u# 17 #...........#######........##ii##.......# 18 #...........#iiii################.......# 19 #.......########iiiiii#######...........# 20 #.........##....#iiiiiiiiii##........#### 21 ####............#iiiiiiiiii##........#ii# 22 #iii#...........#iiiiiiiiii##........#ii# 23 #iii###.........####iiiiiii##........#### 24 #.uu.####..........##uuuuuu#............# 25 ########........##...uuuuuu......*......# 26 ###uuu###.......#u...uuuuuu.###=====##..# 27 ###uuu###.........uu.uuuuuu..uuuuu###...# 28 #.uu...............uuuuuuuuuuu..........# 29 #u......*............uuuuuu.............# 30 #....========........uuuuuu.............# 31 #.....######.........uuuuuu.............# 32 #.....######.........uuuuuu.............# 33 #.......uu...........uuuuuu.............# 34 ######################################### -
2015/30/EliasHu/RescueRanger/RescueRanger/RescueRangerContent/obj/x86/Debug/ContentPipeline.xml
r6929 r6967 36 36 <Options>None</Options> 37 37 <Output>C:\MyTemp\EliasHu\RescueRanger\RescueRanger\RescueRanger\bin\x86\Debug\Content\kentta1.xnb</Output> 38 <Time>2015-07-2 2T12:58:49.3534822+03:00</Time>38 <Time>2015-07-23T11:13:44.8751539+03:00</Time> 39 39 </Item> 40 40 <Item> … … 45 45 <Options>None</Options> 46 46 <Output>C:\MyTemp\EliasHu\RescueRanger\RescueRanger\RescueRanger\bin\x86\Debug\Content\kentta2.xnb</Output> 47 <Time>2015-07-2 1T13:47:55.9242693+03:00</Time>47 <Time>2015-07-23T11:35:25.3287406+03:00</Time> 48 48 </Item> 49 49 <Item> … … 154 154 <Output>C:\MyTemp\EliasHu\RescueRanger\RescueRanger\RescueRanger\bin\x86\Debug\Content\Barrels.xnb</Output> 155 155 <Time>2015-07-22T14:41:24.0884186+03:00</Time> 156 </Item> 157 <Item> 158 <Source>Asema.png</Source> 159 <Name>Asema</Name> 160 <Importer>TextureImporter</Importer> 161 <Processor>TextureProcessor</Processor> 162 <Options>None</Options> 163 <Output>C:\MyTemp\EliasHu\RescueRanger\RescueRanger\RescueRanger\bin\x86\Debug\Content\Asema.xnb</Output> 164 <Time>2015-07-23T09:59:13.1361402+03:00</Time> 156 165 </Item> 157 166 <BuildSuccessful>true</BuildSuccessful>
Note: See TracChangeset
for help on using the changeset viewer.