Changeset 5617 for 2014/30


Ignore:
Timestamp:
2014-07-24 10:47:50 (9 years ago)
Author:
aajualal
Message:

hi

Location:
2014/30/AarniAR
Files:
3 added
10 edited

Legend:

Unmodified
Added
Removed
  • 2014/30/AarniAR/AdventureOfStarKid/AdventureOfStarKid/AdventureOfStarKid/AdventureOfStarKid.cs

    r5600 r5617  
    1313    private Image[] shootinganimation = LoadImages("shootinganimation"); 
    1414    private Image[] jumpinganimation = LoadImages("jumpinganimation"); 
     15    private Image[] lifelost = LoadImages("LifeLost"); 
    1516    const double nopeus = 200; 
    1617    const double hyppyNopeus = 750; 
    1718    const int RUUDUN_KOKO = 40; 
    1819   PlasmaCannon pelaajan1Ase; 
     20   DoubleMeter health; 
    1921    
    2022 
     
    2830    public override void Begin() 
    2931    { 
     32        SmoothTextures = false; 
     33        AloitaPeli(); 
     34    } 
     35 
     36    void AloitaPeli() 
     37    { 
     38        ClearAll(); 
    3039        Gravity = new Vector(0, -1000); 
    31         SmoothTextures = false; 
    3240 
    3341        LuoKentta(); 
    3442        LisaaNappaimet(); 
     43        LuoPistelaskuri(); 
    3544 
    3645        Camera.Follow(pelaaja1); 
     
    92101        Keyboard.Listen(Key.Left, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, -nopeus); 
    93102        Keyboard.Listen(Key.Right, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 
    94         Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
     103        Keyboard.Listen(Key.Space, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
    95104        Keyboard.Listen(Key. C, ButtonState.Pressed, Ammu, "Ampuu", pelaajan1Ase); 
    96105 
     
    119128        maaliAani.Play(); 
    120129        MessageDisplay.Add("Ouch!"); 
     130        health.Value -= 2; 
     131         
    121132        //stumper.Destroy(); 
    122133    } 
     
    129140    void LuoPistelaskuri() 
    130141    { 
    131         IntMeter pelaajanElamat = new IntMeter(10); 
    132         pelaajanElamat.MinValue = 0; 
    133         pelaajanElamat.LowerLimit += PelaajaHaviaa; 
     142        health = new DoubleMeter(10); 
     143        health.MaxValue = 15; 
     144        health.MinValue = 0; 
     145        health.LowerLimit += PelaajaHaviaa; 
     146        /* 
     147        health.Changed += delegate 
     148        { 
     149            Animation anim = new Animation(lifelost); 
     150            anim.FPS = 2.0; 
     151            pelaaja1.PlayAnimation(anim); 
     152        }; 
     153         */ 
     154        ProgressBar healthMeter = new ProgressBar(150, 20); 
     155        healthMeter.X = Screen.Left + 150; 
     156        healthMeter.Y = Screen.Top - 100; 
     157        healthMeter.BindTo(health); 
     158        Add(healthMeter); 
     159        
     160        healthMeter.Angle = Angle.RightAngle; 
     161        healthMeter.Color = Color.Transparent; 
     162        healthMeter.BarColor = Color.Red; 
     163        healthMeter.BorderColor = Color.Black; 
     164 
     165 
     166         
    134167    } 
    135168    void PelaajaHaviaa() 
    136169    { 
    137170        MessageDisplay.Add("Life Lost..."); 
     171        pelaaja1.Destroy(); 
     172        GameObject kuoli = new GameObject(pelaaja1.Width, pelaaja1.Height); 
     173        kuoli.Image = lifelost[0]; 
     174        kuoli.Position = pelaaja1.Position; 
     175        Add(kuoli); 
     176 
     177        Timer.SingleShot(2, kuoli.Destroy); 
     178        Timer.SingleShot(5, AloitaPeli); 
    138179    } 
    139180} 
  • 2014/30/AarniAR/AdventureOfStarKid/AdventureOfStarKid/AdventureOfStarKid/AdventureOfStarKid.csproj.Debug.cachefile

    r5600 r5617  
    99Content\Shootinganimation.xnb 
    1010Content\jumpinganimation.xnb 
     11Content\LifeLost.xnb 
  • 2014/30/AarniAR/AdventureOfStarKid/AdventureOfStarKid/AdventureOfStarKid/obj/x86/Debug/AdventureOfStarKid.csproj.FileListAbsolute.txt

    r5600 r5617  
    1717C:\MyTemp\AarniAR\AdventureOfStarKid\AdventureOfStarKid\AdventureOfStarKid\bin\x86\Debug\Content\Shootinganimation.xnb 
    1818C:\MyTemp\AarniAR\AdventureOfStarKid\AdventureOfStarKid\AdventureOfStarKid\bin\x86\Debug\Content\jumpinganimation.xnb 
     19C:\MyTemp\AarniAR\AdventureOfStarKid\AdventureOfStarKid\AdventureOfStarKid\bin\x86\Debug\Content\LifeLost.xnb 
  • 2014/30/AarniAR/AdventureOfStarKid/AdventureOfStarKid/AdventureOfStarKid/obj/x86/Debug/ContentPipeline-{ECF942E0-B21C-45ED-8977-79F4B42A7C44}.xml

    r5600 r5617  
    9292      <Time>2014-07-23T14:42:04.3043512+03:00</Time> 
    9393    </Item> 
     94    <Item> 
     95      <Source>LifeLost.png</Source> 
     96      <Name>LifeLost</Name> 
     97      <Importer>TextureImporter</Importer> 
     98      <Processor>TextureProcessor</Processor> 
     99      <Options>None</Options> 
     100      <Output>C:\MyTemp\AarniAR\AdventureOfStarKid\AdventureOfStarKid\AdventureOfStarKid\bin\x86\Debug\Content\LifeLost.xnb</Output> 
     101      <Time>2014-07-24T10:36:40.4322288+03:00</Time> 
     102    </Item> 
    94103    <BuildSuccessful>true</BuildSuccessful> 
    95104    <Settings> 
  • 2014/30/AarniAR/AdventureOfStarKid/AdventureOfStarKid/AdventureOfStarKid/obj/x86/Debug/cachefile-{ECF942E0-B21C-45ED-8977-79F4B42A7C44}-targetpath.txt

    r5600 r5617  
    99Content\Shootinganimation.xnb 
    1010Content\jumpinganimation.xnb 
     11Content\LifeLost.xnb 
  • 2014/30/AarniAR/AdventureOfStarKid/AdventureOfStarKid/AdventureOfStarKidContent/AdventureOfStarKidContent.contentproj

    r5600 r5617  
    109109    </Compile> 
    110110  </ItemGroup> 
     111  <ItemGroup> 
     112    <Compile Include="LifeLost.png"> 
     113      <Name>LifeLost</Name> 
     114      <Importer>TextureImporter</Importer> 
     115      <Processor>TextureProcessor</Processor> 
     116    </Compile> 
     117  </ItemGroup> 
    111118  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    112119  <!--  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.