Changeset 6198


Ignore:
Timestamp:
2015-06-23 18:52:32 (4 years ago)
Author:
empaheik
Message:

Lell talosia.

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

Legend:

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

    r6197 r6198  
    3838    private Image[] supportStructureImages = LoadImages(""); 
    3939 
     40    private Image[] houseImages = LoadImages("house", "houseburned"); 
     41 
    4042    private Image cartImage = LoadImage("cart"); 
     43     
    4144    private Image cartWheelImage = LoadImage("cartwheel"); 
    4245    #endregion  
     
    135138        Window.Height = 900; 
    136139 
    137         Camera.X = cameraTargetX = players[0].X; 
    138         //Camera.ZoomToLevel(); 
     140        //Camera.X = cameraTargetX = players[0].X; 
     141        Camera.ZoomToLevel(); 
    139142 
    140143        Timer cameraTimer = new Timer(); 
     
    144147    } 
    145148 
     149    #region ElementCreation 
    146150    void CreateLevel() 
    147151    { 
     
    151155        level.SetTileMethod(Color.Black, CreateGroundTop); 
    152156        level.SetTileMethod(Color.Brown, CreateGround); 
    153         level.SetTileMethod(Color.Cyan, CreateDummy, Color.Cyan);   //TODO: CreatePlatform 
     157        level.SetTileMethod(Color.Cyan, CreateHouse); 
     158        level.SetTileMethod(Color.PaintDotNetBlue, CreateBurnedHouse); 
    154159        level.SetTileMethod(Color.Gold, CreatePlayer); 
    155160        level.SetTileMethod(Color.Rose, CreateDummy, Color.Rose);   //TODO: CreateFlame 
    156161        level.SetTileMethod(Color.Harlequin, CreateCart); 
    157162        level.SetTileMethod(Color.White, CreateDummy, Color.White); //TODO: CreateSmoke 
    158         level.SetTileMethod(Color.PaintDotNetBlue, CreateDummy, Color.PaintDotNetBlue); //TODO: CreateImprovement 
     163        //level.SetTileMethod(Color.PaintDotNetBlue, CreateDummy, Color.PaintDotNetBlue);  
    159164        level.SetTileMethod(Color.DarkGray, CreateDummy, Color.DarkGray);   //TODO: CreateTombStone 
    160165        level.SetTileMethod(Color.Gray, CreateDummy, Color.Gray);  //TODO: CreateCrawly 
    161166        level.SetTileMethod(Color.Red, CreateDummy, Color.Red);    //TODO: CreateWitch 
    162167        level.Execute(TILE_SIZE, TILE_SIZE); 
     168        level.Optimize(Color.Black, Color.Brown); 
    163169 
    164170 
     
    172178 
    173179        SetControls(); 
     180    } 
     181 
     182    void CreateHouse(Vector position, double width, double height) 
     183    { 
     184        // Näkyvä talo 
     185        GameObject house = new GameObject(width * 10, height * 8); 
     186        house.Image = houseImages[0]; 
     187        house.Position = position - new Vector(0, height * 2.5); 
     188        Add(house, -2); 
     189 
     190        PhysicsObject platform = PhysicsObject.CreateStaticObject(house.Width - (TILE_SIZE * 4), 5); 
     191        platform.IsVisible = false; 
     192        platform.Position = new Vector(house.X + TILE_SIZE, house.Top); 
     193        Add(platform); 
     194    } 
     195 
     196    void CreateBurnedHouse(Vector position, double width, double height) 
     197    { 
     198        GameObject house = new GameObject(width * 10, height * 8); 
     199        house.Image = houseImages[1]; 
     200        house.Position = position - new Vector(0, height * 2.5); 
     201        Add(house, -2); 
     202 
     203        PhysicsObject platform = PhysicsObject.CreateStaticObject(house.Width* 0.25, 5); 
     204        platform.IsVisible = false; 
     205        platform.Position = new Vector(house.X + platform.Width * 0.5, house.Top); 
     206        Add(platform); 
    174207    } 
    175208 
     
    235268        Add(ground); 
    236269    } 
     270    #endregion 
    237271 
    238272    void SetControls() 
  • 2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRunContent/HillbillyRunContent.contentproj

    r6197 r6198  
    8686    </Compile> 
    8787  </ItemGroup> 
     88  <ItemGroup> 
     89    <Compile Include="house.png"> 
     90      <Name>house</Name> 
     91      <Importer>TextureImporter</Importer> 
     92      <Processor>TextureProcessor</Processor> 
     93    </Compile> 
     94  </ItemGroup> 
     95  <ItemGroup> 
     96    <Compile Include="houseburned.png"> 
     97      <Name>houseburned</Name> 
     98      <Importer>TextureImporter</Importer> 
     99      <Processor>TextureProcessor</Processor> 
     100    </Compile> 
     101  </ItemGroup> 
    88102  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    89103  <!--  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.