Ignore:
Timestamp:
2017-11-18 14:59:00 (2 years ago)
Author:
rikavila
Message:
 
Location:
2016/27/PaavoH/Shootdown
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • 2016/27/PaavoH/Shootdown/Shootdown/Shootdown/Shootdown.cs

    r9474 r9481  
    2020    PlatformCharacter Player1; 
    2121    PlatformCharacter Player2; 
    22     AssaultRifle Player1Gun; 
    23     AssaultRifle Player2Gun; 
    2422 
    2523    SoundEffect maaliAani = LoadSoundEffect("maali"); 
     
    5250        kentta.SetTileMethod('1', AddPlayer1); 
    5351        kentta.SetTileMethod('2', AddPlayer2); 
     52        kentta.SetTileMethod('A', AddAmmoBox); 
    5453        kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    5554        Level.CreateBorders(false); 
     
    6564    } 
    6665 
    67  
     66    void AddAmmoBox(Vector paikka, double leveys, double korkeus) 
     67    { 
     68        PhysicsObject AmmoBox = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     69        AmmoBox.Position = paikka; 
     70        AmmoBox.Color = Color.Gold; 
     71        AmmoBox.Tag = "AmmoBox"; 
     72        Add(AmmoBox); 
     73    } 
    6874 
    6975    void AddPlayer1(Vector paikka, double width, double height) 
     
    7379        Player1.Mass = 4.0; 
    7480        Player1.Image = pelaajanKuva; 
     81        AddCollisionHandler(Player1, "AmmoBox", MoreAmmo); 
    7582        Add(Player1); 
    7683 
    7784        Player1.Weapon = new AssaultRifle(30, 10); 
    78         Player1.Weapon.Ammo.Value = 1000; 
     85        Player1.Weapon.Ammo.Value = 50; 
    7986        Player1.Weapon.Image = ShotgunImage; 
    8087        Player1.Weapon.ProjectileCollision = BulletTouch; 
     
    8996        Player2.Mass = 4.0; 
    9097        Player2.Image = pelaajanKuva; 
     98        AddCollisionHandler(Player2, "AmmoBox", MoreAmmo); 
    9199        Add(Player2); 
    92100 
     
    95103        Player2.Weapon = new AssaultRifle(30, 10); 
    96104 
    97         Player2.Weapon.Ammo.Value = 1000; 
     105        Player2.Weapon.Ammo.Value = 50; 
    98106        Player2.Weapon.Image = ShotgunImage; 
    99107        Player2.Weapon.ProjectileCollision = BulletTouch; 
     
    193201        //MessageDisplay.Add(p); 
    194202    } 
     203 
     204    void MoreAmmo(PhysicsObject Player, PhysicsObject AmmoBox) 
     205    { 
     206 
     207        (Player as PlatformCharacter).Weapon.Ammo.Value = 50; 
     208        AmmoBox.Destroy(); 
     209    } 
    195210} 
    196211 
  • 2016/27/PaavoH/Shootdown/Shootdown/Shootdown/Shootdown.csproj.Debug.cachefile

    r9474 r9481  
    11Content\maali.xnb 
    22Content\norsu.xnb 
     3Content\shotgun.xnb 
    34Content\kentta1.xnb 
    4 Content\shotgun.xnb 
  • 2016/27/PaavoH/Shootdown/Shootdown/Shootdown/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml

    r9474 r9481  
    99      <Options>None</Options> 
    1010      <Output>C:\MyTemp\PaavoH\Shootdown\Shootdown\Shootdown\bin\x86\Debug\Content\maali.xnb</Output> 
    11       <Time>2017-10-21T11:31:06.5030181+03:00</Time> 
     11      <Time>2017-11-18T14:17:18.0534648+02:00</Time> 
    1212    </Item> 
    1313    <Item> 
     
    1818      <Options>None</Options> 
    1919      <Output>C:\MyTemp\PaavoH\Shootdown\Shootdown\Shootdown\bin\x86\Debug\Content\norsu.xnb</Output> 
    20       <Time>2017-10-21T11:31:06.5050205+03:00</Time> 
     20      <Time>2017-11-18T14:17:18.1940881+02:00</Time> 
     21    </Item> 
     22    <Item> 
     23      <Source>shotgun.png</Source> 
     24      <Name>shotgun</Name> 
     25      <Importer>TextureImporter</Importer> 
     26      <Processor>TextureProcessor</Processor> 
     27      <Options>None</Options> 
     28      <Output>C:\MyTemp\PaavoH\Shootdown\Shootdown\Shootdown\bin\x86\Debug\Content\shotgun.xnb</Output> 
     29      <Time>2017-11-18T14:17:18.2722141+02:00</Time> 
    2130    </Item> 
    2231    <Item> 
     
    2736      <Options>None</Options> 
    2837      <Output>C:\MyTemp\PaavoH\Shootdown\Shootdown\Shootdown\bin\x86\Debug\Content\kentta1.xnb</Output> 
    29       <Time>2017-10-21T13:19:47.2966624+03:00</Time> 
    30     </Item> 
    31     <Item> 
    32       <Source>shotgun.png</Source> 
    33       <Name>shotgun</Name> 
    34       <Importer>TextureImporter</Importer> 
    35       <Processor>TextureProcessor</Processor> 
    36       <Options>None</Options> 
    37       <Output>C:\MyTemp\PaavoH\Shootdown\Shootdown\Shootdown\bin\x86\Debug\Content\shotgun.xnb</Output> 
    38       <Time>2017-10-21T12:00:50.6253702+03:00</Time> 
     38      <Time>2017-11-18T14:54:54.2288101+02:00</Time> 
    3939    </Item> 
    4040    <BuildSuccessful>true</BuildSuccessful> 
     
    8585      <Assembly> 
    8686        <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> 
    87         <Value>2017-07-12T17:50:56.503647+03:00</Value> 
     87        <Value>2017-06-07T09:40:27.2293184+03:00</Value> 
    8888      </Assembly> 
    8989    </Assemblies> 
  • 2016/27/PaavoH/Shootdown/Shootdown/Shootdown/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt

    r9474 r9481  
    11Content\maali.xnb 
    22Content\norsu.xnb 
     3Content\shotgun.xnb 
    34Content\kentta1.xnb 
    4 Content\shotgun.xnb 
  • 2016/27/PaavoH/Shootdown/Shootdown/ShootdownContent/kentta1.txt

    r9474 r9481  
    77     *        * 
    88     ##  ##  ## 
    9  
     9                             A 
    1010   *    *  *    *      ####### 
    11    ##  ##  ##  ## 
     11   ##  ##  ##  ##    # 
    1212 
    1313 *    *       *   * 
Note: See TracChangeset for help on using the changeset viewer.