Ignore:
Timestamp:
2011-08-03 14:56:44 (12 years ago)
Author:
daalhaat
Message:

Talletus.

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  
    118118    <Content Include="Game.ico" /> 
    119119    <Content Include="GameThumbnail.png" /> 
     120    <Content Include="Hunter.png" /> 
     121    <Content Include="HunterJuoksu.png" /> 
    120122    <Content Include="JuoksuOikein.png" /> 
    121123    <Content Include="kentta1.txt"> 
  • 2011/31/DanH/Dragonfighter/Dragonfighter/Dragonfighter/Peli.cs

    r2519 r2535  
    11using System; 
     2 
    23using System.Collections.Generic; 
    34using Jypeli; 
     
    78using Jypeli.Widgets; 
    89 
     10 
    911   public class Peli : PhysicsGame 
    1012{ 
     13 
     14        
     15 
     16 
     17 
     18 
    1119    const double nopeus = 200; 
    1220    const double hyppyNopeus = 1000; 
     
    1523    PlatformCharacter pelaaja1; 
    1624    PlatformCharacter pelaaja2; 
    17     Image Dragon = LoadImage("StanceGood"); 
     25    
     26       Image Dragon = LoadImage("StanceGood"); 
     27       Image Hunter = LoadImage("Hunter"); 
    1828 
    1929    Image paikallaanVasemmalle = LoadImage("StanceGood"); 
     
    2535      Image[] kavelyOikealle; 
    2636 
     37      Image paikallaanVasemmalle2 = LoadImage("Hunter"); 
     38      Image paikallaanOikealle2; 
     39 
     40 
     41      Image[] kavelyVasemmalle2 = LoadImages("HunterJuoksu"); 
     42 
     43      Image[] kavelyOikealle2; 
     44 
    2745 
    2846      DoubleMeter pelaaja1Elama; 
    29  
    30  
    31  
    32  
    33         
     47      DoubleMeter pelaaja2Elama; 
     48 
     49 
     50 
     51      List<Label> valikonKohdat; 
     52 
    3453        
    3554        
     
    5170      public override void Begin() 
    5271    { 
    53         pelaaja1Elama = new DoubleMeter( 100 ); 
     72 
     73 
     74          
     75 
     76           
     77          pelaaja1Elama = new DoubleMeter( 100 ); 
    5478        pelaaja1Elama.MaxValue = 100; 
     79 
     80        pelaaja2Elama = new DoubleMeter(100); 
     81        pelaaja2Elama.MaxValue = 100; 
     82 
    5583 
    5684        paikallaanOikealle = Image.Mirror(paikallaanVasemmalle); 
    5785        kavelyOikealle = Image.Mirror(kavelyVasemmalle); 
    5886 
    59  
     87        paikallaanOikealle2 = Image.Mirror(paikallaanVasemmalle2); 
     88        kavelyOikealle2 = Image.Mirror(kavelyVasemmalle2); 
    6089         
    6190 
     
    7099        Camera.ZoomToLevel(); 
    71100 
    72     } 
     101     
     102      } 
     103 
     104 
     105 
     106       
     107        
     108 
     109 
    73110 
    74111    void luoKentta() 
     
    82119       ; 
    83120        kentta.SetTileMethod('N', lisaaPelaaja); 
     121        kentta.SetTileMethod('X', lisaaPelaaja2); 
     122         
    84123        kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    85124        Level.CreateBorders(); 
     
    109148        pelaaja1.LeftIdleAnimation = new Animation(paikallaanVasemmalle); 
    110149        pelaaja1.RightIdleAnimation = new Animation(paikallaanOikealle); 
     150 
     151        pelaaja1.CollisionIgnoreGroup = 1; 
    111152 
    112153 
     
    133174    { 
    134175 
    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); 
    137208 
    138209    } 
     
    154225        ControllerOne.Listen(Button.DPadRight, ButtonState.Down, liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus); 
    155226        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     
    156238    } 
    157239 
  • 2011/31/DanH/Dragonfighter/Dragonfighter/Dragonfighter/kentta1.txt

    r2519 r2535  
    99######     ###### 
    1010 
    11 N          
     11N             X 
    1212################# 
  • 2011/31/DanH/Dragonfighter/Dragonfighter/DragonfighterContent/DragonfighterContent.contentproj

    r2519 r2535  
    6565    </Compile> 
    6666  </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> 
    6781  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    6882  <!--  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.