Changeset 6934
- Timestamp:
- 2015-07-22 14:56:56 (8 years ago)
- Location:
- 2015/30/TomiM/Tasohyppelypeli
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/30/TomiM/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli.cs
r6906 r6934 24 24 25 25 26 PhysicsObject vasenReuna; 27 PhysicsObject oikeaReuna; 26 28 27 29 28 … … 36 35 37 36 LuoPistelaskuri(); 38 37 38 RandomMoverBrain satunnaisAivot = new RandomMoverBrain(100); 39 satunnaisAivot.ChangeMovementSeconds = 1; 40 vihollinen.Brain = satunnaisAivot; 41 satunnaisAivot.WanderRadius = 20; 42 43 39 44 40 45 Camera.Follow(pelaaja1); … … 42 47 Camera.StayInLevel = true; 43 48 44 49 45 50 } 46 51 … … 48 53 { 49 54 50 PhysicsObject pelaaja1 = new PhysicsObject(40, 40, Shape.Rectangle); 51 Add(pelaaja1); 52 53 vasenReuna = Level.CreateLeftBorder(); 54 oikeaReuna = Level.CreateRightBorder(); 55 Level.AmbientLight = 0.3; 56 57 Light valo = new Light(); 58 valo.Intensity = 0.8; 59 valo.Distance = 1200; 60 valo.Position = valo.Position; 61 Add(valo); 62 63 Smoke savu = new Smoke(); 64 savu.Position = valo.Position; 65 Add(savu); 66 Wind = new Vector( 0, 0); 67 55 68 Level.CreateBottomBorder(); 56 69 Level.CreateTopBorder(); … … 64 77 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 65 78 Level.CreateBorders(); 66 Level.Background.CreateGradient(Color. White, Color.SkyBlue);79 Level.Background.CreateGradient(Color.Blue, Color.SkyBlue); 67 80 } 68 81 void PelaajaTormasi(PhysicsObject vihollinen, PhysicsObject pelaaja1) 69 82 { 70 if ((pelaaja1 == vasenReuna) || (pelaaja1 == oikeaReuna)) 83 71 84 { 72 AloitaAlusta(); 85 73 86 } 74 87 … … 104 117 AddCollisionHandler(pelaaja1, "pahis", PelaajaOsuu); 105 118 Add(pelaaja1); 106 119 pelaaja1.CanRotate = false; 120 121 pelaaja1.Weapon = new PlasmaCannon(20, 5); 122 pelaaja1.Weapon.Ammo.Value = 1000; 123 124 125 126 107 127 108 128 } … … 124 144 125 145 146 147 126 148 } 127 149 … … 135 157 Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 136 158 137 159 Keyboard.Listen(Key.Space, ButtonState.Down, AmmuAseella, "Ammu", pelaaja1); 138 160 139 161 140 162 ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 141 163 142 164 Keyboard.Listen(Key.P, ButtonState.Pressed, Pause, "Pysäyttää pelin"); 143 165 144 166 ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, Liikuta, "Pelaaja liikkuu vasemmalle", pelaaja1, -nopeus); … … 167 189 void PelaajaOsuu(PhysicsObject hahmo, PhysicsObject vihollinen) 168 190 { 191 169 192 pelaaja1.Destroy(); 193 ClearAll(); 194 LuoKentta(); 195 LisaaNappaimet(); 196 LuoPistelaskuri(); 197 198 Camera.Follow(pelaaja1); 199 200 201 Gravity = new Vector(0, -1000); 202 203 204 170 205 171 206 … … 192 227 pisteNaytto.Color = Color.White; 193 228 229 IntMeter keratytEsineet = new IntMeter(0); 230 231 232 194 233 pisteNaytto.BindTo(pisteLaskuri); 195 234 Add(pisteNaytto); 196 235 197 236 pisteNaytto.IntFormatString = "Kolikoita: {0:D1}"; 198 199 } 200 201 } 202 203 204 205 237 238 } 239 void AmmuAseella(PlatformCharacter pelaaja1) 240 { 241 PhysicsObject ammus = pelaaja1.Weapon.Shoot(); 242 243 } 244 } 245 246 247 206 248 207 249 -
2015/30/TomiM/Tasohyppelypeli/Tasohyppelypeli/TasohyppelypeliContent/kentta1.txt
r6906 r6934 1 2 3 4 5 6 7 8 9 10 11 V N # 12 ## ### # ##13 # * # * V # * ## V * # 14 ############################## 1 2 3 4 5 6 7 V * 8 * ########## V 9 * V#################### 10 # ##### ***** 11 ## V N ## #V 12 ## ## ### # # # ########**** # 13 * # * # * V # * ## * # *################# V # V * 14 ################################################################# -
2015/30/TomiM/Tasohyppelypeli/Tasohyppelypeli/TasohyppelypeliContent/obj/x86/Debug/ContentPipeline.xml
r6906 r6934 36 36 <Options>None</Options> 37 37 <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\kentta1.xnb</Output> 38 <Time>2015-07-22T1 1:30:17.6085364+03:00</Time>38 <Time>2015-07-22T14:38:39.4380144+03:00</Time> 39 39 </Item> 40 40 <Item> … … 54 54 <Options>None</Options> 55 55 <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\tyyppi3.xnb</Output> 56 <Time>2015-07-22T 09:54:57.5382364+03:00</Time>56 <Time>2015-07-22T12:33:22.6179364+03:00</Time> 57 57 </Item> 58 58 <Item> … … 63 63 <Options>None</Options> 64 64 <Output>C:\MyTemp\TomiM\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\vihollinen.xnb</Output> 65 <Time>2015-07-22T1 0:02:33.1974364+03:00</Time>65 <Time>2015-07-22T12:28:58.4467364+03:00</Time> 66 66 </Item> 67 67 <BuildSuccessful>true</BuildSuccessful>
Note: See TracChangeset
for help on using the changeset viewer.