Changeset 8918 for 2017


Ignore:
Timestamp:
2017-07-05 13:08:19 (2 years ago)
Author:
sieerinn
Message:

Räjähdykset ja aivot.

Location:
2017/27/SimoR
Files:
5 added
9 edited

Legend:

Unmodified
Added
Removed
  • 2017/27/SimoR/Pong/Pong/Pong/Pong.cs

    r8903 r8918  
    1111    double nopeus = 500; 
    1212    PhysicsObject pelaaja; 
     13 
     14    Image pumKuva = LoadImage("pum"); 
    1315 
    1416    public override void Begin() 
     
    2527 
    2628        AddCollisionHandler(pelaaja, "pallo", OsuiPalloon); 
    27         AddCollisionHandler(pelaaja, "pahapallo", OsuiPahaPalloon); 
     29        AddCollisionHandler(pelaaja, "pahapallo", OsuiPahaanPalloon); 
     30    } 
     31 
     32    void LuoVihollinen() 
     33    { 
     34        PhysicsObject vihu = new PhysicsObject(30, 30); 
     35        vihu.Tag = "vihollinen"; 
     36        vihu.Shape = Shape.Circle; 
     37        vihu.Color = Color.Blue; 
     38        vihu.X = -300; 
     39        Add(vihu); 
     40 
     41        FollowerBrain seuraajanAivot = new FollowerBrain(pelaaja); 
     42        seuraajanAivot.Speed = 50;                 // Millä nopeudella kohdetta seurataan 
     43        seuraajanAivot.DistanceFar = 600;           // Etäisyys jolla aletaan seurata kohdetta 
     44        seuraajanAivot.DistanceClose = 100;         // Etäisyys jolloin ollaan lähellä kohdetta 
     45        seuraajanAivot.StopWhenTargetClose = true;  // Pysähdytään kun ollaan lähellä kohdetta 
     46        seuraajanAivot.TurnWhileMoving = true; 
     47        //seuraajanAivot.FarBrain = satunnaisAivot; 
     48 
     49        vihu.Brain = seuraajanAivot; 
     50 
     51        AssaultRifle ase = new AssaultRifle(60, 20); 
     52        ase.ProjectileCollision = AmmusOsui; 
     53        ase.FireRate = 900; 
     54        vihu.Add(ase); 
     55 
     56        Timer ajastin = new Timer(); 
     57        ajastin.Interval = 0.02; 
     58        ajastin.Timeout += delegate { AmmuAseella(ase); }; 
     59        ajastin.Start(); 
     60    } 
     61 
     62    void AmmuAseella(AssaultRifle ase) 
     63    { 
     64        PhysicsObject ammus = ase.Shoot(); 
     65 
     66        if (ammus != null) 
     67        { 
     68            //ammus.Size *= 3; 
     69            //ammus.Image = ... 
     70            //ammus.MaximumLifetime = TimeSpan.FromSeconds(2.0); 
     71        } 
     72    } 
     73 
     74    void AmmusOsui(PhysicsObject ammus, PhysicsObject kohde) 
     75    { 
     76        ammus.Destroy(); 
    2877    } 
    2978 
     
    3483    } 
    3584 
    36     void OsuiPahaPalloon(PhysicsObject tormaaja, PhysicsObject kohde) 
     85    void OsuiPahaanPalloon(PhysicsObject tormaaja, PhysicsObject kohde) 
    3786    { 
    3887        tormaaja.Size *= 0.8; 
    3988        kohde.Destroy(); 
     89 
     90        Explosion rajahdys = new Explosion(50); 
     91        rajahdys.Image = pumKuva; 
     92        rajahdys.Position = kohde.Position; 
     93        Add(rajahdys); 
    4094    } 
    4195 
     
    46100 
    47101        LuoPelaaja(); 
     102        LuoVihollinen(); 
    48103 
    49104        for (int i = 0; i < 120; i++) 
  • 2017/27/SimoR/Pong/Pong/Pong/obj/x86/Debug/ContentPipeline-{B5657C23-C28C-451B-852B-8C591DFB28DC}.xml

    r8813 r8918  
    22<XnaContent xmlns:Pipeline="Microsoft.Xna.Framework.Content.Pipeline"> 
    33  <Asset Type="Pipeline:BuildItemCollection"> 
     4    <Item> 
     5      <Source>pum.png</Source> 
     6      <Name>pum</Name> 
     7      <Importer>TextureImporter</Importer> 
     8      <Processor>TextureProcessor</Processor> 
     9      <Options>None</Options> 
     10      <Output>C:\MyTemp\SimoR\Pong\Pong\Pong\bin\x86\Debug\Content\pum.xnb</Output> 
     11      <Time>2017-07-05T13:06:20.7648151+03:00</Time> 
     12    </Item> 
    413    <BuildSuccessful>true</BuildSuccessful> 
    514    <Settings> 
     
    1625    <Assemblies> 
    1726      <Assembly> 
     27        <Key>C:\Program Files (x86)\Jypeli\lib\ContentExtensions\TextFileContentExtension.dll</Key> 
     28        <Value>2015-02-09T20:18:44+02:00</Value> 
     29      </Assembly> 
     30      <Assembly> 
     31        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.XImporter.dll</Key> 
     32        <Value>2011-09-01T16:22:30+03:00</Value> 
     33      </Assembly> 
     34      <Assembly> 
     35        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.VideoImporters.dll</Key> 
     36        <Value>2011-09-01T16:22:30+03:00</Value> 
     37      </Assembly> 
     38      <Assembly> 
     39        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.TextureImporter.dll</Key> 
     40        <Value>2011-09-01T16:22:30+03:00</Value> 
     41      </Assembly> 
     42      <Assembly> 
     43        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.FBXImporter.dll</Key> 
     44        <Value>2011-09-01T16:22:30+03:00</Value> 
     45      </Assembly> 
     46      <Assembly> 
     47        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.EffectImporter.dll</Key> 
     48        <Value>2011-09-01T16:22:30+03:00</Value> 
     49      </Assembly> 
     50      <Assembly> 
     51        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.AudioImporters.dll</Key> 
     52        <Value>2011-09-01T16:22:30+03:00</Value> 
     53      </Assembly> 
     54      <Assembly> 
     55        <Key>C:\Program Files (x86)\Jypeli\lib\ContentExtensions\AnimationExtension.dll</Key> 
     56        <Value>2015-02-17T22:27:18+02:00</Value> 
     57      </Assembly> 
     58      <Assembly> 
    1859        <Key>C:\Windows\Microsoft.Net\assembly\GAC_32\Microsoft.Xna.Framework.Content.Pipeline\v4.0_4.0.0.0__842cf8be1de50553\Microsoft.Xna.Framework.Content.Pipeline.dll</Key> 
    1960        <Value>2016-06-13T14:34:23.3940496+03:00</Value> 
  • 2017/27/SimoR/Pong/Pong/Pong/obj/x86/Debug/Pong.csproj.FileListAbsolute.txt

    r8813 r8918  
    77C:\MyTemp\SimoR\Pong\Pong\Pong\obj\x86\Debug\Pong.exe 
    88C:\MyTemp\SimoR\Pong\Pong\Pong\obj\x86\Debug\Pong.pdb 
     9C:\MyTemp\SimoR\Pong\Pong\Pong\bin\x86\Debug\Content\pum.xnb 
  • 2017/27/SimoR/Pong/Pong/PongContent/PongContent.contentproj

    r8813 r8918  
    4545    <Reference Include="AnimationExtension" /> 
    4646  </ItemGroup> 
     47  <ItemGroup> 
     48    <Compile Include="pum.png"> 
     49      <Name>pum</Name> 
     50      <Importer>TextureImporter</Importer> 
     51      <Processor>TextureProcessor</Processor> 
     52    </Compile> 
     53  </ItemGroup> 
    4754  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    4855  <!--  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.