Changeset 7599


Ignore:
Timestamp:
2016-06-30 14:59:31 (3 years ago)
Author:
jonnurmi
Message:
 
Location:
2016/26/JonniN/TankHero
Files:
4 added
13 edited

Legend:

Unmodified
Added
Removed
  • 2016/26/JonniN/TankHero/TankHero/TankHero/TankHero.cs

    r7594 r7599  
    99public class TankHero : PhysicsGame 
    1010{ 
     11     
    1112    Cannon torni; 
     13    Cannon botintorni; 
    1214    Image leopard2a4 = LoadImage("leopard2a4"); 
    1315    Image torninKuva = LoadImage("leopard2a4valmistorni"); 
     
    1517    Image puuKuva = LoadImage("puu"); 
    1618    Image hiekanKuva = LoadImage("hiekka"); 
     19    Image bottiRunko = LoadImage("t90runko"); 
     20    Image bottiTorni = LoadImage("t90torni"); 
    1721    PhysicsObject pelaaja; 
     22    PhysicsObject botti; 
     23    Vector spawn = new Vector(-1400, -1300); 
    1824    public override void Begin() 
    1925    { 
     
    2329        LuoKentta(); 
    2430        LuoPelaaja(); 
     31        LuoBotti(); 
    2532        LuoOhjaimet(); 
    2633        MediaPlayer.Play("684240_Zound---Metallic"); 
    27  
     34         
    2835 
    2936        PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
     
    3643        pelaaja.Image = leopard2a4; 
    3744        pelaaja.LinearDamping = 0.90; 
    38         pelaaja.AngularDamping = 0.95; 
     45        pelaaja.AngularDamping = 0.99; 
     46        pelaaja.Position = spawn; 
     47        pelaaja.Tag = "pelaaja1"; 
    3948        Add(pelaaja); 
    4049        Camera.Zoom(1.5); 
    4150        Camera.Follow(pelaaja); 
     51        //Camera.ZoomToAllObjects(); 
    4252        pelaaja.IgnoresExplosions = true; 
    4353 
     
    4656        torni.Shape = Shape.FromImage(torninKuva); 
    4757        torni.Image = torninKuva; 
    48         torni.Position = new Vector(-9, -37); 
     58        torni.Position = new Vector(-7, -37); 
    4959        torni.Ammo.Value = 10000; 
    5060        pelaaja.Add(torni); 
    5161 
     62    } 
     63    void LuoBotti() 
     64    { 
     65        PhysicsObject botti = new PhysicsObject(150, 200); 
     66        botti.Image = bottiRunko; 
     67        botti.LinearDamping = 0.90; 
     68        botti.AngularDamping = 0.99; 
     69        Add(botti); 
     70 
     71        botintorni = new Cannon(100, 180); 
     72        botintorni.Image = bottiTorni; 
     73        botintorni.Position = new Vector(-10, 40); 
     74        botti.Add(botintorni); 
     75 
     76        FollowerBrain botinaivot = new FollowerBrain("pelaaja1"); 
     77        botinaivot.Speed = 200; 
     78        botinaivot.DistanceFar = 500; 
     79        botti.Brain = botinaivot; 
     80        botinaivot.Active = true; 
     81 
     82        botinaivot.TargetClose += mitaTapahtuuKunOllaanLahella; 
     83 
     84 
     85 
     86    } 
     87    void mitaTapahtuuKunOllaanLahella() 
     88    { 
     89         
    5290    } 
    5391    void LuoKentta() 
     
    5896        ruudut.SetTileMethod(Color.FromHexCode("4CFF00"), LuoPuu); 
    5997        ruudut.Execute(100, 100); 
    60         //Camera.ZoomToAllObjects(); 
    6198         
    6299 
    63100    } 
     101 
    64102    void LuoHiekka(Vector paikka, double leveys, double korkeus) 
    65103    { 
    66         PhysicsObject hiekka = new PhysicsObject(100, 100); 
     104        GameObject hiekka = new GameObject(100, 100); 
    67105        hiekka.Image = hiekanKuva; 
    68         Add(hiekka); 
     106        hiekka.Position = paikka; 
     107        Add(hiekka);  
    69108    } 
    70109    void LuoPuu(Vector paikka, double leveys, double korkeus) 
     
    78117    void LuoOhjaimet() 
    79118    { 
    80         Keyboard.Listen(Key.W, ButtonState.Down, Aja, null, new Vector(0, 1000)); 
    81         Keyboard.Listen(Key.S, ButtonState.Down, Aja, null, new Vector(0, -700)); 
     119        Keyboard.Listen(Key.W, ButtonState.Down, Aja, null, new Vector(0, 1200)); 
     120        Keyboard.Listen(Key.S, ButtonState.Down, Aja, null, new Vector(0, -400)); 
    82121        Keyboard.Listen(Key.A, ButtonState.Down, Kaanny, null, 1); 
    83122        Keyboard.Listen(Key.D, ButtonState.Down, Kaanny, null, -1); 
     
    108147    { 
    109148        ammus.Destroy(); 
    110          
     149        kohde.Destroy(); 
    111150         
    112151    } 
  • 2016/26/JonniN/TankHero/TankHero/TankHero/TankHero.csproj.Debug.cachefile

    r7594 r7599  
    55Content\puu.xnb 
    66Content\hiekka.xnb 
     7Content\t90torni.xnb 
     8Content\t90runko.xnb 
    79Content\684240_Zound---Metallic.wma 
  • 2016/26/JonniN/TankHero/TankHero/TankHero/obj/x86/Debug/ContentPipeline-{B903E94D-9570-46DD-8789-F8147DB1F21B}.xml

    r7594 r7599  
    3737      <Options>None</Options> 
    3838      <Output>C:\MyTemp\JonniN\TankHero\TankHero\TankHero\bin\x86\Debug\Content\kartta.xnb</Output> 
    39       <Time>2016-06-30T10:31:58.1042918+03:00</Time> 
     39      <Time>2016-06-30T12:31:04.9423918+03:00</Time> 
    4040    </Item> 
    4141    <Item> 
     
    5656      <Output>C:\MyTemp\JonniN\TankHero\TankHero\TankHero\bin\x86\Debug\Content\hiekka.xnb</Output> 
    5757      <Time>2016-06-30T11:20:03.6432918+03:00</Time> 
     58    </Item> 
     59    <Item> 
     60      <Source>t90torni.png</Source> 
     61      <Name>t90torni</Name> 
     62      <Importer>TextureImporter</Importer> 
     63      <Processor>TextureProcessor</Processor> 
     64      <Options>None</Options> 
     65      <Output>C:\MyTemp\JonniN\TankHero\TankHero\TankHero\bin\x86\Debug\Content\t90torni.xnb</Output> 
     66      <Time>2016-06-30T14:10:00.9054918+03:00</Time> 
     67    </Item> 
     68    <Item> 
     69      <Source>t90runko.png</Source> 
     70      <Name>t90runko</Name> 
     71      <Importer>TextureImporter</Importer> 
     72      <Processor>TextureProcessor</Processor> 
     73      <Options>None</Options> 
     74      <Output>C:\MyTemp\JonniN\TankHero\TankHero\TankHero\bin\x86\Debug\Content\t90runko.xnb</Output> 
     75      <Time>2016-06-30T14:10:26.6927918+03:00</Time> 
    5876    </Item> 
    5977    <BuildSuccessful>true</BuildSuccessful> 
  • 2016/26/JonniN/TankHero/TankHero/TankHero/obj/x86/Debug/TankHero.csproj.FileListAbsolute.txt

    r7594 r7599  
    1414C:\MyTemp\JonniN\TankHero\TankHero\TankHero\bin\x86\Debug\Content\puu.xnb 
    1515C:\MyTemp\JonniN\TankHero\TankHero\TankHero\bin\x86\Debug\Content\hiekka.xnb 
     16C:\MyTemp\JonniN\TankHero\TankHero\TankHero\bin\x86\Debug\Content\t90torni.xnb 
     17C:\MyTemp\JonniN\TankHero\TankHero\TankHero\bin\x86\Debug\Content\t90runko.xnb 
  • 2016/26/JonniN/TankHero/TankHero/TankHero/obj/x86/Debug/cachefile-{B903E94D-9570-46DD-8789-F8147DB1F21B}-targetpath.txt

    r7594 r7599  
    66Content\puu.xnb 
    77Content\hiekka.xnb 
     8Content\t90torni.xnb 
     9Content\t90runko.xnb 
  • 2016/26/JonniN/TankHero/TankHero/TankHeroContent/TankHeroContent.contentproj

    r7594 r7599  
    8787    </Compile> 
    8888  </ItemGroup> 
     89  <ItemGroup> 
     90    <Compile Include="t90torni.png"> 
     91      <Name>t90torni</Name> 
     92      <Importer>TextureImporter</Importer> 
     93      <Processor>TextureProcessor</Processor> 
     94    </Compile> 
     95  </ItemGroup> 
     96  <ItemGroup> 
     97    <Compile Include="t90runko.png"> 
     98      <Name>t90runko</Name> 
     99      <Importer>TextureImporter</Importer> 
     100      <Processor>TextureProcessor</Processor> 
     101    </Compile> 
     102  </ItemGroup> 
    89103  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    90104  <!--  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.