Ignore:
Timestamp:
2016-07-03 09:01:24 (3 years ago)
Author:
sieerinn
Message:

Kerättävää rahee

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2016/27/SimoR/SimplePhysicsTest/SimplePhysicsTest/SimplePhysicsTest/SimplePhysicsTest.cs

    r7647 r7648  
    159159        tilemap.SetTileMethod(Color.FromHexCode("C6723D"), CreateOneWayTile); 
    160160        tilemap.SetTileMethod(Color.FromHexCode("00FFFF"), CreateIceTile); 
    161         tilemap.SetTileMethod(Color.FromHexCode("FFFF00"), CreateMovingPlatform); 
     161        tilemap.SetTileMethod(Color.FromHexCode("D525DB"), CreateMovingPlatform); 
    162162        tilemap.SetTileMethod(Color.FromHexCode("B70909"), CreateDangerousBlock); 
    163163        tilemap.SetTileMethod(Color.FromHexCode("FFB949"), CreateDestroyableBrick); 
     164        tilemap.SetTileMethod(Color.FromHexCode("FFFF00"), CreateCoin); 
    164165        tilemap.SetTileMethod(Color.Blue, CreatePlayer); 
    165166        tilemap.SetTileMethod(Color.Red, CreateEnemy); 
     
    245246        player1.AddCollisionHandler("enemy", HitsEnemy); 
    246247        player1.AddCollisionHandler("death", (a, b) => player1.Destroy()); 
     248        player1.AddCollisionHandler("coin", (a, b) => b.Destroy()); 
    247249    } 
    248250 
     
    262264        enemy.FallOffPlatforms = true; 
    263265        Add(enemy); 
     266    } 
     267 
     268    private void CreateCoin(int x, int y) 
     269    { 
     270        var coin = new SimplePhysics.Object(TileSize * 0.99, TileSize * 0.99); 
     271        coin.Position = TileToWorldPosition(x, y); 
     272        coin.Tag = "coin"; 
     273        coin.Color = Color.Yellow; 
     274        coin.IgnoresCollisionResponse = true; 
     275        coin.IgnoresGravity = true; 
     276        Add(coin); 
    264277    } 
    265278 
Note: See TracChangeset for help on using the changeset viewer.