Changeset 1667
- Timestamp:
- 2010-08-06 13:01:11 (13 years ago)
- Location:
- 2010/31/ossakama
- Files:
-
- 4 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/31/ossakama/Erskan kostoretki/Content/Content.contentproj
r1634 r1667 82 82 </Compile> 83 83 </ItemGroup> 84 <ItemGroup> 85 <Compile Include="pottu.png"> 86 <Name>pottu</Name> 87 <Importer>TextureImporter</Importer> 88 <Processor>TextureProcessor</Processor> 89 </Compile> 90 </ItemGroup> 91 <ItemGroup> 92 <Compile Include="kranumies.png"> 93 <Name>kranumies</Name> 94 <Importer>TextureImporter</Importer> 95 <Processor>TextureProcessor</Processor> 96 </Compile> 97 </ItemGroup> 84 98 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 85 99 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2010/31/ossakama/Erskan kostoretki/Peli.cs
r1634 r1667 7 7 class Tasohyppely : PhysicsGame 8 8 { 9 DoubleMeter Enupalkki; 10 9 11 const int ruudunLeveys = 50; 10 12 const int ruudunKorkeus = 50; … … 29 31 Camera.ZoomFactor = 2.0; 30 32 Camera.StayInLevel = true; 33 34 Enupalkki = new DoubleMeter(100); 35 Enupalkki.MaxValue = 100; 36 BarGauge Enut = new BarGauge(20, 150); 37 Enut.BindTo(Enupalkki); 38 Add(Enut); 39 40 Enut.X = (0.8 * Screen.RightSafe); 41 Enut.Y = (0.8 * Screen.TopSafe); 42 Enut.BarColor = Color.Blue; 43 Enut.BorderColor = Color.White; 44 Enut.Angle = Angle.Degrees(90); 45 46 Enupalkki.LowerLimit += Gameover; 47 31 48 } 32 49 … … 67 84 ruudut['x'] = LuoRyssa; 68 85 ruudut['P'] = LuoPaakka; 86 ruudut['p'] = LuoPottu; 69 87 ruudut.Insert(ruudunLeveys, ruudunKorkeus); 70 88 } … … 85 103 laserPyssy.LaserCollision = LaserSadeOsuu; 86 104 erska.Weapon = laserPyssy; 105 AddCollisionHandler(erska, KeraaPottu); 87 106 88 107 erska.Weapon.Y -= 15; … … 93 112 { 94 113 PlatformCharacter ryssa = new PlatformCharacter(90, 120); 95 ryssa.Mass = 4 .0;114 ryssa.Mass = 4000.0; 96 115 ryssa.Image = LoadImage("ryssa"); 97 116 ryssa.Tag = "vihu"; 98 117 ryssa.X = 0; 99 118 ryssa.Y = Level.Bottom + 120; 100 ryssa.Weapon = new PlasmaCannon(80, 20); 119 PlasmaCannon plasmatykki = new PlasmaCannon(80, 20); 120 plasmatykki.PlasmaParticleCollision = PlasmapalloOsuu; 121 ryssa.Weapon = plasmatykki; 122 101 123 ryssa.Weapon.Y -= 22; 102 124 103 125 Timer ajastin = new Timer(); 104 ajastin.Interval = 9.0;126 ajastin.Interval = 1.5; 105 127 ajastin.Trigger += RyssaAmpuu; 106 128 ajastin.Tag = ryssa; … … 137 159 rajahdys.Position = Laser.Position; 138 160 Add(rajahdys); 139 rajahdys.Speed = 2000.0;161 rajahdys.Speed = 5000.0; 140 162 rajahdys.Force = 100000; 141 163 rajahdys.ShockwaveColor = Color.Black; … … 145 167 toinen.Destroy(); 146 168 } 147 169 if (toinen.Tag.ToString() == "boss") 170 { 171 toinen.Destroy(); 172 MessageDisplay.Add("KOSTIT PERHEESI PUOLESTA! PRO! VOITIT PELIN!"); 173 } 174 } 175 void PlasmapalloOsuu(PhysicsObject Plasma, PhysicsObject toinen) 176 { 177 if (toinen == erska) 178 { 179 Enupalkki.Value -= 25; 180 } 148 181 } 149 182 PlatformCharacter LuoPaakka() 150 183 { 151 184 PlatformCharacter paakka = new PlatformCharacter(90, 120); 152 paakka.Mass = 4 .0;185 paakka.Mass = 4000.0; 153 186 paakka.Image = LoadImage("paakka"); 187 paakka.Tag = "boss"; 154 188 paakka.X = 0; 155 189 paakka.Y = Level.Bottom + 120; 156 190 paakka.Weapon = new PlasmaCannon(80, 20); 157 paakka.Weapon.Y -= 22;191 paakka.Weapon.Y -= 10; 158 192 159 193 Timer ajastin = new Timer(); … … 174 208 } 175 209 } 210 PhysicsObject LuoPottu() 211 { 212 PhysicsObject pottu = new PhysicsObject(40.0, 40.0); 213 pottu.Mass = 10000000.0; 214 pottu.Image = LoadImage("pottu"); 215 pottu.Tag = "potion"; 216 217 return pottu; 218 } 219 void KeraaPottu(PhysicsObject erska, PhysicsObject kohde) 220 { 221 if (kohde.Tag.ToString() == "potion") 222 { 223 kohde.Destroy(); 224 Enupalkki.Value += 50; 225 } 226 } 227 void Gameover(double mittarinArvo) 228 { 229 erska.Destroy(); 230 MessageDisplay.Add("GAME OVER! N00B! PAINA ESC LOPETTAAKKSESI!GAME OVER! N00B! PAINA ESC LOPETTAAKKSESI!"); 231 Explosion rajahdys = new Explosion(40000000); 232 rajahdys.Position = erska.Position; 233 Add(rajahdys); 234 rajahdys.Speed = 100.0; 235 rajahdys.Force = 99999999999; 236 rajahdys.ShockwaveColor = Color.Red; 237 } 176 238 177 239 } -
2010/31/ossakama/Erskan kostoretki/kentta.txt
r1634 r1667 1 1 ================================================================== 2 2 = = 3 = 3 = pp = 4 4 = = 5 5 ===== x x x x x x x x = … … 8 8 = = == = 9 9 = = = = 10 = x= ==== == x= =11 = == = x== == = x=10 = x= ==== x = = = 11 = == = p == == = x= 12 12 = == ==== = = == 13 = x = 14 = == = 15 = = 16 = = == =17 ======= x = == =18 = == = 19 = = ==== = ==20 = x = 21 = == = 22 = x = =x=23 = ==== === =13 = x = = == = = 14 = == = = =x = 15 = = = == = 16 = = = = = 17 ======= x = = == = = 18 = == = = x = x= 19 = = = == p == = == 20 = x = = == = = 21 = == = = == = = 22 = x = = = = 23 = ==== = == = 24 24 = x = = == = = 25 = == = 26 = x = 27 = = = == =28 = = == == = x=29 === = = ==30 = = ===31 = x x 1 = P=32 = = 25 = == = = = = 26 = x = = x == = = 27 = = = = = = 28 = = = ================= = = 29 === = = 30 = = = = 31 = x x 1 = P = 32 = = = = 33 33 ==================================================================
Note: See TracChangeset
for help on using the changeset viewer.