- Timestamp:
- 2011-06-08 22:01:23 (10 years ago)
- Location:
- 2011/23/vihakuli/Runner/Runner
- Files:
-
- 3 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2011/23/vihakuli/Runner/Runner/Runner/Peli.cs
r1777 r1788 11 11 public class Peli : PhysicsGame 12 12 { 13 13 14 #region attribuutit 14 15 PlatformCharacter ukko; … … 18 19 Image vihollisenKuva = LoadImage("vihu"); 19 20 Image ammusLoota = LoadImage("ammusLoota"); 21 Image speedLoota = LoadImage("speedPalikka"); 22 Image jumpLoota = LoadImage("jumpPalikka"); 20 23 double liiku = 400; 21 24 int pisteet = 0; … … 60 63 aikaLaskuri.Trigger += new Timer.TriggerHandler(aikaLaskuri_Trigger); 61 64 Valikko(); 62 63 65 } 64 66 … … 141 143 napit(); 142 144 teksti.X = Screen.Right - 100; 143 teksti.Y = Screen.Top - 50;144 teksti.TextColor = Color. Green;145 teksti.Y = Screen.Top - 30; 146 teksti.TextColor = Color.Black; 145 147 Add(teksti); 146 148 … … 183 185 184 186 void UkkoTormasi(PhysicsObject tormaaja, PhysicsObject kohde) 185 { if (kohde.Color == Color.Red) 187 { 188 if (kohde.Image == jumpLoota) 186 189 { 187 190 KorkeaHyppyAika.Reset(); … … 191 194 } 192 195 193 if (kohde. Color == Color.White)196 if (kohde.Image == speedLoota) 194 197 { 195 198 NopeaJuoksuAika.Reset(); … … 248 251 ruudut.SetTileMethod('a', LuoAmmukset); 249 252 ruudut.Execute(ruudunLeveys, ruudunKorkeus); 253 //Level.Background.CreateGradient(new Color(100, 0, 100), new Color(49, 740, 74)); 250 254 Gravity = new Vector(0.0, -800.0); 251 255 teksti.Text = pisteet.ToString() + "/" + MaxPisteet.ToString(); … … 326 330 spawn = PhysicsObject.CreateStaticObject(50.0, 50.0); 327 331 spawn.Position = paikka; 328 spawn.Color = Color. Green;332 spawn.Color = Color.Black; 329 333 Add(spawn); 330 334 } … … 344 348 hyppyPalikka.Position = paikka; 345 349 hyppyPalikka.Shape = Shape.Rectangle; 346 hyppyPalikka. Color = Color.Red;350 hyppyPalikka.Image = jumpLoota; 347 351 Add(hyppyPalikka); 348 352 } … … 353 357 nopeusPalikka.Position = paikka; 354 358 nopeusPalikka.Shape = Shape.Rectangle; 355 nopeusPalikka. Color = Color.White;359 nopeusPalikka.Image = speedLoota; 356 360 Add(nopeusPalikka); 357 361 } … … 405 409 Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppy, "Ukko Hyppää"); 406 410 Keyboard.Listen(Key.Escape, ButtonState.Pressed, peliPaattyi, "Poistu","havio"); 407 Keyboard.Listen(Key.Space, ButtonState.Released, Ammu, "Pelaaja ampuuu aseellaan"); 411 Keyboard.Listen(Key.Space, ButtonState.Pressed, Ammu, "Pelaaja ampuuu aseellaan"); 412 413 ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, LiikutaUkkoa, "Pelaaja liikkuu vasemmalle", -liiku, "vasen"); 414 ControllerOne.Listen(Button.DPadRight, ButtonState.Down, LiikutaUkkoa, "Pelaaja liikkuu oikealle", liiku, "oikea"); 415 ControllerOne.Listen(Button.B, ButtonState.Pressed, Hyppy, "Ukko Hyppää"); 416 ControllerOne.Listen(Button.RightStick, ButtonState.Pressed, Ammu, "Pelaaja ampuu aseellaan"); 417 ControllerOne.Listen(Button.Start, ButtonState.Pressed, peliPaattyi, "Poistu", "havio"); 408 418 } 409 419 -
2011/23/vihakuli/Runner/Runner/RunnerContent/RunnerContent.contentproj
r1777 r1788 77 77 </Compile> 78 78 </ItemGroup> 79 <ItemGroup> 80 <Compile Include="jumpPalikka.png"> 81 <Name>jumpPalikka</Name> 82 <Importer>TextureImporter</Importer> 83 <Processor>TextureProcessor</Processor> 84 </Compile> 85 <Compile Include="speedPalikka.png"> 86 <Name>speedPalikka</Name> 87 <Importer>TextureImporter</Importer> 88 <Processor>TextureProcessor</Processor> 89 </Compile> 90 </ItemGroup> 79 91 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 80 92 <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Note: See TracChangeset
for help on using the changeset viewer.