Changeset 6414 for 2015/26


Ignore:
Timestamp:
2015-06-26 00:36:23 (4 years ago)
Author:
empaheik
Message:

Jotain hilpeänmyöhäisiä lisäasetteluja, jotka hädin tuskin ovat edustavia nyt ja vielä vähemmän huomenna.

Location:
2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • 2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun.cs

    r6413 r6414  
    182182    private Image[] foregroundDecorations = LoadImages("viljaa", "grass", "grass"); 
    183183    private Image[] blockImages = LoadImages("box2", "rock"); 
     184    private Image[] decorationImages = LoadImages("paali", "tree1"); 
    184185 
    185186    private Image[] houseImages = LoadImages("house", "houseburned"); 
     
    231232    private Animation tattiMageCastAnimation; 
    232233    private Animation fireballAnimation; 
     234    private Animation hedgehogAnimation; 
    233235 
    234236    private Animation bossRiseAnimation; 
     
    391393        ClearAll(); 
    392394        CreateLevel(); 
    393         MediaPlayer.Play("hillbilly_level0"); 
    394         MediaPlayer.IsRepeating = true; 
    395395        ScreenSettings(); 
    396396        SetControls(); 
     
    425425        bossHurtAnimation = LoadAnimation("bosshurt"); 
    426426        fireballAnimation = LoadAnimation("fireball"); 
     427        hedgehogAnimation = LoadAnimation("siili"); 
    427428 
    428429        cameraOffset = Window.Width / 4; 
     
    496497        level.SetTileMethod(Color.DarkGray, CreateMilk); 
    497498        level.SetTileMethod(Color.Rose, CreateFlame, true); 
    498         //level.SetTileMethod(Color.Azure, CreateDummy, Color.Azure);   //TODO: CreateSmoke 
     499        level.SetTileMethod(Color.FromHexCode("0094FF"), CreateDecoration);   //TODO: CreateSmoke 
     500        level.SetTileMethod(Color.FromHexCode("E256FF"), CreateHedgehog); 
    499501        //level.SetTileMethod(Color.Orange, CreateDummy, Color.Orange); //TODO: CreateTombstone 
    500502 
    501         level.SetTileMethod(Color.FromHexCode("FF6A00"), CreateTreeTrunk);  //Pihhh jostain heksoista. Ikävästi haisee luovuttamiselta! :----D 
    502         level.SetTileMethod(Color.FromHexCode("57007F"), CreateTreeRoot);   // Heksojen käytössä ei ole mitään hävettävää :P 
     503        level.SetTileMethod(Color.FromHexCode("FF6A00"), CreateTreeTrunk);   
     504        level.SetTileMethod(Color.FromHexCode("57007F"), CreateTreeRoot);    
    503505        level.SetTileMethod(Color.FromHexCode("00FF21"), CreateTreeBranch); 
    504506        level.SetTileMethod(Color.FromHexCode("5B7F00"), CreateSwingTrap); 
     
    555557            fireballTimer.Start(); 
    556558        } 
     559    } 
     560 
     561    void CreateHedgehog(Vector position, double width, double height) 
     562    { 
     563        PlatformCharacter hedgehog = new PlatformCharacter(width, height * 0.6); 
     564        hedgehog.Position = position; 
     565        hedgehog.Animation = hedgehogAnimation; 
     566        hedgehog.Animation.FPS = RandomGen.NextInt(18, 24); 
     567        hedgehog.Animation.Step(RandomGen.NextInt(0, 16)); 
     568        hedgehog.Animation.Resume(); 
     569        hedgehog.Tag = "burn"; 
     570        hedgehog.CollisionIgnoreGroup = 3; 
     571        Add(hedgehog, 1); 
     572 
     573        PlatformWandererBrain brain = new PlatformWandererBrain(); 
     574        brain.Speed = 60; 
     575        brain.FallsOffPlatforms = false; 
     576        brain.TriesToJump = true; 
     577        hedgehog.Brain = brain; 
     578 
     579        AddCollisionHandler(hedgehog, "pitchfork", delegate(PhysicsObject w, PhysicsObject p) { w.Destroy(); }); 
     580    } 
     581 
     582    void CreateDecoration(Vector position, double width, double height) 
     583    { 
     584        GameObject decoration = new GameObject(width * 2, height * 3); 
     585        decoration.Position = position; 
     586        //decoration.Top = position.Y - height * 0.5; 
     587        //decoration.Animation = bossRiseAnimation; 
     588        decoration.Image = decorationImages[levelNumber]; 
     589        Add(decoration, -2); 
    557590    } 
    558591 
  • 2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRunContent/HillbillyRunContent.contentproj

    r6412 r6414  
    460460    </Compile> 
    461461  </ItemGroup> 
     462  <ItemGroup> 
     463    <Compile Include="paali.png"> 
     464      <Name>paali</Name> 
     465      <Importer>TextureImporter</Importer> 
     466      <Processor>TextureProcessor</Processor> 
     467    </Compile> 
     468  </ItemGroup> 
     469  <ItemGroup> 
     470    <Compile Include="tree1.png"> 
     471      <Name>tree1</Name> 
     472      <Importer>TextureImporter</Importer> 
     473      <Processor>TextureProcessor</Processor> 
     474    </Compile> 
     475    <Compile Include="tree2.png"> 
     476      <Name>tree2</Name> 
     477      <Importer>TextureImporter</Importer> 
     478      <Processor>TextureProcessor</Processor> 
     479    </Compile> 
     480    <Compile Include="tree3.png"> 
     481      <Name>tree3</Name> 
     482      <Importer>TextureImporter</Importer> 
     483      <Processor>TextureProcessor</Processor> 
     484    </Compile> 
     485  </ItemGroup> 
    462486  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    463487  <!--  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.