Ignore:
Timestamp:
2011-07-01 12:11:21 (9 years ago)
Author:
teeevasa
Message:

some final changes, such as removing unnecessary files etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/Peli.cs

    r2402 r2412  
    1414    Player player; 
    1515    Image background1 = LoadImage("Images/reactorInsideBG"); 
     16 
     17    // The sound effect intended for walking sounds close enough to ferocious aliens ripping your guts out 
     18    SoundEffect alienAttack = LoadSoundEffect("Sounds/walkingSound"); 
    1619 
    1720    public override void Begin() 
     
    7679        MediaPlayer.Stop(); 
    7780        // Starts playing the background music, which is set to repeat 
    78         MediaPlayer.Play("Sounds/Stage1Music"); 
     81        MediaPlayer.Play("Sounds/Stage2Music"); 
    7982        MediaPlayer.Volume = 0.75; 
    8083        MediaPlayer.IsRepeating = true; 
     
    97100    } 
    98101 
    99     void handleAlienCollision(MeleeAlien alien, Player player) 
     102    void handleAlienCollision(PhysicsObject alien, PhysicsObject target) 
    100103    { 
    101         player.reduceHitPointsBy(10); 
     104        if (target.Tag == "Player") 
     105        { 
     106            alienAttack.Play(); 
     107            player.reduceHitPointsBy(10); 
     108        } 
    102109    } 
    103110 
     
    124131    { 
    125132        MeleeAlien meleeAlien = new MeleeAlien(45, 80, Shape.Rectangle, 50, player); 
     133        AddCollisionHandler(meleeAlien, handleAlienCollision); 
    126134        return meleeAlien; 
    127135    } 
Note: See TracChangeset for help on using the changeset viewer.