Changeset 2535 for 2011/31/DanH/Dragonfighter/Dragonfighter
- Timestamp:
- 2011-08-03 14:56:44 (12 years ago)
- Location:
- 2011/31/DanH/Dragonfighter/Dragonfighter
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
2011/31/DanH/Dragonfighter/Dragonfighter/Dragonfighter/Dragonfighter.csproj
r2519 r2535 118 118 <Content Include="Game.ico" /> 119 119 <Content Include="GameThumbnail.png" /> 120 <Content Include="Hunter.png" /> 121 <Content Include="HunterJuoksu.png" /> 120 122 <Content Include="JuoksuOikein.png" /> 121 123 <Content Include="kentta1.txt"> -
2011/31/DanH/Dragonfighter/Dragonfighter/Dragonfighter/Peli.cs
r2519 r2535 1 1 using System; 2 2 3 using System.Collections.Generic; 3 4 using Jypeli; … … 7 8 using Jypeli.Widgets; 8 9 10 9 11 public class Peli : PhysicsGame 10 12 { 13 14 15 16 17 18 11 19 const double nopeus = 200; 12 20 const double hyppyNopeus = 1000; … … 15 23 PlatformCharacter pelaaja1; 16 24 PlatformCharacter pelaaja2; 17 Image Dragon = LoadImage("StanceGood"); 25 26 Image Dragon = LoadImage("StanceGood"); 27 Image Hunter = LoadImage("Hunter"); 18 28 19 29 Image paikallaanVasemmalle = LoadImage("StanceGood"); … … 25 35 Image[] kavelyOikealle; 26 36 37 Image paikallaanVasemmalle2 = LoadImage("Hunter"); 38 Image paikallaanOikealle2; 39 40 41 Image[] kavelyVasemmalle2 = LoadImages("HunterJuoksu"); 42 43 Image[] kavelyOikealle2; 44 27 45 28 46 DoubleMeter pelaaja1Elama; 29 30 31 32 33 47 DoubleMeter pelaaja2Elama; 48 49 50 51 List<Label> valikonKohdat; 52 34 53 35 54 … … 51 70 public override void Begin() 52 71 { 53 pelaaja1Elama = new DoubleMeter( 100 ); 72 73 74 75 76 77 pelaaja1Elama = new DoubleMeter( 100 ); 54 78 pelaaja1Elama.MaxValue = 100; 79 80 pelaaja2Elama = new DoubleMeter(100); 81 pelaaja2Elama.MaxValue = 100; 82 55 83 56 84 paikallaanOikealle = Image.Mirror(paikallaanVasemmalle); 57 85 kavelyOikealle = Image.Mirror(kavelyVasemmalle); 58 86 59 87 paikallaanOikealle2 = Image.Mirror(paikallaanVasemmalle2); 88 kavelyOikealle2 = Image.Mirror(kavelyVasemmalle2); 60 89 61 90 … … 70 99 Camera.ZoomToLevel(); 71 100 72 } 101 102 } 103 104 105 106 107 108 109 73 110 74 111 void luoKentta() … … 82 119 ; 83 120 kentta.SetTileMethod('N', lisaaPelaaja); 121 kentta.SetTileMethod('X', lisaaPelaaja2); 122 84 123 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 85 124 Level.CreateBorders(); … … 109 148 pelaaja1.LeftIdleAnimation = new Animation(paikallaanVasemmalle); 110 149 pelaaja1.RightIdleAnimation = new Animation(paikallaanOikealle); 150 151 pelaaja1.CollisionIgnoreGroup = 1; 111 152 112 153 … … 133 174 { 134 175 135 136 176 pelaaja2 = new PlatformCharacter(leveys, korkeus); 177 pelaaja2.Position = paikka; 178 pelaaja2.Mass = 4.0; 179 pelaaja2.Image = Hunter; 180 181 pelaaja2.CollisionIgnoreGroup = 1; 182 183 184 pelaaja2.LeftIdleAnimation = new Animation(paikallaanVasemmalle2); 185 pelaaja2.RightIdleAnimation = new Animation(paikallaanOikealle2); 186 187 188 pelaaja2.LeftWalkingAnimation = new Animation(kavelyVasemmalle2); 189 pelaaja2.RightWalkingAnimation = new Animation(kavelyOikealle2); 190 191 192 193 194 195 196 BarGauge pelaaja2ElamaPalkki = new BarGauge(20, Screen.Width / 3); 197 pelaaja2ElamaPalkki.X = Screen.Right - Screen.Width / 4; 198 pelaaja2ElamaPalkki.Y = Screen.Top - 40; 199 pelaaja2ElamaPalkki.Angle = Angle.FromDegrees(-90); 200 pelaaja2ElamaPalkki.BindTo(pelaaja2Elama); 201 pelaaja2ElamaPalkki.Color = Color.Black; 202 pelaaja2ElamaPalkki.BarColor = Color.Red; 203 Add(pelaaja2ElamaPalkki); 204 205 206 207 Add(pelaaja2); 137 208 138 209 } … … 154 225 ControllerOne.Listen(Button.DPadRight, ButtonState.Down, liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus); 155 226 ControllerOne.Listen(Button.A, ButtonState.Pressed, hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 227 228 229 Keyboard.Listen(Key.A, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja2, -nopeus); 230 Keyboard.Listen(Key.D, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja2, nopeus); 231 Keyboard.Listen(Key.W, ButtonState.Pressed, hyppaa, "Pelaaja hyppää", pelaaja2, hyppyNopeus); 232 233 234 235 236 237 156 238 } 157 239 -
2011/31/DanH/Dragonfighter/Dragonfighter/Dragonfighter/kentta1.txt
r2519 r2535 9 9 ###### ###### 10 10 11 N 11 N X 12 12 ################# -
2011/31/DanH/Dragonfighter/Dragonfighter/DragonfighterContent/DragonfighterContent.contentproj
r2519 r2535 65 65 </Compile> 66 66 </ItemGroup> 67 <ItemGroup> 68 <Compile Include="Hunter.png"> 69 <Name>Hunter</Name> 70 <Importer>TextureImporter</Importer> 71 <Processor>TextureProcessor</Processor> 72 </Compile> 73 </ItemGroup> 74 <ItemGroup> 75 <Compile Include="HunterJuoksu.png"> 76 <Name>HunterJuoksu</Name> 77 <Importer>TextureImporter</Importer> 78 <Processor>TextureProcessor</Processor> 79 </Compile> 80 </ItemGroup> 67 81 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 68 82 <!-- 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.