Changeset 6541 for 2015/27


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

Testitalo lisätty.

Location:
2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel
Files:
1 added
3 edited

Legend:

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

    r6540 r6541  
    121121        CreateLevel(oldExit.TargetLevel); 
    122122 
     123        // Etsitään seuraavan kentän kohde exitti johon siirrytään. 
     124        var targetExit = exits.FirstOrDefault(e => e.Name == oldExit.TargetExitName); 
     125 
     126        // Jompikumpi uloskäynti ei ole kentän laidalla, sulava siirtyminen ei ole mahdollista. 
     127        if (GetExitDirection(targetExit) == Direction.None || GetExitDirection(oldExit) == Direction.None) 
     128        { 
     129            transition = false; 
     130            oldObjects.ForEach(o => o.Destroy()); 
     131            oldObjects.Clear(); 
     132 
     133            // Yritetään päätellä pelaajalle joku järkevä paikka. 
     134            player.Position = targetExit.Position + Direction.Inverse(targetExit.Position.Angle.MainDirection).GetVector() * TILE_SIZE * 2; 
     135            Camera.ZoomToLevel(); 
     136            return; 
     137        } 
     138 
    123139        // Pysäytetään peli siirtymän ajaksi. 
    124140        Pause(); 
    125141        PhysicsEnabled = false; 
    126  
    127         // Etsitään seuraavan kentän kohde exitti johon siirrytään. 
    128         var targetExit = exits.FirstOrDefault(e => e.Name == oldExit.TargetExitName); 
    129142 
    130143        // Lasketaan siirtymävektorit. 
     
    164177        const double epsilon = 1e-3; 
    165178        Func<double, double, bool> isSame = (x, y) => Math.Abs(y - x) < epsilon; 
    166          
     179 
    167180        if (isSame(exit.Top, Level.Top)) 
    168181        { 
  • 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabrielContent/TheLegendOfGabrielContent.contentproj

    r6538 r6541  
    7676    </Compile> 
    7777  </ItemGroup> 
     78  <ItemGroup> 
     79    <Compile Include="testhouse.tmx"> 
     80      <Name>testhouse</Name> 
     81      <Importer>TextFileImporter</Importer> 
     82      <Processor>TextFileContentProcessor</Processor> 
     83      <CopyToOutputDirectory>Always</CopyToOutputDirectory> 
     84    </Compile> 
     85  </ItemGroup> 
    7886  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    7987  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabrielContent/testlevel.tmx

    r6540 r6541  
    11<?xml version="1.0" encoding="UTF-8"?> 
    2 <map version="1.0" orientation="orthogonal" renderorder="right-down" width="20" height="15" tilewidth="20" tileheight="20" nextobjectid="3"> 
     2<map version="1.0" orientation="orthogonal" renderorder="right-down" width="20" height="15" tilewidth="20" tileheight="20" nextobjectid="4"> 
    33 <tileset firstgid="1" source="LegendOfGabrielTileset.tsx"/> 
    44 <layer name="base" width="20" height="15"> 
    55  <data encoding="base64" compression="zlib"> 
    6    eJxjYmBgYAJiZijNhIM/FDEzEqaGGcxIYuSGETY9lLqPmubhs4OW/kUPX1zxxoyFjU0tqfaim0GuecSGA650hc8d+NxHrDvR7SWUR2iRXom1GxsGAP4fApo= 
     6   eJxjYmBgYAJiZijNhINPTcyMBQ8289DNJqRuJGB6pAliwp1ctw6kedjyFy4/E5PeSEmThMRITeOUhiMl+RUA6asCiA== 
    77  </data> 
    88 </layer> 
     
    1818   </properties> 
    1919  </object> 
     20  <object id="3" name="house_out" x="200" y="60" width="40" height="20"> 
     21   <properties> 
     22    <property name="goto" value="testhouse@house_in"/> 
     23   </properties> 
     24  </object> 
    2025 </objectgroup> 
    2126</map> 
Note: See TracChangeset for help on using the changeset viewer.