- Timestamp:
- 2011-07-01 10:35:14 (12 years ago)
- Location:
- 2011/26/RistoR/ding/ding
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
2011/26/RistoR/ding/ding/ding/Peli.cs
r2377 r2398 18 18 public class Peli : PhysicsGame 19 19 { 20 ScoreList topLista = new ScoreList(10, false, 0); 21 20 22 const double nopeus = 250; 21 23 const double hyppyNopeus = 1000; … … 23 25 PlatformCharacter pelaaja1; 24 26 List<Label> valikonKohdat; 25 27 Image maaliimage = LoadImage("maaliimage"); 26 28 Image paavalikko = LoadImage("paavalikko"); 27 29 Image pelaajanKuva = LoadImage("pelaaja"); … … 47 49 Camera.StayInLevel = true; 48 50 } 51 49 52 void luoKentta() 50 53 { … … 58 61 kentta.Insert(RUUDUN_KOKO, RUUDUN_KOKO); 59 62 Level.CreateBorders(); 60 Level.Background.CreateStars(500); 63 Level.Background.CreateGradient(Color.Gray, Color.DarkRed); 64 61 65 } 62 66 PhysicsObject lisaaTaso() … … 129 133 Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, "Näytä ohjeet"); 130 134 Keyboard.Listen(Key.Escape, ButtonState.Pressed, valikko, "Palaa valikkoon"); 135 Keyboard.Listen(Key.R, ButtonState.Pressed, AloitaPeli, null); 136 131 137 132 138 Keyboard.Listen(Key.A, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, -nopeus); 133 139 Keyboard.Listen(Key.D, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 134 140 Keyboard.Listen(Key.Space, ButtonState.Down, hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 135 Keyboard.Listen(Key. Down, ButtonState.Down, AmmuAseella, "Ammu");141 Keyboard.Listen(Key.G, ButtonState.Down, AmmuAseella, "Ammu"); 136 142 Keyboard.Listen(Key.W, ButtonState.Down, kaannaasettaylos, "Käännä asetta ylös"); 137 143 Keyboard.Listen(Key.S, ButtonState.Down, kaannaasettaalas, "Käännä asetta alas"); 138 Keyboard.Listen(Key.Up, ButtonState.Pressed, HeitaKranaatti, "Heitä kranaatti"); 144 Keyboard.Listen(Key.Up, ButtonState.Pressed, painoylos, "???"); 145 Keyboard.Listen(Key.Down, ButtonState.Pressed, painoalas, "???"); 139 146 ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 140 147 … … 155 162 if (kohde.Tag.ToString() == "tahti") 156 163 { 157 maaliAani.Play();158 164 pistelaskuri.Value += 1; 159 165 kohde.Destroy(); … … 255 261 kranaatti.Y = pelaaja1.Y + 10; 256 262 Add(kranaatti); 257 Vector heittoVoima = Vector.FromLengthAndAngle( 4000, pelaaja1.Weapon.Angle);263 Vector heittoVoima = Vector.FromLengthAndAngle(6000, pelaaja1.Weapon.Angle); 258 264 kranaatti.Hit(heittoVoima); 259 265 } … … 292 298 { 293 299 ClearAll(); 294 Level.Background.Image ("paavalikko");300 Level.Background.Image = LoadImage("paavalikko"); 295 301 valikonKohdat = new List<Label>(); 296 297 302 Label kohta1 = new Label("Aloita uusi peli"); 298 303 kohta1.Position = new Vector(0, 40); … … 347 352 void Voitto() 348 353 { 354 Level.Background.Image = LoadImage("maaliimage"); 349 355 Label nappi = new Label("Aloita uusi peli"); 350 356 nappi.Position = new Vector(0, 40); … … 367 373 368 374 } 375 void painoylos() 376 { 377 Gravity = new Vector(0.0, 900.0); 378 } 379 void painoalas() 380 { 381 Gravity = new Vector(0.0, -900.0); 382 } 383 369 384 } -
2011/26/RistoR/ding/ding/ding/kentta1.txt
r2377 r2398 27 27 #################################################################################################################################### * # ######################### ** # 28 28 #################################################################################################################################### * ### ############################## # 29 #################################################################################################################################### * ##### Z * ############################### # * ############29 #################################################################################################################################### * ##### Z * ############################### * ########### # 30 30 #################################################################################################################################### * D######## * ########################################## ###### * #### # 31 #################################################################################################################################### * ############# Z ############################################################## # * #### Z M#31 #################################################################################################################################### * ############# Z ############################################################## * #### Z M # 32 32 #################################################################################################################################### * ################# ################################################################## ######## *** ########################### 33 33 ###################################################################################################################################### Z ##################### ######################################################################## ################### # -
2011/26/RistoR/ding/ding/dingContent/dingContent.contentproj
r2377 r2398 108 108 </Compile> 109 109 </ItemGroup> 110 <ItemGroup> 111 <Compile Include="maaliimage.png"> 112 <Name>maaliimage</Name> 113 <Importer>TextureImporter</Importer> 114 <Processor>TextureProcessor</Processor> 115 </Compile> 116 </ItemGroup> 110 117 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 111 118 <!-- 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.