Changeset 2286 for 2011/26/JaakkoL


Ignore:
Timestamp:
2011-06-29 13:33:46 (8 years ago)
Author:
teeevasa
Message:
 
Location:
2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372
Files:
5 edited

Legend:

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

    r2280 r2286  
    1212    GenWeapon(string weaponName) 
    1313    { 
    14      
     14        loadWeapon(weaponName); 
    1515    } 
    1616 
     
    2626} 
    2727 
    28 struct Weapon 
     28public struct Weapon 
    2929{  
    3030    private int reloadTime; 
  • 2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/Peli.cs

    r2276 r2286  
    1919        createLevel(); 
    2020 
    21         //MediaPlayer.Play("SuperMetroidCrateriaSurface.wma"); 
     21        MediaPlayer.Play("Sounds/Stage1Music"); 
     22        MediaPlayer.Volume = 0.5; 
    2223 
    2324        Camera.Follow(player); 
  • 2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/Player.cs

    r2276 r2286  
    88public class Player : GenCharacter 
    99{ 
    10     int speed = 200; 
     10    const int speed = 200; 
    1111    const int jumpSpeed = 1000; 
     12    const int mass = 10; 
    1213    Image portrait = Game.LoadImage("Images/character"); 
    13     SoundEffect walking = Game.LoadSoundEffect("Sounds/pistolshot"); 
     14    SoundEffect walking = Game.LoadSoundEffect("Sounds/walkingsound"); 
     15 
     16    Timer walker; 
     17     
    1418 
    1519        public Player(double width, double height, Shape shape) 
     
    1923        AddedToGame += addControls; 
    2024        this.Image = portrait; 
     25 
     26        walker = new Timer(); 
     27        walker.Interval = 1.0; 
     28        walker.Trigger += playWalkingSound; 
     29 
    2130        } 
    2231 
    23     public void addControls() 
     32    private void addControls() 
    2433    { 
    2534        Game.Keyboard.Listen(Key.Right, ButtonState.Down, moveRight, "Moves right", speed); 
     
    2837    } 
    2938 
    30     public void moveRight(int speed) 
     39    private void playWalkingSound(Timer sender) 
    3140    { 
    32         this.Walk(speed); 
    33         //this.Image = Image.Mirror(portrait); 
    34  
     41        this.walking.Play(); 
    3542    } 
    3643 
    37     public void moveLeft(int speed) 
     44    private void moveRight(int speed) 
    3845    { 
     46        walker.Start(); 
     47        this.Walk(speed); 
     48        //this.Image = Image.Mirror(portrait); // Doesn't work at all! 
     49    } 
     50 
     51    private void moveLeft(int speed) 
     52    { 
     53        walker.Start(); 
    3954        this.Walk(-speed); 
    4055        this.Image = Image.Mirror(portrait); 
    41         this.walking.Play(); 
    4256    } 
    4357 
  • 2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/Weapons.cs

    r2280 r2286  
    2020public static class Weapons 
    2121{ 
    22     /*public static Weapon Pistol() 
     22    public static Weapon Pistol() 
    2323    { 
    2424        return new Weapon( 
     
    2929            "", 
    3030            "Sounds/pistolshot"); 
     31    } 
     32 
     33    /*public static Weapon Rifle() 
     34    {  
     35     
    3136    }*/ 
    3237} 
  • 2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372Content/Rogue Agent 2372Content.contentproj

    r2280 r2286  
    108108    </Compile> 
    109109  </ItemGroup> 
     110  <ItemGroup> 
     111    <Compile Include="Sounds\walkingsound.wav"> 
     112      <Name>walkingsound</Name> 
     113      <Importer>WavImporter</Importer> 
     114      <Processor>SoundEffectProcessor</Processor> 
     115    </Compile> 
     116  </ItemGroup> 
    110117  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    111118  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
Note: See TracChangeset for help on using the changeset viewer.