Changeset 7949 for 2016/27/PekkaP


Ignore:
Timestamp:
2016-07-07 13:44:57 (3 years ago)
Author:
pepihlaj
Message:
 
Location:
2016/27/PekkaP/FinnishTroops/FinnishTroops
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • 2016/27/PekkaP/FinnishTroops/FinnishTroops/FinnishTroops/FinnishTroops.cs

    r7939 r7949  
    2222    Image Palikka = LoadImage("Palikka"); 
    2323    IntMeter PelaajanElamat; 
     24    Image Tankki = LoadImage("Tankki"); 
    2425    public override void Begin() 
    2526    { 
     
    3334        Camera.ZoomFactor = 2.5; 
    3435        Camera.StayInLevel = true; 
    35     } 
    36  
     36 
     37         
     38    } 
    3739 
    3840    void LuoKentta() 
     
    4345        kentta.SetTileMethod('N', LisaaPelaaja); 
    4446        kentta.SetTileMethod('M', LisaaPahis); 
     47        kentta.SetTileMethod('T', LisaaTyyppi); 
    4548        kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    4649        Level.CreateBorders(); 
     
    7881 
    7982    } 
    80      
     83    void LisaaTyyppi(Vector paikka, double leveys, double korkeus) 
     84    { 
     85        PlatformCharacter tyyppi = new PlatformCharacter(leveys, korkeus); 
     86        tyyppi.X = -100; 
     87        tyyppi.Y = -100; 
     88        tyyppi.Image = Tankki; 
     89        tyyppi.Position = paikka; 
     90        Add(tyyppi); 
     91        tyyppi.Tag = "Tankki"; 
     92 
     93        PlatformWandererBrain tasoAivot = new PlatformWandererBrain(); 
     94        tasoAivot.JumpSpeed = 700; 
     95        tasoAivot.TriesToJump = true; 
     96        tasoAivot.Speed = 100; 
     97        tasoAivot.FallsOffPlatforms = true; 
     98        tyyppi.Brain = tasoAivot; 
     99 
     100        tyyppi.Weapon = new AssaultRifle(30, 10); 
     101        tyyppi.Weapon.IsVisible = false; 
     102        tyyppi.Weapon.AmmoIgnoresGravity = false; 
     103        tyyppi.Weapon.Power.Value = 2000; 
     104        tyyppi.Weapon.ProjectileCollision = AmmusOsui; 
     105        Timer ajastin = new Timer(); 
     106        ajastin.Interval = 1.0; 
     107        ajastin.Timeout += delegate { PahisAmmuAseella(tyyppi); }; 
     108        ajastin.Start(); 
     109 
     110    } 
     111 
    81112    void LisaaTaso(Vector paikka, double leveys, double korkeus) 
    82113    { 
     
    108139        pelaaja1.Tag = "pelaaja1"; 
    109140 
    110         //pelaaja1 on PlatformCharacter-tyyppinen 
    111141        pelaaja1.Weapon = new AssaultRifle(30, 10); 
    112142 
    113         //Ammusten määrä aluksi: 
    114143        pelaaja1.Weapon.Ammo.Value = 1000; 
    115144 
    116         //Mitä tapahtuu kun ammus osuu johonkin? 
    117145        pelaaja1.Weapon.ProjectileCollision = AmmusOsui; 
    118146 
     
    139167    void KranaattiOsui(IPhysicsObject rajahdyksenKohde, Vector v) 
    140168    { 
    141         if (rajahdyksenKohde.Tag.Equals("PahisSotilas") || rajahdyksenKohde.Tag.Equals("pelaaja1")) rajahdyksenKohde.Destroy(); 
     169        if (rajahdyksenKohde.Tag.Equals("PahisSotilas") || rajahdyksenKohde.Tag.Equals("pelaaja1") || rajahdyksenKohde.Tag.Equals("Tankki")) rajahdyksenKohde.Destroy(); 
    142170    } 
    143171 
  • 2016/27/PekkaP/FinnishTroops/FinnishTroops/FinnishTroops/FinnishTroops.csproj.Debug.cachefile

    r7894 r7949  
    99Content\Ammus2.xnb 
    1010Content\Palikka.xnb 
     11Content\Tankki.xnb 
  • 2016/27/PekkaP/FinnishTroops/FinnishTroops/FinnishTroops/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml

    r7939 r7949  
    4545      <Options>None</Options> 
    4646      <Output>C:\MyTemp\PekkaP\FinnishTroops\FinnishTroops\FinnishTroops\bin\x86\Debug\Content\kentta1.xnb</Output> 
    47       <Time>2016-07-07T11:29:10.2306733+03:00</Time> 
     47      <Time>2016-07-07T13:07:00.4214874+03:00</Time> 
    4848    </Item> 
    4949    <Item> 
     
    9191      <Output>C:\MyTemp\PekkaP\FinnishTroops\FinnishTroops\FinnishTroops\bin\x86\Debug\Content\Palikka.xnb</Output> 
    9292      <Time>2016-07-06T13:27:54.3210646+03:00</Time> 
     93    </Item> 
     94    <Item> 
     95      <Source>Tankki.png</Source> 
     96      <Name>Tankki</Name> 
     97      <Importer>TextureImporter</Importer> 
     98      <Processor>TextureProcessor</Processor> 
     99      <Options>None</Options> 
     100      <Output>C:\MyTemp\PekkaP\FinnishTroops\FinnishTroops\FinnishTroops\bin\x86\Debug\Content\Tankki.xnb</Output> 
     101      <Time>2016-07-07T13:23:03.7247048+03:00</Time> 
    93102    </Item> 
    94103    <BuildSuccessful>true</BuildSuccessful> 
  • 2016/27/PekkaP/FinnishTroops/FinnishTroops/FinnishTroops/obj/x86/Debug/FinnishTroops.csproj.FileListAbsolute.txt

    r7894 r7949  
    1717C:\MyTemp\PekkaP\FinnishTroops\FinnishTroops\FinnishTroops\bin\x86\Debug\Content\Ammus2.xnb 
    1818C:\MyTemp\PekkaP\FinnishTroops\FinnishTroops\FinnishTroops\bin\x86\Debug\Content\Palikka.xnb 
     19C:\MyTemp\PekkaP\FinnishTroops\FinnishTroops\FinnishTroops\bin\x86\Debug\Content\Tankki.xnb 
  • 2016/27/PekkaP/FinnishTroops/FinnishTroops/FinnishTroops/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt

    r7894 r7949  
    99Content\Ammus2.xnb 
    1010Content\Palikka.xnb 
     11Content\Tankki.xnb 
  • 2016/27/PekkaP/FinnishTroops/FinnishTroops/FinnishTroopsContent/FinnishTroopsContent.contentproj

    r7894 r7949  
    109109    </Compile> 
    110110  </ItemGroup> 
     111  <ItemGroup> 
     112    <Compile Include="Tankki.png"> 
     113      <Name>Tankki</Name> 
     114      <Importer>TextureImporter</Importer> 
     115      <Processor>TextureProcessor</Processor> 
     116    </Compile> 
     117  </ItemGroup> 
    111118  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    112119  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2016/27/PekkaP/FinnishTroops/FinnishTroops/FinnishTroopsContent/kentta1.txt

    r7939 r7949  
    1 #..N................................................#....# 
     1#...................................................#....# 
    22#...............................M........................# 
    33#..........#.............#M............##...........#..**# 
     
    1111###..##################################################### 
    1212#........................................................# 
     13#......*.....*....*....*.....*....*.....*....*...........# 
     14#.....##....##...##...##....##...##....##...##...........# 
     15#........................................................# 
     16#........................................................# 
     17#####################################################..### 
    1318#........................................................# 
    1419#........................................................# 
    1520#........................................................# 
    1621#........................................................# 
     22#....N.......................T...........................# 
    1723########################################################## 
    18 #........................................................# 
    19 #........................................................# 
    20 #........................................................# 
    21 #........................................................# 
    22 #........................................................# 
    23 ########################################################## 
    24 #........................................................# 
    25 #........................................................# 
    26 #........................................................# 
    27 #........................................................# 
    28 #........................................................# 
    29 ########################################################## 
    30 #........................................................# 
    31 #........................................................# 
    32 #........................................................# 
    33 #........................................................# 
    34 ########################################################## 
    35 #........................................................# 
    36 #........................................................# 
    37 #........................................................# 
    38 #........................................................# 
    39 #........................................................# 
    40 ########################################################## 
     24 
     25 
     26 
     27 
     28 
     29 
     30 
     31 
     32 
     33 
     34 
     35 
     36 
     37 
     38 
     39 
Note: See TracChangeset for help on using the changeset viewer.