Changeset 735
- Timestamp:
- 2010-06-11 11:29:02 (13 years ago)
- Location:
- 2010/23/tajomyll
- Files:
-
- 11 added
- 5 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
2010/23/tajomyll/EHGABWWTGSBIAE/Content/Content.contentproj
r699 r735 75 75 <Importer>TextureImporter</Importer> 76 76 <Processor>TextureProcessor</Processor> 77 </Compile> 78 <Compile Include="Kauppa.png"> 79 <Name>Kauppa</Name> 80 <Importer>TextureImporter</Importer> 81 <Processor>TextureProcessor</Processor> 77 <CopyToOutputDirectory>Always</CopyToOutputDirectory> 82 78 </Compile> 83 79 </ItemGroup> … … 87 83 <Importer>TextureImporter</Importer> 88 84 <Processor>TextureProcessor</Processor> 85 <CopyToOutputDirectory>Always</CopyToOutputDirectory> 89 86 </Compile> 90 87 </ItemGroup> … … 95 92 <Processor>TextureProcessor</Processor> 96 93 <CopyToOutputDirectory>Always</CopyToOutputDirectory> 94 </Compile> 95 </ItemGroup> 96 <ItemGroup> 97 <Compile Include="Kauppa.png"> 98 <Name>Kauppa</Name> 99 <Importer>TextureImporter</Importer> 100 <Processor>TextureProcessor</Processor> 101 </Compile> 102 </ItemGroup> 103 <ItemGroup> 104 <Compile Include="tynnyri2.png"> 105 <Name>tynnyri2</Name> 106 <Importer>TextureImporter</Importer> 107 <Processor>TextureProcessor</Processor> 108 </Compile> 109 <Compile Include="tynnyri3.png"> 110 <Name>tynnyri3</Name> 111 <Importer>TextureImporter</Importer> 112 <Processor>TextureProcessor</Processor> 113 </Compile> 114 <Compile Include="tynnyri4.png"> 115 <Name>tynnyri4</Name> 116 <Importer>TextureImporter</Importer> 117 <Processor>TextureProcessor</Processor> 118 </Compile> 119 </ItemGroup> 120 <ItemGroup> 121 <Compile Include="tynnyri.png"> 122 <Name>tynnyri</Name> 123 <Importer>TextureImporter</Importer> 124 <Processor>TextureProcessor</Processor> 125 </Compile> 126 </ItemGroup> 127 <ItemGroup> 128 <Compile Include="Päävalikko.png"> 129 <Name>Päävalikko</Name> 130 <Importer>TextureImporter</Importer> 131 <Processor>TextureProcessor</Processor> 97 132 </Compile> 98 133 </ItemGroup> -
2010/23/tajomyll/EHGABWWTGSBIAE/Peli.cs
r699 r735 20 20 21 21 PlatformCharacter pelaaja1; 22 PhysicsObject tynnyri; 22 23 23 24 int kenttaNro; // monesko kenttä on menossa … … 75 76 if (kenttaNro == 0) 76 77 { 78 LuoValikko(); 79 } 80 else if (kenttaNro == 1) 81 { 77 82 // Level.Background.Image = LoadImage("Koti"); 78 83 LuoKoti(); 79 84 } 80 else if (kenttaNro == 1)85 else if (kenttaNro == 2) 81 86 { 82 87 LuoKallio(); 83 88 } 84 else if (kenttaNro == 2)89 else if (kenttaNro == 3) 85 90 { 86 91 LuoKauppa(); 87 92 } 88 else if (kenttaNro == 3)93 else if (kenttaNro == 4) 89 94 { 90 95 LuoLoppu(); … … 98 103 PhysicsObject taso = PhysicsObject.CreateStaticObject(ruudunLeveys, ruudunKorkeus); 99 104 taso.Color = Color.Green; 100 taso.IsVisible = true;105 taso.IsVisible = false; 101 106 //taso.X = x; 102 107 //taso.Y = y; … … 128 133 if (kukaTormaa.Tag.ToString() == "pelaaja") 129 134 { 130 MessageDisplay.Add("Pelaaja törmäsi reunaan");131 135 kenttaNro = kenttaNro + 1; 132 136 seuraavaKentta(); … … 197 201 PhysicsObject maali = PhysicsObject.CreateStaticObject(ruudunLeveys, ruudunKorkeus); 198 202 maali.Color = Color.Gray; 199 maali.IsVisible = true;203 maali.IsVisible = false; 200 204 AddCollisionHandler(maali, KasitteleMaaliinTulo); 201 205 return maali; 202 206 } 207 void lisaaTynnyri(Timer sender) 208 { 209 tynnyri = new PhysicsObject(100, 100); 210 tynnyri.Shape = Shapes.Circle; 211 tynnyri.Mass = 4.0; 212 213 if (pelaaja1.X > 405.0) 214 { 215 tynnyri.X = 500.0; 216 tynnyri.Y = 500.0; 217 218 tynnyri.Image = LoadImage("tynnyri"); 219 AddCollisionHandler(tynnyri, KasitteleTynnyrinTormays); 220 // Image[] tekstuurit = LoadImages("tynnyri", "tynnyri2", "tynnyri3", "tynnyri4"); 221 222 // Animation pyoriminen = new Animation(tekstuurit); 223 // pyoriminen.FPS = 7.0; 224 /* 225 tynnyri.Tag = "tynnyri"; 226 tynnyri.LeftWalkingAnimation = pyoriminen; 227 tynnyri.RightWalkingAnimation = Animation.Mirror(pyoriminen); 228 tynnyri.LeftIdleAnimation = new Animation(LoadImage("tynnyri")); 229 tynnyri.RightIdleAnimation = new Animation(Image.Mirror(LoadImage("tynnyri")));*/ 230 231 Add(tynnyri); 232 233 sender.Stop(); 234 } 203 235 } 204 236 void KasitteleMaaliinTulo(PhysicsObject maali, PhysicsObject pelaaja1) … … 207 239 seuraavaKentta(); 208 240 } 209 void KasittelePiikkienTormays(PhysicsObject piikit, PhysicsObject pelaaja1) 210 { 211 kenttaNro = 0; 212 seuraavaKentta(); 213 pelaaja1.X = -500; 214 pelaaja1.Y = Level.Bottom + 1000; 241 void KasittelePiikkienTormays(PhysicsObject piikit, PhysicsObject kukaTormaa) 242 { 243 if (kukaTormaa == pelaaja1) 244 { 245 kenttaNro = 0; 246 seuraavaKentta(); 247 pelaaja1.X = -500; 248 pelaaja1.Y = Level.Bottom + 1000; 249 } 250 } 251 void KasitteleTynnyrinTormays(PhysicsObject tynnyri, PhysicsObject kukaTormaa) 252 { 253 if (kukaTormaa == pelaaja1) 254 { 255 kenttaNro = 0; 256 seuraavaKentta(); 257 pelaaja1.X = -500; 258 pelaaja1.Y = Level.Bottom + 1000; 259 } 215 260 } 216 261 /*void KasittelePelaajanTormays(PhysicsObject pelaaja1, PhysicsObject kohde) … … 221 266 } 222 267 }*/ 223 268 269 void LuoValikko() 270 { 271 Level.Background.Image = LoadImage("Päävalikko"); 272 Level.Background.Size = new Vector(1240, 1024); 273 274 Keyboard.Listen(Key.N, ButtonState.Pressed, LuoKoti, "Poistu valikosta pelaamaan"); 275 // Keyboard.Listen(Key.N, ButtonState.Pressed, PoisValikosta(), "Aloitetaan peli"); 276 } 277 224 278 void LuoKoti() 225 279 { … … 228 282 //tausta.Image = LoadImage("Koti"); 229 283 //Add(tausta); 230 MessageDisplay.Add("Tultiin LuoKoti()-aliohjelmaan");231 284 Level.CreateBorders(); 232 285 … … 260 313 { 261 314 315 Timer ajastin = new Timer(); 316 ajastin.Interval = 1; 317 ajastin.Trigger += lisaaTynnyri; 318 Add(ajastin); 319 320 ajastin.Start(); 321 262 322 Level.Background.Image = LoadImage("Kallio"); 263 323 Level.Background.Size = new Vector(1240, 1024); 264 324 Level.CreateBorders(); 325 326 //if (pelaaja1.X > 500) 327 //{ 328 // lisaaTynnyri(); 329 //} 330 331 // if (Timer. 265 332 266 333 var merkit = new Dictionary<char, ObjectCreator>(); … … 283 350 merkit['p'] = lisaaPelaaja; 284 351 merkit['|'] = lisaaReuna; 352 merkit['m'] = lisaaMaali; 285 353 char[,] ruudut = Tiles.ReadFromFile("kauppa.txt"); 286 354 Tiles.Insert(this, ruudut, merkit, ruudunLeveys, ruudunKorkeus); -
2010/23/tajomyll/EHGABWWTGSBIAE/kallio.txt
r699 r735 21 21 xxxxxxxxxxxxxxxxx xxxxxxxxxxxxx| 22 22 xxxxxxxxxxxxxxxxx xxxxxxxxxxxxx| 23 xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxx|24 xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx|25 xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx|26 xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx|27 xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx|23 xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxx| 24 xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx| 25 xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx| 26 xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx| 27 xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx| 28 28 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx| 29 29 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx| -
2010/23/tajomyll/EHGABWWTGSBIAE/kauppa.txt
r699 r735 1 |2 |3 p |4 |5 |6 xxxxx |7 xxxxx |8 xxxxxxxxxxx |9 xxxxxxxxxxx |10 xxxxxxxxxxx |11 xxxxxxxxxxx |12 xxxxxxxxxxx |13 xxxxxxxxxxx |14 xxxxxxxxxxx |15 xxxxxxxxxxx |16 xxxxxxxxxxx |17 xxxxxxxxxxx |18 xxxxxxxxxxx |19 xxxxxxxxxxx |20 xxxxxxxxxxx |21 xxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|22 xxxxxxxxxxx xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|23 xxxxxxxxxxx xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|24 xxxxxxxxxxx xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|25 xxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|26 xxxxxxxxxxx |27 xxxxxxxxxxx |28 xxxxxxxxxxx |29 xxxxxxxxxxx |30 xxxxxxxxxxx |1 x 2 x 3 p x 4 x 5 x 6 xxxxx x 7 xxxxx x 8 xxxxxxxxxxx x 9 xxxxxxxxxxx x 10 xxxxxxxxxxx x 11 xxxxxxxxxxx x 12 xxxxxxxxxxx x 13 xxxxxxxxxxx x 14 xxxxxxxxxxx x 15 xxxxxxxxxxx x 16 xxxxxxxxxxx x 17 xxxxxxxxxxx mmm x 18 xxxxxxxxxxx mmm x 19 xxxxxxxxxxx mmm x 20 xxxxxxxxxxx mmm x 21 xxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxx 22 xxxxxxxxxxx xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxx 23 xxxxxxxxxxx xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxx 24 xxxxxxxxxxx xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxx 25 xxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxx 26 xxxxxxxxxxx x 27 xxxxxxxxxxx x 28 xxxxxxxxxxx x 29 xxxxxxxxxxx x 30 xxxxxxxxxxx x 31 31 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 32 32 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Note: See TracChangeset
for help on using the changeset viewer.