Changeset 7425 for 2016/24/PanuK


Ignore:
Timestamp:
2016-06-17 11:07:28 (3 years ago)
Author:
paerjuko
Message:
 
Location:
2016/24/PanuK/TrumpAttack
Files:
3 added
11 edited

Legend:

Unmodified
Added
Removed
  • 2016/24/PanuK/TrumpAttack/TrumpAttack/TrumpAttack/TrumpAttack.cs

    r7376 r7425  
    1212    Image Niggachukuva = LoadImage("Niggachu"); 
    1313    Image Doritoskuva = LoadImage("Dorito"); 
    14     Image Trumpkuva = LoadImage(""); 
     14    Image Trumpkuva = LoadImage("trumpV3"); 
    1515    AssaultRifle pelaajan1Ase; 
    1616    PhysicsObject kolmio; 
    1717    PhysicsObject Trump; 
     18    PhysicsObject Niggachu; 
     19    IntMeter trumppinhp; 
    1820    public override void Begin() 
    1921    { 
     22        trumppinhp = new IntMeter(5); 
     23        trumppinhp.LowerLimit += kuolee; 
    2024        valikko(); 
    2125       
     
    2327        MediaPlayer.PlayFromURL("https://www.youtube.com/watch?v=PJLSzsEjpWM"); 
    2428        MediaPlayer.IsRepeating = true; 
    25  
    2629      
    2730    } 
    28      void valikko() { 
     31    void kuolee() { 
     32        Trump.Destroy(); 
     33        Explosion rajahdys = new Explosion(500); 
     34        rajahdys.Position = Trump.Position; 
     35        Add(rajahdys); 
     36 
     37 
     38    } 
     39 
     40    void valikko() { 
    2941        MultiSelectWindow alkuValikko = new MultiSelectWindow("Pelin alkuvalikko", 
    3042"Aloita peli", "Lopeta"); 
     
    6173        Keyboard.Listen(Key.D, ButtonState.Released, 
    6274        liikutapelaajaa, "Pelaaja liikkuu oikeelle", Vector.Zero); 
    63         Keyboard.Listen(Key.Space, ButtonState.Down 
     75        Keyboard.Listen(Key.Space, ButtonState.Pressed 
    6476            , AmmuAseella, ""); 
    6577        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
     
    7789        //ammus.Destroy(); 
    7890    } 
     91 
     92    bool saakoAmpua = true; 
     93     
     94 
    7995    void AmmuAseella() 
    8096    { 
    81         PhysicsObject ammus = new PhysicsObject(50, 50); 
     97        if (!saakoAmpua) return; 
     98        PhysicsObject ammus = new PhysicsObject(35, 35); 
    8299        ammus.Image = Doritoskuva; 
    83100        Add(ammus); 
    84  
     101        ammus.Tag = "ammus"; 
    85102        ammus.Position = kolmio.Position + Vector.FromLengthAndAngle(50, kolmio.Angle); 
    86103        ammus.CollisionIgnoreGroup = kolmio.CollisionIgnoreGroup; 
     
    88105        ammus.Velocity = Vector.FromLengthAndAngle(150, kolmio.Angle); 
    89106 
     107        Timer.SingleShot(2.0, delegate { saakoAmpua = true; }); 
     108        saakoAmpua = false; 
    90109 
    91110        if (ammus != null) 
     
    106125    void LuoKentta() 
    107126    { 
    108         PhysicsObject muuri = new PhysicsObject(100, Screen.Height); 
    109         muuri.X = Screen.Left + 50; 
    110         muuri.Color = Color.Gray; 
    111         Add(muuri); 
    112  
    113127        kolmio = new PhysicsObject(100, 50); 
    114128        kolmio.Shape = Shape.Triangle; 
     129        kolmio.Position = new Vector(-200, 50); 
    115130        kolmio.Image = Illuminatikuva; 
    116131        kolmio.CollisionIgnoreGroup = 2; 
     
    121136        Trump.Image = Trumpkuva; 
    122137        Add(Trump); 
     138        AddCollisionHandler(Trump, "ammus", CollisionHandler.AddMeterValue(trumppinhp, -1)); 
     139        RandomMoverBrain aivot = new RandomMoverBrain(); 
     140        Trump.Brain = aivot; 
     141        aivot.Speed = 1500; 
    123142 
    124143        Level.CreateBorders(); 
     144        Level.Background.CreateGradient(Color.Purple, Color.DarkCyan); 
    125145 
    126146        Camera.ZoomToLevel(); 
  • 2016/24/PanuK/TrumpAttack/TrumpAttack/TrumpAttack/TrumpAttack.csproj.Debug.cachefile

    r7376 r7425  
    44Content\MuuriXDDDD.xnb 
    55Content\Niggachu.xnb 
     6Content\trumpV3.xnb 
  • 2016/24/PanuK/TrumpAttack/TrumpAttack/TrumpAttack/obj/x86/Debug/ContentPipeline-{F894E606-5C0B-4EBC-9AAE-F2B160A733EB}.xml

    r7376 r7425  
    4646      <Output>C:\MyTemp\PanuK\TrumpAttack\TrumpAttack\TrumpAttack\bin\x86\Debug\Content\Niggachu.xnb</Output> 
    4747      <Time>2016-06-15T13:36:04.8340357+03:00</Time> 
     48    </Item> 
     49    <Item> 
     50      <Source>trumpV3.png</Source> 
     51      <Name>trumpV3</Name> 
     52      <Importer>TextureImporter</Importer> 
     53      <Processor>TextureProcessor</Processor> 
     54      <Options>None</Options> 
     55      <Output>C:\MyTemp\PanuK\TrumpAttack\TrumpAttack\TrumpAttack\bin\x86\Debug\Content\trumpV3.xnb</Output> 
     56      <Time>2016-06-17T09:56:39.7975237+03:00</Time> 
    4857    </Item> 
    4958    <BuildSuccessful>true</BuildSuccessful> 
  • 2016/24/PanuK/TrumpAttack/TrumpAttack/TrumpAttack/obj/x86/Debug/TrumpAttack.csproj.FileListAbsolute.txt

    r7344 r7425  
    1212C:\MyTemp\PanuK\TrumpAttack\TrumpAttack\TrumpAttack\bin\x86\Debug\Content\MuuriXDDDD.xnb 
    1313C:\MyTemp\PanuK\TrumpAttack\TrumpAttack\TrumpAttack\bin\x86\Debug\Content\Niggachu.xnb 
     14C:\MyTemp\PanuK\TrumpAttack\TrumpAttack\TrumpAttack\bin\x86\Debug\Content\trumpV3.xnb 
  • 2016/24/PanuK/TrumpAttack/TrumpAttack/TrumpAttack/obj/x86/Debug/cachefile-{F894E606-5C0B-4EBC-9AAE-F2B160A733EB}-targetpath.txt

    r7344 r7425  
    44Content\MuuriXDDDD.xnb 
    55Content\Niggachu.xnb 
     6Content\trumpV3.xnb 
  • 2016/24/PanuK/TrumpAttack/TrumpAttack/TrumpAttackContent/TrumpAttackContent.contentproj

    r7344 r7425  
    7373    </Compile> 
    7474  </ItemGroup> 
     75  <ItemGroup> 
     76    <Compile Include="trumpV3.png"> 
     77      <Name>trumpV3</Name> 
     78      <Importer>TextureImporter</Importer> 
     79      <Processor>TextureProcessor</Processor> 
     80    </Compile> 
     81  </ItemGroup> 
    7582  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    7683  <!--  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.