Changeset 4755 for 2013


Ignore:
Timestamp:
2013-09-07 16:59:23 (6 years ago)
Author:
dezhidki
Message:

Testailu äänien kanssa (täällä hetkellä pois päältä)

Location:
2013/30/DenisZ/CastleMaster/CastleMaster
Files:
14 added
6 edited

Legend:

Unmodified
Added
Removed
  • 2013/30/DenisZ/CastleMaster/CastleMaster/CastleMaster/CastleMaster.csproj

    r4752 r4755  
    6565    <Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" /> 
    6666    <Reference Include="Microsoft.Xna.Framework.GamerServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" /> 
     67    <Reference Include="Microsoft.Xna.Framework.Xact, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" /> 
    6768    <Reference Include="mscorlib" /> 
    6869    <Reference Include="System" /> 
     
    115116    <Compile Include="Program.cs" /> 
    116117    <Compile Include="Game.cs" /> 
     118    <Compile Include="Sound\Sound2D.cs" /> 
    117119    <Compile Include="Units\Mobs\Mob.cs" /> 
    118120    <Compile Include="Units\Mobs\MobRanger.cs" /> 
  • 2013/30/DenisZ/CastleMaster/CastleMaster/CastleMaster/Game.cs

    r4754 r4755  
    33using CastleMaster.Input; 
    44using CastleMaster.Players; 
     5using CastleMaster.Sound; 
    56using CastleMaster.World; 
    67using Microsoft.Xna.Framework; 
     
    3435        private bool isGameRunning = false; 
    3536        private static Game instance; 
     37        private Sound2D sound; 
    3638 
    3739        #region Counter 
     
    138140            level = new LevelForest(Content.Load<Texture2D>("levels/levelForest")); 
    139141            camera = new Camera(level); 
     142            sound.Camera = camera; 
    140143            AddPlayer(new PlayerReal(TEAM1, level, camera)); 
    141144            AddPlayer(new PlayerAI(TEAM2, level, camera, PlayerAI.DIFFICULTY_EASY, players[0])); 
     
    173176            TEAM1 = new Team("BLUE", 0, Resources.SPRITESHEET_WOODCUTTER_BLU, Resources.SPRITESHEET_WARRIOR_BLU, Resources.SPRITESHEET_RANGER_BLU); 
    174177            TEAM2 = new Team("RED", 1, Resources.SPRITESHEET_WOODCUTTER_RED, Resources.SPRITESHEET_WARRIOR_RED, Resources.SPRITESHEET_RANGER_RED); 
     178            sound = new Sound2D("Content\\sound\\test.xgs", "Content\\sound\\testwavebank.xwb", "Content\\sound\\testsoundbank.xsb"); 
    175179        } 
    176180 
     
    193197        protected override void Update(GameTime gameTime) 
    194198        { 
     199            //sound.Engine.Update(); 
    195200            input.Update(); 
    196201 
     
    225230                    if (p != null) 
    226231                        p.Update(); 
     232                //players[0].Update(); 
    227233 
    228234                camera.Update(); 
  • 2013/30/DenisZ/CastleMaster/CastleMaster/CastleMaster/Graphics/Camera.cs

    r4754 r4755  
    5353        public void Update() 
    5454        { 
    55              
    56  
    5755            mouseWorldPos = Viewport.ScreenToWorld(InputHandler.MouseX + xOffs, InputHandler.MouseY + yOffs); 
    5856            int xTile = (int)(mouseWorldPos.X / Viewport.TILESIZE); 
     
    7270            } 
    7371 
    74              
     72 
    7573        } 
    7674 
  • 2013/30/DenisZ/CastleMaster/CastleMaster/CastleMaster/Program.cs

    r4754 r4755  
     1using CastleMaster.Errors; 
     2using System; 
    13namespace CastleMaster 
    24{ 
  • 2013/30/DenisZ/CastleMaster/CastleMaster/CastleMaster/Units/Mobs/MobWoodcutter.cs

    r4754 r4755  
    22using CastleMaster.Graphics; 
    33using CastleMaster.Players; 
     4using CastleMaster.Sound; 
    45using CastleMaster.World; 
    56using IsometricEngineTest.Ai.Orders; 
     7using Microsoft.Xna.Framework; 
     8using Microsoft.Xna.Framework.Audio; 
    69 
    710namespace CastleMaster.Units.Mobs 
     
    1720        private OrderType currentOrderType = OrderType.NONE; 
    1821        private int lastSameOrderAmount = 0; 
     22        private AudioEmitter emmitter; 
    1923 
    2024        public MobWoodcutter(Level level, Player owner) 
    2125            : base(level, owner) 
    2226        { 
     27            emmitter = new AudioEmitter(); 
    2328            HasHealth = true; 
    2429            maxHealth = 20; 
     
    6368        } 
    6469 
     70        public override void OnFocus() 
     71        { 
     72            //emmitter.Position = new Vector3(ScreenPos.X, 0.0F, ScreenPos.Y); 
     73            //Sound2D.PlaySound3D(emmitter, "testsound"); 
     74        } 
     75 
    6576        private void StartChopping() 
    6677        { 
     
    7990        public override void OnFunctionClick(float x, float z, int sameOrderAmount, bool wasCalledBefore) 
    8091        { 
     92            //emmitter.Position = new Vector3(ScreenPos.X, 0.0F, ScreenPos.Y); 
     93            //Sound2D.PlaySound3D(emmitter, "testsound"); 
    8194            TileEntity te = level.GetTileEntity(this, (int)(x / Viewport.TILESIZE), (int)(z / Viewport.TILESIZE)); 
    8295            if (te != null && typeof(TileEntityTree).IsAssignableFrom(te.GetType())) 
  • 2013/30/DenisZ/CastleMaster/CastleMaster/CastleMasterContent/CastleMasterContent.contentproj

    r4753 r4755  
    201201    </Compile> 
    202202  </ItemGroup> 
     203  <ItemGroup> 
     204    <None Include="sound\test.xgs"> 
     205      <Name>test</Name> 
     206      <Importer>XactImporter</Importer> 
     207      <Processor>XactProcessor</Processor> 
     208      <CopyToOutputDirectory>Always</CopyToOutputDirectory> 
     209    </None> 
     210    <None Include="sound\testsoundbank.xsb"> 
     211      <Name>testsoundbank</Name> 
     212      <Importer>XactImporter</Importer> 
     213      <Processor>XactProcessor</Processor> 
     214      <CopyToOutputDirectory>Always</CopyToOutputDirectory> 
     215    </None> 
     216    <None Include="sound\testwavebank.xwb"> 
     217      <Name>testwavebank</Name> 
     218      <Importer>XactImporter</Importer> 
     219      <Processor>XactProcessor</Processor> 
     220      <CopyToOutputDirectory>Always</CopyToOutputDirectory> 
     221    </None> 
     222  </ItemGroup> 
    203223  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    204224  <!--  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.