Changeset 2519 for 2011/31/DanH/Dragonfighter/Dragonfighter
- Timestamp:
- 2011-08-03 13:11:44 (12 years ago)
- Location:
- 2011/31/DanH/Dragonfighter/Dragonfighter
- Files:
-
- 5 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
2011/31/DanH/Dragonfighter/Dragonfighter/Dragonfighter/Dragonfighter.csproj
r2504 r2519 118 118 <Content Include="Game.ico" /> 119 119 <Content Include="GameThumbnail.png" /> 120 <Content Include="JuoksuOikein.png" /> 120 121 <Content Include="kentta1.txt"> 121 122 <CopyToOutputDirectory>Always</CopyToOutputDirectory> 122 123 </Content> 123 <Content Include=" oikealle.bmp" />124 <Content Include=" vasemmalle.bmp" />124 <Content Include="Stance.png" /> 125 <Content Include="StanceGood.png" /> 125 126 </ItemGroup> 126 127 <ItemGroup> -
2011/31/DanH/Dragonfighter/Dragonfighter/Dragonfighter/Peli.cs
r2504 r2519 7 7 using Jypeli.Widgets; 8 8 9 public class Peli : PhysicsGame9 public class Peli : PhysicsGame 10 10 { 11 11 const double nopeus = 200; … … 14 14 15 15 PlatformCharacter pelaaja1; 16 PlatformCharacter pelaaja2; 17 Image Dragon = LoadImage("StanceGood"); 16 18 17 18 Image [] DragoninKuvat = LoadImages("paikoillaan", "vasemmalle", "oikealle");19 Image paikallaanVasemmalle = LoadImage("StanceGood"); 20 Image paikallaanOikealle; 19 21 20 Image[] DragoninKuvatPeilattu; 22 23 Image[] kavelyVasemmalle = LoadImages("JuoksuOikein"); 24 25 Image[] kavelyOikealle; 21 26 22 27 23 28 DoubleMeter pelaaja1Elama; 24 29 25 30 26 SoundEffect maaliAani = LoadSoundEffect("maali");27 28 31 29 32 30 33 34 35 36 31 37 32 38 33 public override void Begin() 39 40 41 42 43 44 45 46 47 48 49 50 51 public override void Begin() 34 52 { 53 pelaaja1Elama = new DoubleMeter( 100 ); 54 pelaaja1Elama.MaxValue = 100; 35 55 36 DragoninKuvatPeilattu = Image.Mirror(DragoninKuvat); 56 paikallaanOikealle = Image.Mirror(paikallaanVasemmalle); 57 kavelyOikealle = Image.Mirror(kavelyVasemmalle); 58 59 60 37 61 38 62 Gravity = new Vector(0, -1000); … … 44 68 45 69 Camera.ZoomFactor = 1.2; 46 Camera.StayInLevel = true; 70 Camera.ZoomToLevel(); 71 47 72 } 48 73 49 74 void luoKentta() 50 75 { 76 77 78 79 51 80 TileMap kentta = TileMap.FromFile("kentta1.txt"); 52 81 kentta.SetTileMethod('#', lisaaTaso); … … 55 84 kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 56 85 Level.CreateBorders(); 57 Level.Background.CreateGradient(Color.White, Color.SkyBlue); 86 Level.Background.CreateGradient(Color.White, Color.Blue); 87 88 58 89 } 59 90 … … 71 102 void lisaaPelaaja(Vector paikka, double leveys, double korkeus) 72 103 { 73 pelaaja1 = new PlatformCharacter (leveys, korkeus);104 pelaaja1 = new PlatformCharacter (leveys, korkeus); 74 105 pelaaja1.Position = paikka; 75 106 pelaaja1.Mass = 4.0; 76 pelaaja1.Image = ; 77 AddCollisionHandler(pelaaja1, kasittelePelaajanTormays); 107 pelaaja1.Image = Dragon; 108 109 pelaaja1.LeftIdleAnimation = new Animation(paikallaanVasemmalle); 110 pelaaja1.RightIdleAnimation = new Animation(paikallaanOikealle); 111 112 113 pelaaja1.LeftWalkingAnimation = new Animation(kavelyVasemmalle); 114 pelaaja1.RightWalkingAnimation = new Animation(kavelyOikealle); 115 116 BarGauge pelaaja1ElamaPalkki = new BarGauge(20, Screen.Width / 3); 117 pelaaja1ElamaPalkki.X = Screen.Left + Screen.Width / 5; 118 pelaaja1ElamaPalkki.Y = Screen.Top - 40; 119 pelaaja1ElamaPalkki.Angle = Angle.FromDegrees(90); 120 pelaaja1ElamaPalkki.BindTo(pelaaja1Elama); 121 pelaaja1ElamaPalkki.Color = Color.Black; 122 pelaaja1ElamaPalkki.BarColor = Color.Red; 123 Add(pelaaja1ElamaPalkki); 124 125 126 78 127 Add(pelaaja1); 79 128 } 129 130 131 132 void lisaaPelaaja2(Vector paikka, double leveys, double korkeus) 133 { 134 135 136 137 138 } 139 140 80 141 81 142 void lisaaNappaimet() … … 105 166 } 106 167 107 void kasittelePelaajanTormays(PhysicsObject hahmo, PhysicsObject kohde) 108 { 109 if (kohde.Tag.ToString() == "tahti") 110 { 111 maaliAani.Play(); 112 MessageDisplay.Add("Keräsit tähden!"); 113 kohde.Destroy(); 114 } 115 } 168 169 170 171 172 173 116 174 } -
2011/31/DanH/Dragonfighter/Dragonfighter/Dragonfighter/kentta1.txt
r2504 r2519 3 3 4 4 5 5 ########### 6 6 7 7 8 8 9 ##########9 ###### ###### 10 10 11 N 12 11 N 12 ################# -
2011/31/DanH/Dragonfighter/Dragonfighter/DragonfighterContent/DragonfighterContent.contentproj
r2504 r2519 50 50 <Processor>SoundEffectProcessor</Processor> 51 51 </Compile> 52 <Compile Include="norsu.png"> 53 <Name>norsu</Name> 54 <Importer>TextureImporter</Importer> 55 <Processor>TextureProcessor</Processor> 56 </Compile> 57 <Compile Include="tahti.png"> 58 <Name>tahti</Name> 52 </ItemGroup> 53 <ItemGroup> 54 <Compile Include="StanceGood.png"> 55 <Name>StanceGood</Name> 59 56 <Importer>TextureImporter</Importer> 60 57 <Processor>TextureProcessor</Processor> … … 62 59 </ItemGroup> 63 60 <ItemGroup> 64 <Compile Include=" paikoillaan2.bmp">65 <Name> paikoillaan2</Name>61 <Compile Include="JuoksuOikein.png"> 62 <Name>JuoksuOikein</Name> 66 63 <Importer>TextureImporter</Importer> 67 64 <Processor>TextureProcessor</Processor>
Note: See TracChangeset
for help on using the changeset viewer.