Changeset 6407 for 2015/26


Ignore:
Timestamp:
2015-06-25 23:19:17 (4 years ago)
Author:
sieerinn
Message:

Kolmanteen kenttään pohjalle laavaa.

Location:
2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun
Files:
1 added
3 edited

Legend:

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

    r6405 r6407  
    205205 
    206206    private Image lavaWallImage = LoadImage("lavawall"); 
     207    private Image lavaFloorImage = LoadImage("lavafloor"); 
    207208    private Image spikeImage = LoadImage("spikes"); 
    208209    private Image spikeLeftImage = LoadImage("spikeleft"); 
     
    492493        level.SetTileMethod(Color.FromHexCode("C600AC"), CreateSpike, spikeLeftImage); 
    493494 
     495        level.SetTileMethod(Color.FromHexCode("FF8C8C"), CreateLava); 
     496 
    494497        level.SetTileMethod(Color.FromHexCode("BADA55"), CreatePrisoner); // Lempivärini. 
    495498 
     
    660663        spike.Tag = "burn"; 
    661664        Add(spike); 
     665    } 
     666 
     667    void CreateLava(Vector position, double width, double height) 
     668    { 
     669        GameObject lava = new GameObject(width * 13, height * 5); 
     670        lava.Image = lavaFloorImage; 
     671        lava.Position = position; 
     672        lava.Left = position.X - width * 0.5; 
     673        lava.Bottom = position.Y - height * 0.5; 
     674        Add(lava, 3); 
     675 
     676        PhysicsObject lavaCollision = PhysicsObject.CreateStaticObject(width * 13, height); 
     677        lavaCollision.IsVisible = false; 
     678        lavaCollision.Position = position; 
     679        lavaCollision.Left = position.X - width * 0.5; 
     680        lavaCollision.Tag = "lava"; 
     681        Add(lavaCollision); 
    662682    } 
    663683 
  • 2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRunContent/HillbillyRunContent.contentproj

    r6405 r6407  
    439439    </Compile> 
    440440  </ItemGroup> 
     441  <ItemGroup> 
     442    <Compile Include="lavafloor.png"> 
     443      <Name>lavafloor</Name> 
     444      <Importer>TextureImporter</Importer> 
     445      <Processor>TextureProcessor</Processor> 
     446    </Compile> 
     447  </ItemGroup> 
    441448  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    442449  <!--  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.