Changeset 7901
- Timestamp:
- 2016-07-06 14:57:34 (6 years ago)
- Location:
- 2016/27/JamiR/Tasohyppelypeli1
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
2016/27/JamiR/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1.cs
r7863 r7901 12 12 const double hyppyNopeus = 750; 13 13 const int RUUDUN_KOKO = 40; 14 14 15 15 16 PlatformCharacter pelaaja1; … … 19 20 Animation kävelyanimaatio; 20 21 Animation hyppyanimaatio; 22 23 24 25 21 26 22 27 SoundEffect maaliAani = LoadSoundEffect("maali"); … … 26 31 kävelyanimaatio = LoadAnimation("animaatio"); 27 32 hyppyanimaatio = LoadAnimation("hyppyanimaatio"); 28 Gravity = new Vector(0 , -1000);33 Gravity = new Vector(0.0, -1000.0); 29 34 30 35 31 36 LuoKentta(); 32 37 LisaaNappaimet(); … … 44 49 kentta.SetTileMethod('*', LisaaTahti); 45 50 kentta.SetTileMethod('N', LisaaPelaaja); 51 kentta.SetTileMethod('K', LisaaKissa); 46 52 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 47 53 Level.CreateBorders(); 48 Level.Background.CreateGradient(Color. White, Color.SkyBlue);54 Level.Background.CreateGradient(Color.Red, Color.SkyBlue); 49 55 } 50 56 … … 77 83 AddCollisionHandler(pelaaja1, "tahti", TormaaTahteen); 78 84 Add(pelaaja1); 85 86 87 { 88 89 } 90 } 91 92 void LisaaKissa(Vector paikka, double leveys, double korkeus) 93 { 94 PhysicsObject kissa = new PhysicsObject(40, 20); 95 kissa.Shape = Shape.Rectangle; 96 Add(kissa); 97 kissa.Tag = "vihu"; 98 kissa.Position = paikka; 99 PlatformWandererBrain tasoAivot = new PlatformWandererBrain(); 100 tasoAivot.Speed = 100; 101 102 kissa.Brain = tasoAivot; 79 103 } 80 104 … … 84 108 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 85 109 86 Keyboard.Listen(Key. Left, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, -nopeus);87 Keyboard.Listen(Key. Right, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus);88 Keyboard.Listen(Key. Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus);110 Keyboard.Listen(Key.A, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, -nopeus); 111 Keyboard.Listen(Key.D, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 112 Keyboard.Listen(Key.W, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 89 113 90 114 ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); … … 94 118 ControllerOne.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 95 119 120 96 121 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 97 122 } 123 98 124 99 125 void Liikuta(PlatformCharacter hahmo, double nopeus) … … 113 139 tahti.Destroy(); 114 140 } 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 115 173 } -
2016/27/JamiR/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml
r7863 r7901 36 36 <Options>None</Options> 37 37 <Output>C:\MyTemp\JamiR\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\kentta1.xnb</Output> 38 <Time>2016-07-06T1 1:20:46.788836+03:00</Time>38 <Time>2016-07-06T14:48:40.9679848+03:00</Time> 39 39 </Item> 40 40 <Item> … … 45 45 <Options>None</Options> 46 46 <Output>C:\MyTemp\JamiR\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\animaatio.xnb</Output> 47 <Time>2016-07-06T1 1:29:40.9499695+03:00</Time>47 <Time>2016-07-06T13:29:52.8702223+03:00</Time> 48 48 <Request>C:\MyTemp\JamiR\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\animaatio\Untitled_0.xnb</Request> 49 49 <Request>C:\MyTemp\JamiR\Tasohyppelypeli1\Tasohyppelypeli1\Tasohyppelypeli1\bin\x86\Debug\Content\animaatio\Untitled02_0.xnb</Request> -
2016/27/JamiR/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1Content/animaatio.anim
r7863 r7901 1 FPS = 101 FPS = 7 -
2016/27/JamiR/Tasohyppelypeli1/Tasohyppelypeli1/Tasohyppelypeli1Content/kentta1.txt
r7863 r7901 14 14 15 15 16 17 ## 16 18 19 ## 20 21 22 ## # # ########## 17 23 18 19 20 ## 21 22 23 24 ## 25 24 ## 25 26 26 27 28 ##29 27 ### 28 29 ## 30 30 31 N31 K N 32 32 ######################
Note: See TracChangeset
for help on using the changeset viewer.