- Timestamp:
- 2010-07-28 14:55:04 (13 years ago)
- Location:
- 2010/27/Aajokahe
- Files:
-
- 4 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/27/Aajokahe/Nurinams adventure/Content/Content.contentproj
r1332 r1377 1 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">1 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> 2 2 <PropertyGroup> 3 3 <ProjectGuid>910df4a7-3247-4e90-9ff5-9033645b4ebf</ProjectGuid> … … 38 38 <Processor>SoundEffectProcessor</Processor> 39 39 </Compile> 40 <Compile Include="Nurinam ninja.png"> 41 <Name>Nurinam ninja</Name> 42 <Importer>TextureImporter</Importer> 43 <Processor>TextureProcessor</Processor> 44 </Compile> 45 <Compile Include="Warrior.png"> 46 <Name>Warrior</Name> 47 <Importer>TextureImporter</Importer> 48 <Processor>TextureProcessor</Processor> 49 </Compile> 40 50 </ItemGroup> 41 51 <ItemGroup> -
2010/27/Aajokahe/Nurinams adventure/Peli.cs
r1359 r1377 9 9 const double nopeus = 200; 10 10 const double hyppyVoima = 4000; 11 DoubleMeter voimaMittari; 12 13 IntMeter pisteLaskuri; 14 IntMeter pisteLaskuri2; 11 15 12 16 PlatformCharacter pelaaja1; … … 22 26 lisaaNappaimet(); 23 27 vihollinen=LuoVihollinen(); 28 LuoLaskuri(); 29 LuoHPBar(); 24 30 25 31 Camera.Follow(pelaaja1); 26 32 Camera.ZoomFactor = 2.0; 27 33 Camera.StayInLevel = true; 34 MessageDisplay.Add("sotalordin miehet ovat löytäneet sinun piilopaikkasi ja rynnivät sitä päin kiväärit tanassa. Sinun täytyy puolustaa piilopaikkaasi."); 35 28 36 } 29 37 … … 46 54 taso.Y = y; 47 55 Add(taso); 56 taso.Tag = "talo"; 57 48 58 } 49 59 … … 52 62 pelaaja1 = new PlatformCharacter (40, 40); 53 63 pelaaja1.Mass = 4.0; 54 pelaaja1.Image = LoadImage("N orsu");64 pelaaja1.Image = LoadImage("Nurinam ninja"); 55 65 pelaaja1.X = -400; 56 66 pelaaja1.Y = -10; … … 93 103 PlatformCharacter vihollinen = new PlatformCharacter(40, 40); 94 104 vihollinen.Shape = Shapes.Circle; 105 vihollinen.Image = LoadImage("Warrior"); 95 106 vihollinen.Mass = 10.0; 96 107 Add(vihollinen); … … 98 109 vihollinen. X= 300; 99 110 vihollinen.Tag = "vihollinen"; 100 vihollinen.Weapon = new AssaultRifle(70, 20); 111 AddCollisionHandler(vihollinen, KasitteleVihollisenTormays); 112 113 AssaultRifle pyssy = new AssaultRifle (40, 5); 114 vihollinen.Weapon = pyssy ; 115 116 101 117 102 118 return vihollinen; … … 105 121 void Ammu() 106 122 { 107 vihollinen.Weapon.Shoot(); 123 PhysicsObject ammus = vihollinen.Weapon.Shoot(); 124 if (ammus != null) 125 { 126 ammus.Tag = "vihollisammus"; 127 } 128 108 129 } 109 130 … … 123 144 { 124 145 kohde.Destroy(); 125 } 126 } 127 128 129 130 146 pisteLaskuri.Value++; 147 pisteLaskuri.Value += 1; 148 pisteLaskuri.Value = pisteLaskuri.Value + 1; 149 } 150 if (kohde.Tag.ToString() == "vihollisammus") 151 { 152 pelaaja1.Destroy(); 153 154 } 155 } 156 157 158 void LuoLaskuri() 159 { 160 pisteLaskuri = new IntMeter(0); 161 162 Label pisteNaytto = new Label(); 163 pisteNaytto.X = Screen.Left + 100; 164 pisteNaytto.Y = Screen.Top - 100; 165 pisteNaytto.TextColor = Color.Black; 166 167 pisteNaytto.BindTo(pisteLaskuri); 168 Add(pisteNaytto); 169 170 Label pisteTeksti = new Label("Pisteet: "); 171 pisteTeksti.X = Screen.Left + 50; 172 pisteTeksti.Y = Screen.Top - 100; 173 pisteTeksti.TextColor = Color.Black; 174 Add(pisteTeksti); 175 176 177 178 } 179 180 void LuoHPBar() 181 { 182 pisteLaskuri2 = new IntMeter(0); 183 184 Label pisteNaytto2 = new Label(); 185 pisteNaytto2.X = Screen.Left +250; 186 pisteNaytto2.Y = Screen.Top -100; 187 pisteNaytto2.TextColor = Color.Black; 188 189 pisteNaytto2.BindTo(pisteLaskuri2); 190 Add(pisteNaytto2); 191 192 Label pisteTeksti2 = new Label("Rakennus: "); 193 pisteTeksti2.X = Screen.Left + 190; 194 pisteTeksti2.Y = Screen.Top -100; 195 pisteTeksti2.TextColor = Color.Black; 196 Add(pisteTeksti2); 197 198 199 200 voimaMittari = new DoubleMeter(60); 201 voimaMittari.MaxValue = 60; 202 BarGauge voimaPalkki = new BarGauge(10, 150); 203 voimaPalkki.BindTo(voimaMittari); 204 Add(voimaPalkki); 205 voimaPalkki.X = (0.85 * Screen.LeftSafe); 206 voimaPalkki.Y = (0.05 * Screen.Height); 207 voimaPalkki.BarColor = Color.Aqua; 208 voimaPalkki.BorderColor = Color.Black; 209 voimaPalkki.Angle = Angle.Degrees(90); 210 voimaMittari.LowerLimit += new Meter<double>.OnLimitHandler(peliLoppuu); 211 212 213 } 214 215 void peliLoppuu(double value) 216 { 217 Exit(); 218 } 219 220 void KasitteleVihollisenTormays(PhysicsObject Vihollinen, PhysicsObject kohde) 221 { 222 if (kohde.Tag.ToString() == "talo") 223 { 224 Vihollinen.X = Vihollinen.X + 50; 225 voimaMittari.Value--; 226 } 227 } 131 228 132 229 }
Note: See TracChangeset
for help on using the changeset viewer.