Changeset 2564
- Timestamp:
- 2011-08-04 15:01:06 (12 years ago)
- Location:
- 2011/31/DanH
- Files:
-
- 12 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
2011/31/DanH/Dragonfighter/Dragonfighter/Dragonfighter/Dragonfighter.csproj
r2535 r2564 116 116 </ItemGroup> 117 117 <ItemGroup> 118 <Content Include="Fireball2.png" /> 118 119 <Content Include="Game.ico" /> 119 120 <Content Include="GameThumbnail.png" /> … … 126 127 <Content Include="Stance.png" /> 127 128 <Content Include="StanceGood.png" /> 129 <Content Include="Thunderbolt.png" /> 130 <Content Include="Thunderbolt3.png" /> 128 131 </ItemGroup> 129 132 <ItemGroup> -
2011/31/DanH/Dragonfighter/Dragonfighter/Dragonfighter/Peli.cs
r2535 r2564 12 12 { 13 13 14 15 16 17 18 19 const double nopeus = 200; 20 const double hyppyNopeus = 1000; 21 const int RUUDUN_KOKO = 40; 14 15 Image olionKuva = LoadImage("Thunderbolt3"); 16 Image Fireball = LoadImage("Fireball2"); 17 18 19 20 21 const double nopeus = 450; 22 const double hyppyNopeus = 1500; 23 const int RUUDUN_KOKO = 50; 22 24 23 25 PlatformCharacter pelaaja1; 24 26 PlatformCharacter pelaaja2; 25 27 26 Image Dragon = LoadImage(" StanceGood");28 Image Dragon = LoadImage("DragonStance"); 27 29 Image Hunter = LoadImage("Hunter"); 28 30 29 Image paikallaanVasemmalle = LoadImage(" StanceGood");31 Image paikallaanVasemmalle = LoadImage("DragonStance"); 30 32 Image paikallaanOikealle; 31 33 … … 49 51 50 52 51 List<Label> valikonKohdat;52 53 53 54 … … 89 90 90 91 91 Gravity = new Vector(0, - 1000);92 Gravity = new Vector(0, -900); 92 93 93 94 luoKentta(); … … 96 97 IsFullScreen = true; 97 98 98 Camera.ZoomFactor = 1.2;99 99 Camera.ZoomToLevel(); 100 100 … … 132 132 PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 133 133 taso.Position = paikka; 134 taso.Color = Color. Green;134 taso.Color = Color.White; 135 135 Add(taso); 136 136 } … … 143 143 pelaaja1 = new PlatformCharacter (leveys, korkeus); 144 144 pelaaja1.Position = paikka; 145 pelaaja1.Mass = 4.0;145 pelaaja1.Mass = 1.0; 146 146 pelaaja1.Image = Dragon; 147 147 … … 150 150 151 151 pelaaja1.CollisionIgnoreGroup = 1; 152 153 pelaaja1.Weapon = new PlasmaCannon(20, 5); 154 155 pelaaja1.Weapon.ProjectileCollision = AmmusOsui; 156 152 157 153 158 … … 164 169 Add(pelaaja1ElamaPalkki); 165 170 166 171 167 172 168 173 Add(pelaaja1); … … 181 186 pelaaja2.CollisionIgnoreGroup = 1; 182 187 188 pelaaja2.Weapon = new PlasmaCannon(20, 5); 189 190 pelaaja2.Weapon.ProjectileCollision = AmmusOsui2; 183 191 184 192 pelaaja2.LeftIdleAnimation = new Animation(paikallaanVasemmalle2); … … 190 198 191 199 192 193 200 201 194 202 195 203 … … 216 224 Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, "Poistu pelistä"); 217 225 218 Keyboard.Listen(Key.Left, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, - nopeus);226 Keyboard.Listen(Key.Left, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, - nopeus); 219 227 Keyboard.Listen(Key.Right, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 220 228 Keyboard.Listen(Key.Up, ButtonState.Pressed, hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 229 Keyboard.Listen(Key.L, ButtonState.Pressed, AmmuAseella, "Ammu"); 221 230 222 231 ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); … … 230 239 Keyboard.Listen(Key.D, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja2, nopeus); 231 240 Keyboard.Listen(Key.W, ButtonState.Pressed, hyppaa, "Pelaaja hyppää", pelaaja2, hyppyNopeus); 232 233 234 235 236 237 241 Keyboard.Listen(Key.G, ButtonState.Pressed, AmmuAseella2, "Ammu" ); 242 243 244 245 238 246 } 239 247 240 248 void liikuta(PlatformCharacter hahmo, double nopeus) 241 249 { 242 hahmo.Walk(nopeus); 250 hahmo.Walk(nopeus 251 ); 243 252 } 244 253 … … 247 256 hahmo.Jump(nopeus); 248 257 } 249 250 251 252 253 254 255 258 259 260 261 void AmmuAseella() 262 { 263 PhysicsObject ammus = pelaaja1.Weapon.Shoot(); 264 265 if (ammus != null) 266 { 267 ammus.Size *= 5; 268 ammus.CollisionIgnoreGroup = 2; 269 ammus.Image = Fireball; 270 } 271 } 272 273 void AmmuAseella2() 274 { 275 PhysicsObject ammus2 = pelaaja2.Weapon.Shoot(); 276 277 if (ammus2 != null) 278 { 279 ammus2.Size *= 5; 280 ammus2.CollisionIgnoreGroup = 3; 281 ammus2.Color = Color.Blue; 282 ammus2.Image = olionKuva; 283 284 } 285 286 287 288 289 290 } 291 292 void AmmusOsui(PhysicsObject ammus, PhysicsObject kohde) 293 { 294 ammus.Destroy(); 295 296 if (kohde == pelaaja2) 297 { 298 pelaaja2Elama.Value--; 299 } 300 301 302 303 } 304 305 void AmmusOsui2(PhysicsObject ammus2, PhysicsObject kohde) 306 { 307 308 if (kohde == pelaaja1) 309 { 310 pelaaja1Elama.Value--; 311 } 312 ammus2.Destroy(); 313 314 315 } 316 317 318 319 320 321 322 323 256 324 } -
2011/31/DanH/Dragonfighter/Dragonfighter/Dragonfighter/kentta1.txt
r2535 r2564 1 2 3 1 4 2 5 3 6 4 7 5 ########### 8 9 ########### 6 10 7 11 12 ### ### ### 8 13 9 ###### ###### 10 11 N X 12 ################# 14 15 N # X 16 ############################ -
2011/31/DanH/Dragonfighter/Dragonfighter/DragonfighterContent/DragonfighterContent.contentproj
r2535 r2564 79 79 </Compile> 80 80 </ItemGroup> 81 <ItemGroup> 82 <Compile Include="DragonStance.png"> 83 <Name>DragonStance</Name> 84 <Importer>TextureImporter</Importer> 85 <Processor>TextureProcessor</Processor> 86 </Compile> 87 </ItemGroup> 88 <ItemGroup> 89 <Compile Include="Thunderbolt3.png"> 90 <Name>Thunderbolt3</Name> 91 <Importer>TextureImporter</Importer> 92 <Processor>TextureProcessor</Processor> 93 </Compile> 94 </ItemGroup> 95 <ItemGroup> 96 <Compile Include="Fireball2.png"> 97 <Name>Fireball2</Name> 98 <Importer>TextureImporter</Importer> 99 <Processor>TextureProcessor</Processor> 100 </Compile> 101 </ItemGroup> 81 102 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 82 103 <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Note: See TracChangeset
for help on using the changeset viewer.