Changeset 3524
- Timestamp:
- 2012-07-04 10:50:11 (10 years ago)
- Location:
- 2012/27/HenriM/kaljaadventures/kaljaadventures
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/27/HenriM/kaljaadventures/kaljaadventures/kaljaadventures/kaljaadventures.cs
r3496 r3524 9 9 public class kaljaadventures : PhysicsGame 10 10 { 11 int kenttataso = 0; 12 int rasvalisa = 0; 13 IntMeter rasvamaara; 11 14 const double nopeus = 200; 12 15 const double hyppyNopeus = 1000; … … 29 32 { 30 33 ClearAll(); 34 rasvamaara = new IntMeter(0); 31 35 Gravity = new Vector(0, -1000); 32 36 … … 40 44 void LuoKentta() 41 45 { 42 TileMap kentta = TileMap.FromLevelAsset("kentta1"); 43 kentta.SetTileMethod('#', LisaaTaso); 44 kentta.SetTileMethod('*', LisaaRasva); 45 kentta.SetTileMethod('N', LisaaPelaaja); 46 kentta.SetTileMethod('S', LisaaSoppa); 47 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 48 Level.CreateBorders(); 49 Level.Background.CreateGradient(Color.White, Color.SkyBlue); 46 if (kenttataso == 1) 47 { 48 ClearAll(); 49 TileMap.FromLevelAsset("kentta2"); 50 } 51 TileMap kentta = TileMap.FromLevelAsset("kentta1"); 52 kentta.SetTileMethod('#', LisaaTaso); 53 kentta.SetTileMethod('*', LisaaRasva); 54 kentta.SetTileMethod('K', LisaaPelaaja); 55 kentta.SetTileMethod('S', LisaaSoppa); 56 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 57 Level.CreateBorders(); 58 Level.Background.CreateGradient(Color.White, Color.SkyBlue); 59 50 60 } 51 61 … … 85 95 pelaaja1.Image = pelaajanKuva; 86 96 AddCollisionHandler(pelaaja1, "mursunrasva", TormaaMursuun); 97 AddCollisionHandler(pelaaja1, "soppa", TormaaSoppaan); 87 98 Add(pelaaja1); 88 99 } … … 119 130 void TormaaMursuun(PhysicsObject hahmo, PhysicsObject mursunrasva) 120 131 { 132 if (rasvamaara == 12) 133 { 134 kenttataso += 1; 135 AloitaPeli(); 136 } 121 137 maaliAani.Play(); 122 138 MessageDisplay.Add("Mursunrasva kasvattaa voimiasi!"); 123 139 mursunrasva.Destroy(); 124 140 } 141 142 void TormaaSoppaan(PhysicsObject hahmo, PhysicsObject soppa) 143 { 144 AloitaPeli(); 145 146 } 125 147 } -
2012/27/HenriM/kaljaadventures/kaljaadventures/kaljaadventuresContent/kaljaadventuresContent.contentproj
r3496 r3524 87 87 </Compile> 88 88 </ItemGroup> 89 <ItemGroup> 90 <Compile Include="kentta2.txt"> 91 <Name>kentta2</Name> 92 <Importer>TextFileImporter</Importer> 93 <Processor>TextFileContentProcessor</Processor> 94 </Compile> 95 </ItemGroup> 89 96 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 90 97 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2012/27/HenriM/kaljaadventures/kaljaadventures/kaljaadventuresContent/kentta1.txt
r3496 r3524 5 5 ## ## 6 6 7 * 8 ## ####7 * SS * 8 ########## 9 9 10 * S* *SS*10 * * * S* 11 11 ## ## ## ## 12 12 13 * * S **14 ## ## ## ####13 * S * SS * S * 14 ###### ## ###### 15 15 16 N16 K 17 17 ######################
Note: See TracChangeset
for help on using the changeset viewer.