- Timestamp:
- 2014-07-03 11:03:04 (9 years ago)
- Location:
- 2014/27/PekkaR
- Files:
-
- 48 added
- 1 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
2014/27/PekkaR/D2x_2d/D2x_2d/D2x_2d/D2x_2d.cs
r5297 r5334 43 43 public class Pelaaja : Shieldable 44 44 { 45 private IntMeter energy = new IntMeter( 100);45 private IntMeter energy = new IntMeter(200); 46 46 47 47 public Pelaaja(int w, int h) : base(w, h) … … 128 128 LuoKuuntelijat(); 129 129 NaytaValikko(); 130 131 Camera.ZoomToLevel();132 130 } 133 131 … … 145 143 Keyboard.Listen(Key.LeftAlt, ButtonState.Released, delegate { altpressed = false; }, null); 146 144 147 Keyboard.Listen(Key.LeftControl, ButtonState.Pressed, delegate { ctrlpressed = true; Timer j = new Timer(); j.Interval = 0.5; j.Timeout += delegate { if (ctrlpressed) { Ammus a = pelaaja.Ammu(); if (a != null) Add(a); } }; j.Start(); }, null);145 Keyboard.Listen(Key.LeftControl, ButtonState.Pressed, delegate { ctrlpressed = true; Timer j = new Timer(); j.Interval = 0.5; j.Timeout += delegate { if (ctrlpressed) { Ammus a = pelaaja.Ammu(); if (a != null) Add(a); } }; j.Start(); }, null); 148 146 Keyboard.Listen(Key.LeftControl, ButtonState.Released, delegate { ctrlpressed = false; }, null); 149 147 … … 163 161 { 164 162 InputWindow kysymysIkkuna = new InputWindow("Enter the level number"); 165 kysymysIkkuna.TextEntered += ProcessInput;163 kysymysIkkuna.TextEntered += LuoKentta; 166 164 Add(kysymysIkkuna); 167 165 } 168 166 169 private void ProcessInput(InputWindow ikkuna)167 private void LuoKentta(InputWindow ikkuna) 170 168 { 171 169 try … … 192 190 Timer ajastin = new Timer(); 193 191 ajastin.Interval = 1.5; 194 ajastin.Timeout += delegate { if(!(pelaaja.IsDestroyed || vih.IsDestroyed) ) Add(vih.Ammu(pelaaja)); };192 ajastin.Timeout += delegate { if(!(pelaaja.IsDestroyed || vih.IsDestroyed) && RandomGen.NextBool()) Add(vih.Ammu(pelaaja)); }; 195 193 ajastin.Start(); 196 194 AddCollisionHandler<Vihollinen, Ammus>(vih, "ammusToV", Osuma); … … 202 200 PhysicsObject seina = PhysicsObject.CreateStaticObject(leveys, korkeus); 203 201 seina.Position = paikka; 202 seina.Tag = "seina"; 203 AddCollisionHandler<PhysicsObject, Ammus>(seina, KasitteleAmmus); 204 204 Add(seina); 205 205 } … … 209 209 PhysicsObject seina = PhysicsObject.CreateStaticObject(leveys, korkeus); 210 210 seina.Position = paikka; 211 seina.Tag = "seina"; 212 AddCollisionHandler<PhysicsObject, Ammus>(seina, KasitteleAmmus); 211 213 Add(seina); 214 } 215 216 private void KasitteleAmmus(PhysicsObject seina, Ammus kohde) 217 { 218 kohde.Destroy(); 212 219 } 213 220 … … 236 243 AddCollisionHandler<Pelaaja, Ammus>(pelaaja, "ammusToP", Osuma); 237 244 Add(pelaaja); 245 Camera.Follow(pelaaja); 238 246 playeradded = true; 239 247 240 248 } 241 249 242 private void Osuma( Pelaajapelaaja, Ammus kohde)250 private void Osuma(Shieldable pelaaja, Ammus kohde) 243 251 { 244 252 pelaaja.setShield(pelaaja.getShield() - kohde.getDeal()); 245 253 kohde.Destroy(); 246 254 } 247 private void Osuma(Vihollinen vih, Ammus kohde)248 {249 vih.setShield(vih.getShield() - kohde.getDeal());250 kohde.Destroy();251 }252 255 } -
2014/27/PekkaR/D2x_2d/D2x_2d/D2x_2d/obj/x86/Debug/ContentPipeline-{D8F805CA-FFFC-4C76-8CBF-A2C6D544F284}.xml
r5297 r5334 18 18 <Options>None</Options> 19 19 <Output>C:\MyTemp\PekkaR\D2x_2d\D2x_2d\D2x_2d\bin\x86\Debug\Content\2.xnb</Output> 20 <Time>2014-07-0 2T14:56:14.1428428+03:00</Time>20 <Time>2014-07-03T10:07:44.1509966+03:00</Time> 21 21 </Item> 22 22 <BuildSuccessful>true</BuildSuccessful> -
2014/27/PekkaR/D2x_2d/D2x_2d/D2x_2dContent/2.txt
r5297 r5334 1 ----------- 2 -P - 3 --------- - 4 - - 5 - - 6 -V- 7 --- 1 ------------- 2 -P V- 3 --------- --- 4 - - 5 - - 6 -V-- 7 - V- 8 -- - 9 -V - 10 -------- ----- 11 - V -V - 12 - ----- - 13 - -- 14 - V- 15 - - 16 - V - 17 -----------------
Note: See TracChangeset
for help on using the changeset viewer.