Ignore:
Timestamp:
2016-07-03 15:56:32 (3 years ago)
Author:
sieerinn
Message:
 
Location:
2016/27/ohjaajat/VenienteFragore/VenienteFragore/VenienteFragore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 2016/27/ohjaajat/VenienteFragore/VenienteFragore/VenienteFragore

    • Property svn:global-ignores
      •  

        old new  
         1*.cachefile 
        12bin 
        23obj 
  • 2016/27/ohjaajat/VenienteFragore/VenienteFragore/VenienteFragore/VenienteFragore.cs

    r7653 r7658  
    1515    public override void Begin() 
    1616    { 
    17         // Kirjoita ohjelmakoodisi tähän 
     17        var tileMap = TiledTileMap.FromLevelAsset("testi"); 
     18        tileMap.SetTileMethod("Tile Layer 1", TileMethod); 
     19        tileMap.SetObjectMethod("Object Layer 1", ObjectMethod); 
     20        tileMap.Execute(); 
     21 
     22        Gravity = new Vector(0, -800); 
    1823 
    1924        PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
     
    2126 
    2227    } 
     28 
     29    private void ObjectMethod(Vector position, double width, double height, Angle angle, Shape shape, string name, Dictionary<string, string> properties) 
     30    { 
     31        var testObject = new SimplePhysics.Object(TileSize * 0.99, TileSize * 0.99); 
     32        testObject.Position = position; 
     33        testObject.Color = Color.DarkGreen; 
     34        testObject.Shape = Shape.Circle; 
     35        testObject.RestitutionX = 0.5; 
     36        testObject.RestitutionY = 0.5; 
     37        testObject.CollisionIgnoreGroup = 1; 
     38        Add(testObject); 
     39    } 
     40 
     41    private void TileMethod(int x, int y, Image image, string layerName, Dictionary<string, string> properties) 
     42    { 
     43        var tile = new SimplePhysics.Object(TileSize, TileSize) { IsStatic = true }; 
     44        tile.Image = image; 
     45        Add(tile); 
     46        SetTile(x, y, tile); 
     47    } 
    2348} 
Note: See TracChangeset for help on using the changeset viewer.