Changeset 692 for 2010/23/vipaerpo
- Timestamp:
- 2010-06-10 14:58:06 (11 years ago)
- Location:
- 2010/23/vipaerpo
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/23/vipaerpo/Chavos world/Chavos world.csproj
r667 r692 89 89 <Content Include="Game.ico" /> 90 90 <Content Include="GameThumbnail.png" /> 91 <Content Include="kenttä 1.txt" /> 91 <Content Include="kenttä 1.txt"> 92 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 93 </Content> 92 94 </ItemGroup> 93 95 <ItemGroup> -
2010/23/vipaerpo/Chavos world/Peli.cs
r667 r692 14 14 15 15 IntMeter RahaLaskuri; 16 16 int paljonTarvitaanKolikoita; 17 17 ValueDisplay pisteNaytto; 18 18 … … 21 21 int kenttaNro; // monesko kenttä on menossa 22 22 23 const int ruudunLeveys = 50;24 const int ruudunKorkeus = 50;23 const int ruudunLeveys = 80; 24 const int ruudunKorkeus = 80; 25 25 26 26 … … 55 55 56 56 seuraavaKentta(); 57 MessageDisplay.Add(" etsitarpeeksi rahaa päästäksesi seuraavaan tasoon!");57 MessageDisplay.Add("kerää tarpeeksi rahaa päästäksesi seuraavaan tasoon!"); 58 58 } 59 59 … … 65 65 66 66 // Toistaiseksi vain yksi kenttä 67 //kenttaNro += 1; // lisätään kenttänumeroa yhdellä67 kenttaNro += 1; // lisätään kenttänumeroa yhdellä 68 68 MessageDisplay.Add("Kenttä " + kenttaNro); 69 69 … … 78 78 void luoKentta() 79 79 { 80 Level.CreateBorders(0.5, true); 80 paljonTarvitaanKolikoita = 0; 81 //Level.CreateBorders(0.5, true); 81 82 var merkit = new Dictionary<char, ObjectCreator>(); 82 83 merkit['1'] = luoPelaaja; … … 86 87 //merkit['p'] = luopiikit; 87 88 88 char[,] ruudut = Tiles.ReadFromFile("kentta 1.txt"); 89 Tiles.Insert(this, ruudut, merkit, ruudunLeveys, ruudunKorkeus); 90 91 for (int i = 0; i < 9; i++) 92 { 93 lisaaTaso(160 + (i*30), 60); 94 } 95 96 lisaaRahat(5); 89 if (kenttaNro == 1) { 90 char[,] ruudut = Tiles.ReadFromFile("kenttä 1.txt"); 91 Tiles.Insert(this, ruudut, merkit, ruudunLeveys, ruudunKorkeus); 92 } 93 else if (kenttaNro == 2) { 94 char[,] ruudut = Tiles.ReadFromFile("kenttä 1.txt"); 95 Tiles.Insert(this, ruudut, merkit, ruudunLeveys, ruudunKorkeus); 96 } 97 98 99 100 101 102 97 103 //lisaaMaali(); 98 104 //lisaaPelaajat(); … … 102 108 PhysicsObject LuoPalikka() 103 109 { 104 PhysicsObject palikka = PhysicsObject.CreateStaticObject( 50.0, 50.0);110 PhysicsObject palikka = PhysicsObject.CreateStaticObject(ruudunLeveys, ruudunKorkeus); 105 111 palikka.Shape = Shapes.Rectangle; 106 112 palikka.Color = Color.Gray; … … 110 116 PhysicsObject lisaaVartija() 111 117 { 112 PhysicsObject vartija = PhysicsObject.CreateStaticObject(1 40, 100);118 PhysicsObject vartija = PhysicsObject.CreateStaticObject(150, 90); 113 119 vartija.Image = LoadImage("omena vartija (nuijia)"); 114 120 AddCollisionHandler(vartija, osuiVartijaan); … … 120 126 // Tässä tormaaja on vartija 121 127 AloitaTasoAlusta(); 122 } 123 124 void lisaaRahat(int kpl) 125 { 126 for (int i = 0; i < kpl; i++) 127 { 128 LisaaRaha(RandomGen.NextDouble(Level.Left + 50, Level.Right - 50), RandomGen.NextDouble(Level.Bottom + 50, (Level.Top - 50)/2)); 129 } 128 MessageDisplay.Add("sinä kuolit, joudut aloittamaan alusta"); 130 129 } 131 130 … … 141 140 PhysicsObject luoPelaaja() 142 141 { 143 pelaaja1 = new PlatformCharacter(40, 100);142 pelaaja1 = new PlatformCharacter(40, 79); 144 143 pelaaja1.Mass = 4.0; 145 144 pelaaja1.Image = LoadImage("chavo"); … … 162 161 raha.Image = LoadImage("raha"); 163 162 raha.IgnoresCollisionResponse = true; // Hahmo ei "tökkää" kun se osuu rahaan 163 paljonTarvitaanKolikoita++; 164 164 AddCollisionHandler(raha, rahaanOsuttiin); 165 165 return raha; … … 180 180 raha.Destroy(); 181 181 MessageDisplay.Add("Raha kerätty"); 182 if (RahaLaskuri.Value > 4)182 if (RahaLaskuri.Value >= paljonTarvitaanKolikoita ) 183 183 { 184 184 seuraavaKentta(); … … 236 236 int edellisenKentanPisteet = RahaLaskuri.Value; 237 237 seuraavaKentta(); 238 MessageDisplay.Add(" Pääsit läpi kentän" + kenttaNro + ". Pisteitä: " + edellisenKentanPisteet);238 MessageDisplay.Add("hyvä! Pääsit tämän kentän läpi! " + kenttaNro + ". Pisteitä: " + edellisenKentanPisteet); 239 239 } 240 240 } -
2010/23/vipaerpo/Chavos world/kenttä 1.txt
r667 r692 5 5 6 6 7 8 xxxxxxxxxxxxxxxx 9 x x xxxxxxxxx10 x o x x o x11 x xxxxxxxxx x xx12 x xxxxxxx x xx13 1 o v ov14 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx x xxxxxx x x xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxx7 8 xxxxxxxxxxxxxxxx o 9 x xx xxx xxxx 10 x x x x x x x o 11 x x xo v x x 12 x x xxxxxxx x x x 13 1 v o v v v 14 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx x x x x x x xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxx 15 15 x x x x x x 16 x 17 x ppppppppx x x xv ox18 xxxxxxxxxx 19 xpppppppppppppx20 16 xx x x x x x 17 x x x x v o x 18 xxxxxxxxxxxxx x x xxxxxxxxxxx 19 x x 20 xxxxxxxxxxxxxxxx
Note: See TracChangeset
for help on using the changeset viewer.