Changeset 2286
- Timestamp:
- 2011-06-29 13:33:46 (12 years ago)
- 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 12 12 GenWeapon(string weaponName) 13 13 { 14 14 loadWeapon(weaponName); 15 15 } 16 16 … … 26 26 } 27 27 28 struct Weapon28 public struct Weapon 29 29 { 30 30 private int reloadTime; -
2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/Peli.cs
r2276 r2286 19 19 createLevel(); 20 20 21 //MediaPlayer.Play("SuperMetroidCrateriaSurface.wma"); 21 MediaPlayer.Play("Sounds/Stage1Music"); 22 MediaPlayer.Volume = 0.5; 22 23 23 24 Camera.Follow(player); -
2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/Player.cs
r2276 r2286 8 8 public class Player : GenCharacter 9 9 { 10 int speed = 200;10 const int speed = 200; 11 11 const int jumpSpeed = 1000; 12 const int mass = 10; 12 13 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 14 18 15 19 public Player(double width, double height, Shape shape) … … 19 23 AddedToGame += addControls; 20 24 this.Image = portrait; 25 26 walker = new Timer(); 27 walker.Interval = 1.0; 28 walker.Trigger += playWalkingSound; 29 21 30 } 22 31 23 p ublicvoid addControls()32 private void addControls() 24 33 { 25 34 Game.Keyboard.Listen(Key.Right, ButtonState.Down, moveRight, "Moves right", speed); … … 28 37 } 29 38 30 p ublic void moveRight(int speed)39 private void playWalkingSound(Timer sender) 31 40 { 32 this.Walk(speed); 33 //this.Image = Image.Mirror(portrait); 34 41 this.walking.Play(); 35 42 } 36 43 37 p ublic void moveLeft(int speed)44 private void moveRight(int speed) 38 45 { 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(); 39 54 this.Walk(-speed); 40 55 this.Image = Image.Mirror(portrait); 41 this.walking.Play();42 56 } 43 57 -
2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/Weapons.cs
r2280 r2286 20 20 public static class Weapons 21 21 { 22 /*public static Weapon Pistol()22 public static Weapon Pistol() 23 23 { 24 24 return new Weapon( … … 29 29 "", 30 30 "Sounds/pistolshot"); 31 } 32 33 /*public static Weapon Rifle() 34 { 35 31 36 }*/ 32 37 } -
2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372Content/Rogue Agent 2372Content.contentproj
r2280 r2286 108 108 </Compile> 109 109 </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> 110 117 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 111 118 <!-- 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.