- Timestamp:
- 2013-07-25 10:05:33 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2013/30/VilleF/Lentokone/Lentokone/Lentokone/Lentokone.cs
r4631 r4650 21 21 PhysicsObject pelaaja; 22 22 PhysicsObject pommi; 23 PhysicsObject ukkeli1; 23 //PhysicsObject ukkeli1; 24 25 Timer komboLaskurinAjastin; 26 24 27 IntMeter pisteLaskuri; 25 28 IntMeter KomboLaskuri; 26 29 27 30 … … 40 43 Gravity = new Vector(0.0, -500); 41 44 //MediaPl-ayer.Play(" 42 45 LuoKomboLaskuri(); 43 46 LuoPelaaja(); 44 47 LuoKentta(); … … 81 84 Add(pisteNaytto); 82 85 } 86 void LuoKomboLaskuri() 87 { 88 KomboLaskuri = new IntMeter(0); 89 90 Label komboNaytto = new Label(); 91 komboNaytto.X = Screen.Right -200; 92 komboNaytto.Y = Screen.Top -200 ; 93 komboNaytto.TextColor = Color.Green; 94 //pisteNaytto.Color = Color.White; 95 komboNaytto.IntFormatString = "COMBO: {0:D1}"; 96 komboNaytto.BindTo(KomboLaskuri); 97 Add(komboNaytto); 98 99 komboLaskurinAjastin = new Timer(); 100 komboLaskurinAjastin.Interval = 5; 101 komboLaskurinAjastin.Timeout += delegate { KomboLaskuri.Reset(); }; 102 komboLaskurinAjastin.Start(); 103 104 KomboLaskuri.Changed += delegate { Kombot(); }; 105 106 107 108 109 } 110 void Kombot() 111 { 112 if (KomboLaskuri.Value == 3) { Label tekstikentta = new Label("kombo"); 113 Add(tekstikentta); 114 // PommiOsuu(100); 115 116 } 117 118 if (KomboLaskuri.Value > 6) { } 119 120 121 } 83 122 84 123 void LisaaVihollinen() … … 141 180 void PommiOsuu(PhysicsObject pommi, PhysicsObject kohde) 142 181 { 182 //Int k = 0; 183 143 184 if(kohde.Tag.Equals("vihollinen")) 144 185 { 145 186 kohde.Destroy(); 146 187 pisteLaskuri.Value += 1; 147 188 KomboLaskuri.Value += 1; 189 komboLaskurinAjastin.Reset(); 190 148 191 } 149 Explosion e = new Explosion(60); 150 e.Position = pommi.Position; 151 pommi.Destroy(); 152 Add(e); 153 e.ShockwaveReachesObject += delegate(IPhysicsObject rKohde, Vector v) { if(rKohde.Tag.Equals("vihollinen")) rKohde.Destroy(); }; 154 //pisteet++; 155 192 if (KomboLaskuri > 3) 193 { 194 195 Explosion e = new Explosion(6000); 196 e.Position = pommi.Position; 197 pommi.Destroy(); 198 Add(e); 199 e.ShockwaveReachesObject += delegate(IPhysicsObject rKohde, Vector v) { if (rKohde.Tag.Equals("vihollinen")) rKohde.Destroy(); }; 200 } 201 else 202 { 203 Explosion e = new Explosion(60); 204 e.Position = pommi.Position; 205 pommi.Destroy(); 206 Add(e); 207 e.ShockwaveReachesObject += delegate(IPhysicsObject rKohde, Vector v) { if (rKohde.Tag.Equals("vihollinen")) rKohde.Destroy(); }; 208 //pisteet++;} 209 } 210 211 } 212 void Rajahdys() 213 { 214 156 215 } 157 216 … … 216 275 void LuoPelaaja() 217 276 { 218 pelaaja = new PhysicsObject(1 50.0, 190.0);277 pelaaja = new PhysicsObject(100.0, 120.0); 219 278 pelaaja.Shape = Shape.FromImage(havusaurus); 220 279 pelaaja.Image = havusaurus;
Note: See TracChangeset
for help on using the changeset viewer.