Exemplo n.º 1
0
 // Called when this platform has been hit by the player.
 public void OnContact(Player contactBy)
 {
     hit = true;
        Game.PlaySound(crackSound);
 }
Exemplo n.º 2
0
 public void OnContact(Player contactBy)
 {
     contactBy.OnKilled(null);
 }
Exemplo n.º 3
0
        // Instantiates a player, puts him in the level, and remembers where to put him when he is resurrected.
        private Tile LoadStartTile(int x, int y)
        {
            if (Player != null)
                throw new NotSupportedException("A level may only have one starting point.");

            start = RectangleExtensions.GetBottomCenter(GetBounds(x, y));
            // Loading main world after finishing or quiting a level
            if (Level.IsMainWorld && LoadMainWorldFromLevel)
                player = new Player(this, LastMainLevelCheckPoint);
            // Loading main world at beginning of game
            else if (Level.IsMainWorld)
            {
                LastMainLevelCheckPoint = start;
                player = new Player(this, LastMainLevelCheckPoint);
            }
            // Loading a normal level (from main world)
            else
            {
                lastCheckPoint = start;
                player = new Player(this, lastCheckPoint);
            }

            return new Tile(null, TileCollision.Passable);
        }
Exemplo n.º 4
0
        // Called when a gem is collected.
        private void OnGemCollected(Gem gem, Player collectedBy)
        {
            score += Gem.PointValue;

            gem.OnCollected(collectedBy);
        }
Exemplo n.º 5
0
Arquivo: Gem.cs Projeto: bmh10/RedMan
 // Called when this gem has been collected by a player and removed from the level.
 public void OnCollected(Player collectedBy)
 {
     Game.PlaySound(collectedSound);
 }