Changeset 6988
- Timestamp:
- 2015-07-23 14:59:25 (8 years ago)
- Location:
- 2015/30/TomiM/Tasohyppelypeli
- Files:
-
- 11 added
- 5 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/30/TomiM/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli.cs
r6968 r6988 20 20 Image setelikuva = LoadImage("seteli"); 21 21 Image vihollisenKuva = LoadImage("vihollinen"); 22 Image setelikuva2 = LoadImage("seteli2"); 23 Image palikkakuva = LoadImage("palikka"); 24 Image palikkakuva2 = LoadImage("palikka2"); 25 Image maaalikuva = LoadImage("maaali"); 22 26 23 27 SoundEffect maaliAani = LoadSoundEffect("maali"); … … 63 67 kentta.SetTileMethod('V', LisaaVihollinen); 64 68 kentta.SetTileMethod('S', LisaaSeteli); 69 kentta.SetTileMethod('1', LisaaSeteli2); 70 kentta.SetTileMethod('P', LisaaPalikka); 71 kentta.SetTileMethod('p', LisaaPalikka2); 72 kentta.SetTileMethod('M', LisaaMaali); 73 65 74 66 75 … … 69 78 Level.CreateBorders(); 70 79 Level.Background.CreateGradient(Color.Blue, Color.SkyBlue); 71 } 72 void PelaajaTormasi(PhysicsObject vihollinen, PhysicsObject pelaaja1) 73 { 74 75 { 76 77 } 80 81 78 82 79 83 … … 107 111 AddCollisionHandler(pelaaja1, "kolikko", TormaaTahteen); 108 112 AddCollisionHandler(pelaaja1, "pahis", PelaajaOsuu); 113 AddCollisionHandler(pelaaja1, "seteli", TormaaSeteliin); 114 AddCollisionHandler(pelaaja1, "seteli2", TormaaSeteliin2); 115 AddCollisionHandler(pelaaja1, "maali", TormaaMaaliin); 109 116 Add(pelaaja1); 110 117 pelaaja1.CanRotate = false; … … 151 158 Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 152 159 153 Keyboard.Listen(Key.Space, ButtonState.Down, AmmuAseella, "Ammu", pelaaja1);160 154 161 155 162 … … 180 187 MessageDisplay.Add("Keräsit kolikon!"); 181 188 tahti.Destroy(); 189 pisteLaskuri.Value += 1; 182 190 } 183 191 void PelaajaOsuu(PhysicsObject hahmo, PhysicsObject vihollinen) … … 206 214 207 215 Camera.Follow(pelaaja1); 208 Camera.ZoomFactor = 1.2;216 Camera.ZoomFactor = 0.2; 209 217 Camera.StayInLevel = true; 210 218 … … 231 239 pisteNaytto.IntFormatString = "rahaa: {0:D1}"; 232 240 233 } 234 void AmmuAseella(PlatformCharacter pelaaja1) 235 { 236 PhysicsObject ammus = pelaaja1.Weapon.Shoot(); 241 242 237 243 238 244 } … … 240 246 { 241 247 PhysicsObject seteli = PhysicsObject.CreateStaticObject(leveys, korkeus); 242 seteli 248 seteli.IgnoresCollisionResponse = true; 243 249 seteli.Position = paikka; 244 250 seteli.Image = setelikuva; … … 249 255 250 256 } 251 252 } 253 254 255 256 257 258 259 260 261 262 257 void TormaaSeteliin(PhysicsObject hahmo, PhysicsObject tahti) 258 { 259 260 maaliAani.Play(); 261 MessageDisplay.Add("Keräsit setelin!"); 262 tahti.Destroy(); 263 pisteLaskuri.Value += 5; 264 } 265 266 void LisaaSeteli2(Vector paikka, double leveys, double korkeus) 267 { 268 PhysicsObject seteli2 = PhysicsObject.CreateStaticObject(leveys, korkeus); 269 seteli2.IgnoresCollisionResponse = true; 270 seteli2.Position = paikka; 271 seteli2.Image = setelikuva2; 272 seteli2.Tag = "seteli2"; 273 Add(seteli2); 274 } 275 void TormaaSeteliin2(PhysicsObject hahmo, PhysicsObject tahti) 276 { 277 278 maaliAani.Play(); 279 MessageDisplay.Add("Keräsit setelin!"); 280 tahti.Destroy(); 281 pisteLaskuri.Value += 100; 282 } 283 void LisaaPalikka(Vector paikka, double leveys, double korkeus) 284 { 285 PhysicsObject palikka = PhysicsObject.CreateStaticObject(leveys, korkeus); 286 palikka.IgnoresCollisionResponse = true; 287 palikka.Position = paikka; 288 palikka.Image = palikkakuva; 289 palikka.Tag = "palikka"; 290 Add(palikka); 291 292 293 294 295 } 296 void LisaaPalikka2(Vector paikka, double leveys, double korkeus) 297 { 298 PhysicsObject palikka2 = PhysicsObject.CreateStaticObject(leveys, korkeus); 299 palikka2.IgnoresCollisionResponse = true; 300 palikka2.Position = paikka; 301 palikka2.Image = palikkakuva2; 302 palikka2.Tag = "palikka2"; 303 Add(palikka2); 304 } 305 void LisaaMaali(Vector paikka, double leveys, double korkeus) 306 { 307 PhysicsObject maali = PhysicsObject.CreateStaticObject(leveys, korkeus); 308 maali.IgnoresCollisionResponse = true; 309 maali.Position = paikka; 310 maali.Image = maaalikuva; 311 maali.Tag = "maali"; 312 Add(maali); 313 314 315 } 316 void TormaaMaaliin(PhysicsObject hahmo, PhysicsObject maali) 317 { 318 maaliAani.Play(); 319 MessageDisplay.Add("Läpäisit Tason!"); 320 SeuraavaKentta(); 321 322 323 } 324 void SeuraavaKentta() 325 { 326 ClearAll(); 327 LisaaNappaimet(); 328 LuoPistelaskuri(); 329 LuoKentta2(); 330 331 332 Gravity = new Vector(0, -1000); 333 334 Camera.Follow(pelaaja1); 335 Camera.ZoomFactor = 1.2; 336 Camera.StayInLevel = true; 337 } 338 void LuoKentta2() 339 { 340 341 LuoKentta(); 342 LisaaNappaimet(); 343 LuoPistelaskuri(); 344 345 346 } 347 348 349 350 351 } 352 -
2015/30/TomiM/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli.csproj.Debug.cachefile
r6968 r6988 1 1 Content\maali.xnb 2 Content\norsu.xnb3 Content\tahti.xnb4 2 Content\kolikko.xnb 5 3 Content\tyyppi3.xnb … … 11 9 Content\tyyppi6.xnb 12 10 Content\kentta1.xnb 11 Content\seteli.xnb 12 Content\seteli2.xnb 13 Content\palikka.xnb 14 Content\palikka2.xnb 15 Content\kentta.xnb 13 16 Content\kentta2.xnb 14 Content\ seteli.xnb17 Content\maaali.xnb -
2015/30/TomiM/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli/obj/x86/Debug/Tasohyppelypeli.csproj.FileListAbsolute.txt
r6968 r6988 1 1 C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\maali.xnb 2 C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\norsu.xnb3 C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\tahti.xnb4 2 C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Tasohyppelypeli.exe 5 3 C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Tasohyppelypeli.pdb … … 19 17 C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\tyyppi6.xnb 20 18 C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\kentta1.xnb 19 C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\seteli.xnb 20 C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\seteli2.xnb 21 C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\palikka.xnb 22 C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\palikka2.xnb 23 C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\kentta.xnb 21 24 C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\kentta2.xnb 22 C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\ seteli.xnb25 C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\maaali.xnb -
2015/30/TomiM/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli/obj/x86/Debug/cachefile-{CA2FFE4F-20E6-425C-B09B-578352278E8F}-targetpath.txt
r6968 r6988 1 1 Content\maali.xnb 2 Content\norsu.xnb3 Content\tahti.xnb4 2 Content\kolikko.xnb 5 3 Content\tyyppi3.xnb … … 11 9 Content\tyyppi6.xnb 12 10 Content\kentta1.xnb 11 Content\seteli.xnb 12 Content\seteli2.xnb 13 Content\palikka.xnb 14 Content\palikka2.xnb 15 Content\kentta.xnb 13 16 Content\kentta2.xnb 14 Content\ seteli.xnb17 Content\maaali.xnb -
2015/30/TomiM/Tasohyppelypeli/Tasohyppelypeli/TasohyppelypeliContent/TasohyppelypeliContent.contentproj
r6968 r6988 50 50 <Importer>WavImporter</Importer> 51 51 <Processor>SoundEffectProcessor</Processor> 52 </Compile>53 <Compile Include="norsu.png">54 <Name>norsu</Name>55 <Importer>TextureImporter</Importer>56 <Processor>TextureProcessor</Processor>57 </Compile>58 <Compile Include="tahti.png">59 <Name>tahti</Name>60 <Importer>TextureImporter</Importer>61 <Processor>TextureProcessor</Processor>62 52 </Compile> 63 53 </ItemGroup> … … 126 116 </ItemGroup> 127 117 <ItemGroup> 128 <Compile Include=" kentta2.png">129 <Name> kentta2</Name>118 <Compile Include="seteli.png"> 119 <Name>seteli</Name> 130 120 <Importer>TextureImporter</Importer> 131 121 <Processor>TextureProcessor</Processor> … … 133 123 </ItemGroup> 134 124 <ItemGroup> 135 <Compile Include="seteli.png"> 136 <Name>seteli</Name> 125 <Compile Include="seteli2.png"> 126 <Name>seteli2</Name> 127 <Importer>TextureImporter</Importer> 128 <Processor>TextureProcessor</Processor> 129 </Compile> 130 </ItemGroup> 131 <ItemGroup> 132 <Compile Include="palikka.png"> 133 <Name>palikka</Name> 134 <Importer>TextureImporter</Importer> 135 <Processor>TextureProcessor</Processor> 136 </Compile> 137 </ItemGroup> 138 <ItemGroup> 139 <Compile Include="palikka2.png"> 140 <Name>palikka2</Name> 141 <Importer>TextureImporter</Importer> 142 <Processor>TextureProcessor</Processor> 143 </Compile> 144 </ItemGroup> 145 <ItemGroup> 146 <Compile Include="kentta.png"> 147 <Name>kentta</Name> 148 <Importer>TextureImporter</Importer> 149 <Processor>TextureProcessor</Processor> 150 </Compile> 151 </ItemGroup> 152 <ItemGroup> 153 <Compile Include="kentta2.txt"> 154 <Name>kentta2</Name> 155 <Importer>TextFileImporter</Importer> 156 <Processor>TextFileContentProcessor</Processor> 157 </Compile> 158 </ItemGroup> 159 <ItemGroup> 160 <Compile Include="maaali.png"> 161 <Name>maaali</Name> 137 162 <Importer>TextureImporter</Importer> 138 163 <Processor>TextureProcessor</Processor> -
2015/30/TomiM/Tasohyppelypeli/Tasohyppelypeli/TasohyppelypeliContent/kentta1.txt
r6968 r6988 1 1 ############################################################################# 2 ########################## 3 pppp###################### 4 V * V * V * *##ppppppppppppppppppp*S1## 5 #################################################################### 2 6 3 7 4 5 6 7 V * 8 * ########## V 9 * V#################### 10 # S ##### ***** 11 ## * N S ## S #V 12 ## ## ### # # # ########**** # 13 V # * # * V # * ## * # *################# V # V * 14 ################################################################# 8 ### 9 # SSS 10 S### V #### 11 ####### V V * V ##### 12 ############ * ########## V ######### 13 * V######################## ############ 14 # S ############################ 15 ## * N S ###############ppp#ppp 16 ## ## ### ## #ppp#### 17 V # * # * V # S S S *** V*########### V # V * 18 p################################################################## 19 p################################################################### 20 ppppppppppppppppppppppppppppppp1################################### 21 #####################################################################p 22 SSSppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp# 23 ###################################################################### -
2015/30/TomiM/Tasohyppelypeli/Tasohyppelypeli/TasohyppelypeliContent/obj/x86/Debug/ContentPipeline.xml
r6968 r6988 12 12 </Item> 13 13 <Item> 14 <Source>norsu.png</Source>15 <Name>norsu</Name>16 <Importer>TextureImporter</Importer>17 <Processor>TextureProcessor</Processor>18 <Options>None</Options>19 <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\norsu.xnb</Output>20 <Time>2015-07-22T09:51:56.0700364+03:00</Time>21 </Item>22 <Item>23 <Source>tahti.png</Source>24 <Name>tahti</Name>25 <Importer>TextureImporter</Importer>26 <Processor>TextureProcessor</Processor>27 <Options>None</Options>28 <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\tahti.xnb</Output>29 <Time>2015-07-22T09:51:56.0710364+03:00</Time>30 </Item>31 <Item>32 14 <Source>kolikko.png</Source> 33 15 <Name>kolikko</Name> … … 108 90 <Options>None</Options> 109 91 <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\kentta1.xnb</Output> 110 <Time>2015-07-23T11:48:20.8309042+03:00</Time> 111 </Item> 112 <Item> 113 <Source>kentta2.png</Source> 114 <Name>kentta2</Name> 115 <Importer>TextureImporter</Importer> 116 <Processor>TextureProcessor</Processor> 117 <Options>None</Options> 118 <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\kentta2.xnb</Output> 119 <Time>2015-07-23T11:26:14.6714042+03:00</Time> 92 <Time>2015-07-23T14:58:06.3293185+03:00</Time> 120 93 </Item> 121 94 <Item> … … 127 100 <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\seteli.xnb</Output> 128 101 <Time>2015-07-23T11:44:30.1477042+03:00</Time> 102 </Item> 103 <Item> 104 <Source>seteli2.png</Source> 105 <Name>seteli2</Name> 106 <Importer>TextureImporter</Importer> 107 <Processor>TextureProcessor</Processor> 108 <Options>None</Options> 109 <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\seteli2.xnb</Output> 110 <Time>2015-07-23T12:20:21.282647+03:00</Time> 111 </Item> 112 <Item> 113 <Source>palikka.png</Source> 114 <Name>palikka</Name> 115 <Importer>TextureImporter</Importer> 116 <Processor>TextureProcessor</Processor> 117 <Options>None</Options> 118 <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\palikka.xnb</Output> 119 <Time>2015-07-23T12:37:28.1670483+03:00</Time> 120 </Item> 121 <Item> 122 <Source>palikka2.png</Source> 123 <Name>palikka2</Name> 124 <Importer>TextureImporter</Importer> 125 <Processor>TextureProcessor</Processor> 126 <Options>None</Options> 127 <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\palikka2.xnb</Output> 128 <Time>2015-07-23T12:47:16.8128185+03:00</Time> 129 </Item> 130 <Item> 131 <Source>kentta.png</Source> 132 <Name>kentta</Name> 133 <Importer>TextureImporter</Importer> 134 <Processor>TextureProcessor</Processor> 135 <Options>None</Options> 136 <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\kentta.xnb</Output> 137 <Time>2015-07-23T13:39:43.2822185+03:00</Time> 138 </Item> 139 <Item> 140 <Source>kentta2.txt</Source> 141 <Name>kentta2</Name> 142 <Importer>TextFileImporter</Importer> 143 <Processor>TextFileContentProcessor</Processor> 144 <Options>None</Options> 145 <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\kentta2.xnb</Output> 146 <Time>2015-07-23T14:01:04.7560185+03:00</Time> 147 </Item> 148 <Item> 149 <Source>maaali.png</Source> 150 <Name>maaali</Name> 151 <Importer>TextureImporter</Importer> 152 <Processor>TextureProcessor</Processor> 153 <Options>None</Options> 154 <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\maaali.xnb</Output> 155 <Time>2015-07-23T14:32:14.9032185+03:00</Time> 129 156 </Item> 130 157 <BuildSuccessful>true</BuildSuccessful>
Note: See TracChangeset
for help on using the changeset viewer.