Ignore:
Timestamp:
2015-06-29 18:18:31 (6 years ago)
Author:
sieerinn
Message:

Kenttäsiirtymä on melko valmis.

File:
1 edited

Legend:

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

    r6538 r6539  
    88{ 
    99    /// <summary> 
    10     /// Luo pelaajan. 
    11     /// </summary> 
    12     void CreatePlayer(Vector position) 
    13     { 
    14         player = new Creature(TILE_SIZE, TILE_SIZE); 
    15         player.MovementSpeed = 2300; 
    16         player.Position = position; 
    17         Add(player); 
    18     } 
    19  
    20     /// <summary> 
    2110    /// Luo kentän .tmx tiedostosta. 
    2211    /// </summary> 
     
    2615        level.SetTileMethod("base", CreateBaseTile); 
    2716        level.SetTileMethod("foreground", CreateForegroundTile); 
     17        level.SetObjectMethod("exit", CreateExit); 
    2818        level.Execute(); 
    2919 
     
    5747        Add(tile, layer); 
    5848    } 
     49 
     50    /// <summary> 
     51    /// Luo uloskäynnin, joka vie toiseen kenttään. 
     52    /// </summary> 
     53    void CreateExit(Vector position, double width, double height, Angle angle, Shape shape, string name, Dictionary<string, string> properties) 
     54    { 
     55        var target = properties["goto"].Split('@'); // Jos peli kaatuaa tälle riville niin joltain exitiltä puuttuu goto-property. 
     56        var exit = new Exit(width, height); 
     57        exit.Position = position; 
     58        exit.TargetLevel = target[0]; 
     59        exit.TargetExitName = target[1]; 
     60        exit.Name = name; 
     61        Add(exit); 
     62        exits.Add(exit); 
     63    } 
    5964} 
Note: See TracChangeset for help on using the changeset viewer.