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

Talletus.

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  
    118118    <Content Include="Game.ico" /> 
    119119    <Content Include="GameThumbnail.png" /> 
     120    <Content Include="JuoksuOikein.png" /> 
    120121    <Content Include="kentta1.txt"> 
    121122      <CopyToOutputDirectory>Always</CopyToOutputDirectory> 
    122123    </Content> 
    123     <Content Include="oikealle.bmp" /> 
    124     <Content Include="vasemmalle.bmp" /> 
     124    <Content Include="Stance.png" /> 
     125    <Content Include="StanceGood.png" /> 
    125126  </ItemGroup> 
    126127  <ItemGroup> 
  • 2011/31/DanH/Dragonfighter/Dragonfighter/Dragonfighter/Peli.cs

    r2504 r2519  
    77using Jypeli.Widgets; 
    88 
    9 public class Peli : PhysicsGame 
     9   public class Peli : PhysicsGame 
    1010{ 
    1111    const double nopeus = 200; 
     
    1414 
    1515    PlatformCharacter pelaaja1; 
     16    PlatformCharacter pelaaja2; 
     17    Image Dragon = LoadImage("StanceGood"); 
    1618 
    17      
    18     Image[] DragoninKuvat = LoadImages("paikoillaan", "vasemmalle", "oikealle"); 
     19    Image paikallaanVasemmalle = LoadImage("StanceGood"); 
     20    Image paikallaanOikealle; 
    1921 
    20     Image[] DragoninKuvatPeilattu; 
     22        
     23      Image[] kavelyVasemmalle = LoadImages("JuoksuOikein"); 
     24    
     25      Image[] kavelyOikealle; 
    2126 
    2227 
    23      
     28      DoubleMeter pelaaja1Elama; 
    2429 
    2530 
    26     SoundEffect maaliAani = LoadSoundEffect("maali"); 
    27       
    2831 
    2932 
    30      
     33        
     34        
     35        
     36        
    3137 
    3238 
    33     public override void Begin() 
     39 
     40 
     41 
     42 
     43 
     44 
     45 
     46 
     47 
     48 
     49 
     50 
     51      public override void Begin() 
    3452    { 
     53        pelaaja1Elama = new DoubleMeter( 100 ); 
     54        pelaaja1Elama.MaxValue = 100; 
    3555 
    36         DragoninKuvatPeilattu = Image.Mirror(DragoninKuvat); 
     56        paikallaanOikealle = Image.Mirror(paikallaanVasemmalle); 
     57        kavelyOikealle = Image.Mirror(kavelyVasemmalle); 
     58 
     59 
     60         
    3761 
    3862        Gravity = new Vector(0, -1000); 
     
    4468 
    4569        Camera.ZoomFactor = 1.2; 
    46         Camera.StayInLevel = true; 
     70        Camera.ZoomToLevel(); 
     71 
    4772    } 
    4873 
    4974    void luoKentta() 
    5075    { 
     76 
     77        
     78  
     79         
    5180        TileMap kentta = TileMap.FromFile("kentta1.txt"); 
    5281        kentta.SetTileMethod('#', lisaaTaso); 
     
    5584        kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    5685        Level.CreateBorders(); 
    57         Level.Background.CreateGradient(Color.White, Color.SkyBlue); 
     86        Level.Background.CreateGradient(Color.White, Color.Blue); 
     87 
     88 
    5889    } 
    5990 
     
    71102    void lisaaPelaaja(Vector paikka, double leveys, double korkeus) 
    72103    { 
    73         pelaaja1 = new PlatformCharacter(leveys, korkeus); 
     104        pelaaja1 = new PlatformCharacter (leveys, korkeus); 
    74105        pelaaja1.Position = paikka; 
    75106        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                     
    78127        Add(pelaaja1); 
    79128    } 
     129 
     130 
     131 
     132    void lisaaPelaaja2(Vector paikka, double leveys, double korkeus) 
     133    { 
     134 
     135 
     136 
     137 
     138    } 
     139 
     140        
    80141 
    81142    void lisaaNappaimet() 
     
    105166    } 
    106167 
    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     
    116174} 
  • 2011/31/DanH/Dragonfighter/Dragonfighter/Dragonfighter/kentta1.txt

    r2504 r2519  
    33 
    44 
    5       ######### 
     5   ########### 
    66 
    77      
    88 
    9    #####     ##### 
     9######     ###### 
    1010 
    11         N 
    12   ################ 
     11N          
     12################# 
  • 2011/31/DanH/Dragonfighter/Dragonfighter/DragonfighterContent/DragonfighterContent.contentproj

    r2504 r2519  
    5050      <Processor>SoundEffectProcessor</Processor> 
    5151    </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> 
    5956      <Importer>TextureImporter</Importer> 
    6057      <Processor>TextureProcessor</Processor> 
     
    6259  </ItemGroup> 
    6360  <ItemGroup> 
    64     <Compile Include="paikoillaan2.bmp"> 
    65       <Name>paikoillaan2</Name> 
     61    <Compile Include="JuoksuOikein.png"> 
     62      <Name>JuoksuOikein</Name> 
    6663      <Importer>TextureImporter</Importer> 
    6764      <Processor>TextureProcessor</Processor> 
Note: See TracChangeset for help on using the changeset viewer.