Changeset 6544 for 2015/27/ohjaajat


Ignore:
Timestamp:
2015-06-29 21:27:11 (4 years ago)
Author:
empaheik
Message:
 
Location:
2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/LevelCreation.cs

    r6539 r6544  
    1616        level.SetTileMethod("foreground", CreateForegroundTile); 
    1717        level.SetObjectMethod("exit", CreateExit); 
     18        level.SetTileMethod("decoration", CreateDecoration); 
     19        level.SetObjectMethod("player", CreatePlayer); 
    1820        level.Execute(); 
    1921 
     
    2224 
    2325    /// <summary> 
    24     /// Maassa oleva perus tiili. 
     26    /// Luo pelaajan. 
     27    /// </summary> 
     28    void CreatePlayer(Vector position, double width, double height, Angle angle, Shape shape, string name, Dictionary<string, string> properties) 
     29    { 
     30        player = new Creature(TILE_SIZE, TILE_SIZE); 
     31        player.MovementSpeed = 2300; 
     32        player.Position = position; 
     33        Add(player, 1); 
     34 
     35        AddCollisionHandler(player, "exit", CollidesWithExit); 
     36    } 
     37 
     38    /// <summary> 
     39    /// Maassa oleva tiili. 
    2540    /// </summary> 
    2641    void CreateBaseTile(Vector position, double width, double height, Image image, string layerName, Dictionary<string, string> properties) 
     
    3045 
    3146    /// <summary> 
    32     /// Pelaajan päällä näkyvä perus tiili. 
     47    /// Pohjan päällä, pelaajan alla näkyvä tiili. 
     48    /// </summary> 
     49    void CreateDecoration(Vector position, double width, double height, Image image, string layerName, Dictionary<string, string> properties) 
     50    { 
     51        CreateBasicTile(position, width, height, image, 0, properties); 
     52    } 
     53 
     54        /// <summary> 
     55    /// Pelaajan päällä näkyvä tiili. 
    3356    /// </summary> 
    3457    void CreateForegroundTile(Vector position, double width, double height, Image image, string layerName, Dictionary<string, string> properties) 
    3558    { 
    36         CreateBasicTile(position, width, height, image, 1, properties); 
     59        CreateBasicTile(position, width, height, image, 2, properties); 
    3760    } 
    3861 
  • 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel.cs

    r6543 r6544  
    7070    { 
    7171        ClearAll(); 
    72         CreateLevel("testlevel3"); 
    73         CreatePlayer(new Vector(30, -30)); 
     72        CreateLevel("level1"); 
     73      //  CreatePlayer(new Vector(-Level.Width/3, Level.Bottom + TILE_SIZE * 2)); 
    7474        SetControls(); 
    7575        Camera.ZoomToLevel(); 
     
    8686    } 
    8787 
    88     /// <summary> 
    89     /// Luo pelaajan. 
    90     /// </summary> 
    91     void CreatePlayer(Vector position) 
    92     { 
    93         player = new Creature(TILE_SIZE, TILE_SIZE); 
    94         player.MovementSpeed = 2300; 
    95         player.Position = position; 
    96         Add(player); 
    97  
    98         AddCollisionHandler(player, "exit", CollidesWithExit); 
    99     } 
     88    ///// <summary> 
     89    ///// Luo pelaajan. 
     90    ///// </summary> 
     91    //void CreatePlayer(Vector position) 
     92    //{ 
     93    //    player = new Creature(TILE_SIZE, TILE_SIZE); 
     94    //    player.MovementSpeed = 2300; 
     95    //    player.Position = position; 
     96    //    Add(player); 
     97 
     98    //    AddCollisionHandler(player, "exit", CollidesWithExit); 
     99    //} 
    100100 
    101101    void CollidesWithExit(PhysicsObject pPlayer, PhysicsObject pExit) 
  • 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabrielContent/TheLegendOfGabrielContent.contentproj

    r6543 r6544  
    8585  </ItemGroup> 
    8686  <ItemGroup> 
    87     <Compile Include="testlevel3.tmx"> 
    88       <Name>testlevel3</Name> 
     87    <Compile Include="level1.tmx"> 
     88      <Name>level1</Name> 
    8989      <Importer>TextFileImporter</Importer> 
    9090      <Processor>TextFileContentProcessor</Processor> 
  • 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabrielContent/testlevel3.tmx

    r6543 r6544  
    11<?xml version="1.0" encoding="UTF-8"?> 
    2 <map version="1.0" orientation="orthogonal" renderorder="right-down" width="25" height="40" tilewidth="20" tileheight="20" nextobjectid="1"> 
     2<map version="1.0" orientation="orthogonal" renderorder="right-down" width="25" height="40" tilewidth="20" tileheight="20" nextobjectid="24"> 
    33 <tileset firstgid="1" name="testlevel4" tilewidth="20" tileheight="20"> 
    44  <image source="tileset.png" width="200" height="200"/> 
     
    1717  </data> 
    1818 </layer> 
    19  <objectgroup name="exit"/> 
     19 <objectgroup color="#65e2d8" name="exit"> 
     20  <properties> 
     21   <property name="goto" value="level2@top"/> 
     22  </properties> 
     23  <object id="19" x="100" y="0" width="20" height="20"> 
     24   <properties> 
     25    <property name="goto" value="testlevel@left"/> 
     26   </properties> 
     27  </object> 
     28  <object id="22" name="bottom" x="100" y="780" width="20" height="20"> 
     29   <properties> 
     30    <property name="goto" value="testlevel2@top"/> 
     31   </properties> 
     32  </object> 
     33 </objectgroup> 
    2034</map> 
Note: See TracChangeset for help on using the changeset viewer.