Changeset 5771 for 2014


Ignore:
Timestamp:
2014-11-15 14:56:58 (5 years ago)
Author:
sieerinn
Message:

Pix

Location:
2014/30/AarniAR/AdventureOfStarKid
Files:
4 added
13 edited

Legend:

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

    r5763 r5771  
    99class Vihu : PlatformCharacter 
    1010{ 
    11     private IntMeter elamaLaskuri = new IntMeter(10, 0, 10); 
     11    private IntMeter elamaLaskuri; 
    1212    public IntMeter ElamaLaskuri { get { return elamaLaskuri; } } 
    1313 
    14     public Vihu(double leveys, double korkeus) 
     14    public Vihu(double leveys, double korkeus, int max) 
    1515        : base(leveys, korkeus) 
    1616    { 
     17        elamaLaskuri = new IntMeter(max, 0, max); 
    1718        elamaLaskuri.LowerLimit += delegate { this.Destroy(); }; 
    1819    } 
     
    3637    private Image Healing = LoadImage("Healing"); 
    3738    private Image killLavaKuva = LoadImage("IntaKillLava"); 
     39    private Image[] pix = LoadImages("Pix1", "Pix2"); 
    3840    const double nopeus = 200; 
    3941    const double hyppyNopeus = 350; 
     
    4143    PlasmaCannon pelaajan1Ase; 
    4244    PlasmaCannon pelaajan2Ase; 
    43      
     45 
    4446    DoubleMeter health; 
    4547    DoubleMeter health2; 
     
    8385        kentta.SetTileMethod('L', LisaaKillLava); 
    8486        kentta.SetTileMethod('F', LisaaLoppu); 
     87        kentta.SetTileMethod('P', Lisaapix); 
     88 
    8589        kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    8690        Level.CreateBorders(); 
     
    125129    void Lisaastumper(Vector paikka, double leveys, double korkeus) 
    126130    { 
    127         Vihu stumper = new Vihu(leveys - 4, korkeus - 4); 
     131        Vihu stumper = new Vihu(leveys - 4, korkeus - 4, 10); 
    128132        stumper.IgnoresCollisionResponse = false; 
    129133 
     
    132136        stumper.Tag = "stumper"; 
    133137        Add(stumper); 
     138 
    134139        PlatformWandererBrain tasoAivot = new PlatformWandererBrain(); 
    135140        tasoAivot.Speed = 100; 
    136141        tasoAivot.TriesToJump = false; 
    137         stumper.CollisionIgnoreGroup = 2; 
     142        //stumper.CollisionIgnoreGroup = 2; 
    138143        stumper.Brain = tasoAivot; 
    139144 
     
    159164        pelaaja1.Image = pelaajanKuva; 
    160165        AddCollisionHandler(pelaaja1, "stumper", TormaaTahteen); 
     166        AddCollisionHandler(pelaaja1, "pix", Tormaapixiin); 
    161167        Add(pelaaja1); 
    162168        AddCollisionHandler(pelaaja1, "1UP", tormaaOneUP); 
     
    209215        ammus.Destroy(); 
    210216 
    211         if (kohde.Tag == "stumper") 
     217        if (kohde is Vihu) 
    212218        { 
    213219            (kohde as Vihu).ElamaLaskuri.Value--; 
     
    269275            maaliAani.Play(); 
    270276            MessageDisplay.Add("Ouch!"); 
    271             OtaVahinkoa(hahmo, 2); 
     277            OtaVahinkoa(hahmo, 4); 
    272278        } 
    273279        //stumper.Destroy(); 
     
    349355        pelaaja1.Destroy(); 
    350356        //pelaaja2.Destroy(); 
    351          
     357 
    352358        GameObject kuoli = new GameObject(pelaaja1.Width, pelaaja1.Height); 
    353359        kuoli.Image = lifelost[0]; 
     
    362368        //Timer.SingleShot(2, kuoli.Destroy); 
    363369        //Timer.SingleShot(2, kuoli2.Destroy); 
    364          
     370 
    365371        Timer.SingleShot(5, AloitaPeli); 
    366372    } 
     
    419425            Exit(); 
    420426        } 
    421          
     427 
    422428 
    423429        LisaaNappaimet(); 
     
    447453            health2.Value -= 15; 
    448454    } 
     455 
     456    void Lisaapix(Vector paikka, double leveys, double korkeus) 
     457    { 
     458 
     459        Vihu pix = new Vihu(leveys - 4, korkeus - 4, 7); 
     460        pix.IgnoresCollisionResponse = false; 
     461 
     462        pix.Position = paikka; 
     463        pix.Animation = new Animation(this.pix); 
     464        pix.AnimWalk = new Animation(this.pix); 
     465        pix.AnimWalk.FPS = 6; 
     466        pix.Tag = "pix"; 
     467        Add(pix); 
     468        PlatformWandererBrain tasoAivot = new PlatformWandererBrain(); 
     469        tasoAivot.Speed = 300; 
     470        tasoAivot.JumpSpeed = 800; 
     471        tasoAivot.TriesToJump = true; 
     472        //pix.CollisionIgnoreGroup = 3; 
     473        pix.Brain = tasoAivot; 
     474 
     475 
     476    } 
     477 
     478    void Tormaapixiin(PhysicsObject hahmo, PhysicsObject pix) 
     479    { 
     480        if (!invincible) 
     481        { 
     482            maaliAani.Play(); 
     483            MessageDisplay.Add("Ouch!"); 
     484            OtaVahinkoa(hahmo, 2); 
     485        } 
     486    } 
     487 
     488 
     489 
    449490} 
  • 2014/30/AarniAR/AdventureOfStarKid/AdventureOfStarKid/AdventureOfStarKid/AdventureOfStarKid.csproj.Debug.cachefile

    r5760 r5771  
    3030Content\Stage 3.xnb 
    3131Content\Stage 4.xnb 
     32Content\Pix1.xnb 
     33Content\Pix2.xnb 
    3234Content\brinstar.wma 
    3335Content\title.wma 
  • 2014/30/AarniAR/AdventureOfStarKid/AdventureOfStarKid/AdventureOfStarKid/obj/x86/Debug/AdventureOfStarKid.csproj.FileListAbsolute.txt

    r5760 r5771  
    4444C:\MyTemp\AarniAR\AdventureOfStarKid\AdventureOfStarKid\AdventureOfStarKid\bin\x86\Debug\Content\Stage 3.wma 
    4545C:\MyTemp\AarniAR\AdventureOfStarKid\AdventureOfStarKid\AdventureOfStarKid\bin\x86\Debug\Content\Stage 4.wma 
     46C:\MyTemp\AarniAR\AdventureOfStarKid\AdventureOfStarKid\AdventureOfStarKid\bin\x86\Debug\Content\Pix1.xnb 
     47C:\MyTemp\AarniAR\AdventureOfStarKid\AdventureOfStarKid\AdventureOfStarKid\bin\x86\Debug\Content\Pix2.xnb 
  • 2014/30/AarniAR/AdventureOfStarKid/AdventureOfStarKid/AdventureOfStarKid/obj/x86/Debug/ContentPipeline-{ECF942E0-B21C-45ED-8977-79F4B42A7C44}.xml

    r5763 r5771  
    198198      <Options>None</Options> 
    199199      <Output>C:\MyTemp\AarniAR\AdventureOfStarKid\AdventureOfStarKid\AdventureOfStarKid\bin\x86\Debug\Content\kentta1.xnb</Output> 
    200       <Time>2014-10-18T15:08:59.4521847+03:00</Time> 
     200      <Time>2014-11-15T14:36:06.7489323+02:00</Time> 
    201201    </Item> 
    202202    <Item> 
     
    286286      <Extra>C:\MyTemp\AarniAR\AdventureOfStarKid\AdventureOfStarKid\AdventureOfStarKid\bin\x86\Debug\Content\Stage 4.wma</Extra> 
    287287      <Time>2014-10-18T15:01:43.9696408+03:00</Time> 
     288    </Item> 
     289    <Item> 
     290      <Source>Pix1.png</Source> 
     291      <Name>Pix1</Name> 
     292      <Importer>TextureImporter</Importer> 
     293      <Processor>TextureProcessor</Processor> 
     294      <Options>None</Options> 
     295      <Output>C:\MyTemp\AarniAR\AdventureOfStarKid\AdventureOfStarKid\AdventureOfStarKid\bin\x86\Debug\Content\Pix1.xnb</Output> 
     296      <Time>2014-11-15T11:02:52.925046+02:00</Time> 
     297    </Item> 
     298    <Item> 
     299      <Source>Pix2.png</Source> 
     300      <Name>Pix2</Name> 
     301      <Importer>TextureImporter</Importer> 
     302      <Processor>TextureProcessor</Processor> 
     303      <Options>None</Options> 
     304      <Output>C:\MyTemp\AarniAR\AdventureOfStarKid\AdventureOfStarKid\AdventureOfStarKid\bin\x86\Debug\Content\Pix2.xnb</Output> 
     305      <Time>2014-11-15T11:03:05.595046+02:00</Time> 
    288306    </Item> 
    289307    <BuildSuccessful>true</BuildSuccessful> 
  • 2014/30/AarniAR/AdventureOfStarKid/AdventureOfStarKid/AdventureOfStarKid/obj/x86/Debug/cachefile-{ECF942E0-B21C-45ED-8977-79F4B42A7C44}-targetpath.txt

    r5760 r5771  
    3636Content\Stage 4.xnb 
    3737Content\Stage 4.wma 
     38Content\Pix1.xnb 
     39Content\Pix2.xnb 
  • 2014/30/AarniAR/AdventureOfStarKid/AdventureOfStarKid/AdventureOfStarKidContent/AdventureOfStarKidContent.contentproj

    r5760 r5771  
    256256    </Compile> 
    257257  </ItemGroup> 
     258  <ItemGroup> 
     259    <Compile Include="Pix1.png"> 
     260      <Name>Pix1</Name> 
     261      <Importer>TextureImporter</Importer> 
     262      <Processor>TextureProcessor</Processor> 
     263    </Compile> 
     264  </ItemGroup> 
     265  <ItemGroup> 
     266    <Compile Include="Pix2.png"> 
     267      <Name>Pix2</Name> 
     268      <Importer>TextureImporter</Importer> 
     269      <Processor>TextureProcessor</Processor> 
     270    </Compile> 
     271  </ItemGroup> 
    258272  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    259273  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2014/30/AarniAR/AdventureOfStarKid/AdventureOfStarKid/AdventureOfStarKidContent/kentta1.txt

    r5760 r5771  
    2929#                                                       * ####   #           #  ############ 
    3030#                                                     ####                   #  ############ 
    31 #    N                          *##                #                         #  ############ 
     31#    N             P#             *##                #                         #  ############ 
    3232########################LL#########LLL###########LLLLLLLLLLLLLLL#LLLLLLLLLLLL#LL############ 
    3333############################################################################################ 
Note: See TracChangeset for help on using the changeset viewer.