Changeset 6876
- Timestamp:
- 2015-07-21 15:01:15 (8 years ago)
- Location:
- 2015/30/EemilR
- Files:
-
- 11 added
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/30/EemilR/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli.cs
r6838 r6876 15 15 PlatformCharacter pelaaja1; 16 16 17 Image pelaajanKuva = LoadImage(" hahmo");17 Image pelaajanKuva = LoadImage("pallo"); 18 18 Image tahtiKuva = LoadImage("tahti"); 19 Image avainKuva = LoadImage("Avain"); 19 Image avainKuva = LoadImage("Key"); 20 Image kyllaAvain = LoadImage("kylla_avain"); 21 Image eiAvain = LoadImage("ei_avain"); 22 Image ovi = LoadImage("Ristikko") 20 23 21 int avaintenmaara = 0; 24 25 DoubleMeter avaintenmaara; 26 27 22 28 23 29 … … 29 35 public override void Begin() 30 36 { 37 38 //Window.Width = 800; 39 //Window.Height = 600; 40 41 IsFullScreen = true; 42 31 43 Gravity = new Vector(0, -1000); 32 44 33 45 LuoKentta(); 34 46 LisaaNappaimet(); 47 Asetamittari(); 35 48 36 // = true;49 37 50 Camera.Follow(pelaaja1); 38 51 Camera.ZoomFactor = 1.0; 39 52 Camera.StayInLevel = true; 53 54 40 55 56 } 57 58 void Asetamittari() 59 { 60 avaintenmaara = new DoubleMeter(0); 61 avaintenmaara.MaxValue = 1; 62 avaintenmaara.UpperLimit += avaimetTaynna; 63 64 ProgressBar avainNaytto = new ProgressBar(150, 180); 65 avainNaytto.BindTo(avaintenmaara); 66 avainNaytto.X = Screen.Left + 85; 67 avainNaytto.Y = Screen.Bottom + 100; 68 avainNaytto.Image = LoadImage("ei_avain"); 69 avainNaytto.BarImage = LoadImage("kylla_avain"); 70 Add(avainNaytto); 41 71 } 42 72 … … 45 75 TileMap kentta = TileMap.FromLevelAsset("kentta1"); 46 76 kentta.SetTileMethod('#', LisaaTaso); 47 kentta.SetTileMethod(' *', LisaaTahti);77 kentta.SetTileMethod('O', LisaaOvi); 48 78 kentta.SetTileMethod('N', LisaaPelaaja); 49 79 kentta.SetTileMethod('A', LisaaAvain); … … 61 91 } 62 92 63 void Lisaa Tahti(Vector paikka, double leveys, double korkeus)93 void LisaaOvi(Vector paikka, double leveys, double korkeus) 64 94 { 95 //Muuta tiedot oveksi 96 65 97 PhysicsObject tahti = PhysicsObject.CreateStaticObject(leveys, korkeus); 66 98 tahti.IgnoresCollisionResponse = true; … … 78 110 pelaaja1.Image = pelaajanKuva; 79 111 AddCollisionHandler(pelaaja1, "avain", TormaaAvaimeen); 80 pelaaja1.Shape = Shape.FromImage(pelaajanKuva);81 112 Add(pelaaja1); 82 113 … … 126 157 } 127 158 128 void TormaaAvaimeen(PhysicsObject hahmo, PhysicsObject tahti)159 void TormaaAvaimeen(PhysicsObject hahmo, PhysicsObject avain) 129 160 { 130 161 maaliAani.Play(); 131 162 MessageDisplay.Add("Sait avaimen!"); 132 tahti.Destroy();163 avain.Destroy(); 133 164 134 IntMeter avaimet 135 165 166 avaintenmaara.Value += 1; 167 } 168 169 void avaimetTaynna() 170 { 171 MessageDisplay.Add("Sinulla on nyt yksi avain!"); 136 172 } 137 173 } -
2015/30/EemilR/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli.csproj.Debug.cachefile
r6838 r6876 2 2 Content\tahti.xnb 3 3 Content\kentta1.xnb 4 Content\hahmo.xnb5 4 Content\Avain.xnb 5 Content\pallo.xnb 6 Content\Key.xnb 7 Content\ei_avain.xnb 8 Content\kylla_avain.xnb -
2015/30/EemilR/Tasohyppelypeli/Tasohyppelypeli/TasohyppelypeliContent/TasohyppelypeliContent.contentproj
r6838 r6876 63 63 </ItemGroup> 64 64 <ItemGroup> 65 <Compile Include=" hahmo.png">66 <Name> hahmo</Name>65 <Compile Include="Avain.png"> 66 <Name>Avain</Name> 67 67 <Importer>TextureImporter</Importer> 68 68 <Processor>TextureProcessor</Processor> … … 70 70 </ItemGroup> 71 71 <ItemGroup> 72 <Compile Include="Avain.png"> 73 <Name>Avain</Name> 72 <Compile Include="pallo.png"> 73 <Name>pallo</Name> 74 <Importer>TextureImporter</Importer> 75 <Processor>TextureProcessor</Processor> 76 </Compile> 77 <Compile Include="Key.png"> 78 <Name>Key</Name> 79 <Importer>TextureImporter</Importer> 80 <Processor>TextureProcessor</Processor> 81 </Compile> 82 </ItemGroup> 83 <ItemGroup> 84 <Compile Include="ei_avain.png"> 85 <Name>ei_avain</Name> 86 <Importer>TextureImporter</Importer> 87 <Processor>TextureProcessor</Processor> 88 </Compile> 89 <Compile Include="kylla_avain.png"> 90 <Name>kylla_avain</Name> 91 <Importer>TextureImporter</Importer> 92 <Processor>TextureProcessor</Processor> 93 </Compile> 94 </ItemGroup> 95 <ItemGroup> 96 <Compile Include="Ristikko.png"> 97 <Name>Ristikko</Name> 74 98 <Importer>TextureImporter</Importer> 75 99 <Processor>TextureProcessor</Processor> -
2015/30/EemilR/Tasohyppelypeli/Tasohyppelypeli/TasohyppelypeliContent/kentta1.txt
r6838 r6876 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ####### 19 ## ## 20 ### ###21 # 22 #N 23 # A24 ###### ####25 # # 26 # # 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 1 .............................................................................................................................................................................. 2 .............................................................................................................................................................................. 3 .............................................................................................................................................................................. 4 .............................................................................................................................................................................. 5 .............................................................................................................................................................................. 6 .............................................................................................................................................................................. 7 .............................................................................................................................................................................. 8 .............................................................................................................................................................................. 9 .............................................................................................................................................................................. 10 .............................................................................................................................................................................. 11 .............................................................................................................................................................................. 12 .............................................................................................................................................................................. 13 .............................................................................................................................................................................. 14 .............................................................................................................................................................................. 15 .............................................................................................................................................................................. 16 .............................................................................................................................................................................. 17 .............................................................................................................................................................................. 18 ...#######........................................................................................................................................................................... 19 ..##.....##..................................................................................................................................................................... 20 ###.......###......................................................................................................................................................................... 21 #.............................................................................................................................................................................. 22 #N.............................................................................................................................................................................. 23 #.......A....................................................................................................................................................................... 24 ######..####.......................................................................................................................................................................... 25 .....#..#...................................................................................................................................................................... 26 .....#..#....................................................................................................................................................................... 27 .............................................................................................................................................................................. 28 .............................................................................................................................................................................. 29 .............................................................................................................................................................................. 30 .............................................................................................................................................................................. 31 .............................................................................................................................................................................. 32 .............................................................................................................................................................................. 33 .............................................................................................................................................................................. 34 .............................................................................................................................................................................. 35 .............................................................................................................................................................................. 36 .............................................................................................................................................................................. 37 .............................................................................................................................................................................. 38 .............................................................................................................................................................................. 39 .............................................................................................................................................................................. 40 .............................................................................................................................................................................. 41 .............................................................................................................................................................................. 42 .............................................................................................................................................................................. 43 .............................................................................................................................................................................. 44 .............................................................................................................................................................................. 45 .............................................................................................................................................................................. 46 .............................................................................................................................................................................. 47 .............................................................................................................................................................................. 48 .............................................................................................................................................................................. 49 .............................................................................................................................................................................. 50 .............................................................................................................................................................................. 51 .............................................................................................................................................................................. 52 .............................................................................................................................................................................. 53 .............................................................................................................................................................................. 54 .............................................................................................................................................................................. 55 .............................................................................................................................................................................. 56 .............................................................................................................................................................................. 57 .............................................................................................................................................................................. 58 .............................................................................................................................................................................. 59 .............................................................................................................................................................................. 60 .............................................................................................................................................................................. 61 .............................................................................................................................................................................. 62 .............................................................................................................................................................................. 63 .............................................................................................................................................................................. 64 .............................................................................................................................................................................. 65 .............................................................................................................................................................................. 66 .............................................................................................................................................................................. 67 .............................................................................................................................................................................. 68 .............................................................................................................................................................................. 69 .............................................................................................................................................................................. 70 ..............................................................................................................................................................................
Note: See TracChangeset
for help on using the changeset viewer.