Changeset 7853 for 2016/27/OttoK


Ignore:
Timestamp:
2016-07-06 11:28:15 (3 years ago)
Author:
otoskinn
Message:
 
Location:
2016/27/OttoK/Survivetown
Files:
5 added
11 edited

Legend:

Unmodified
Added
Removed
  • 2016/27/OttoK/Survivetown/Survivetown/Survivetown/Survivetown.cs

    r7786 r7853  
    1313    Image pelaajankuva = LoadImage("mlgnorsurebornedv2"); 
    1414    Image jonnenkuva = LoadImage("jonne"); 
     15    Image pengunkuva = LoadImage("smokingpwenguin"); 
     16    Image sytkarinkuva = LoadImage("sytkari"); 
    1517    PhysicsObject pelaaja; 
    1618    double nopeus = 1000; 
    1719    bool sprint = false; 
    1820    PhysicsObject jonne; 
     21    
    1922 
    2023    public override void Begin() 
     
    2326        LisaaOhjaimet(); 
    2427        LuoJonne(); 
    25         Tupruttelia(); 
    2628        //LuoPingviini(); 
    2729 
     
    6365        pelaaja.LinearDamping = 0.9; 
    6466        pelaaja.Image = pelaajankuva; 
     67        pelaaja.IgnoresExplosions = true; 
    6568        pelaaja.CanRotate = false; 
    6669        Add(pelaaja); 
     70        AddCollisionHandler(pelaaja, "jonne", PelaajaTormasi); 
    6771        Camera.Follow(pelaaja); 
    6872    } 
     
    8993    void LuoPingviini(Vector paikka, double x, double y) 
    9094    { 
    91         PhysicsObject pingviini = new PhysicsObject(70, 50); 
     95        PhysicsObject pingviini = new PhysicsObject(100, 100); 
    9296        pingviini.Shape = Shape.Circle; 
    9397        pingviini.Color = Color.Red; 
    9498        pingviini.Position = paikka; 
    9599        pingviini.CanRotate = false; 
     100        pingviini.Image = pengunkuva; 
    96101        Add(pingviini); 
    97102    } 
     
    101106        jonne.Position = new Vector(0, -1500); 
    102107        jonne.CanRotate = false; 
     108        jonne.Tag = "jonne"; 
     109        jonne.IgnoresExplosions = true; 
    103110        jonne.Image = jonnenkuva; 
     111        jonne.Mass = 100000000; 
    104112        Add(jonne); 
    105113    } 
     
    115123        savunsiirto.Start(); 
    116124    } 
     125    void LuoSytkari() 
     126    { 
     127        PhysicsObject sytkari = new PhysicsObject(250, 300); 
     128        sytkari.Image = sytkarinkuva; 
     129        sytkari.Position = jonne.Position; 
     130        Add(sytkari,1); 
     131        sytkari.CanRotate = false; 
     132        sytkari.Mass = 10000; 
     133        sytkari.MaximumLifetime = TimeSpan.FromSeconds(1);    
     134        Tupruttelia(); 
     135        sytkari.Destroyed += delegate () 
     136        { 
     137            LuoRajahdys(jonne.Position); 
     138            jonne.Tag = "jonne"; 
     139        }; 
     140    } 
     141   
     142    void PelaajaTormasi(PhysicsObject pelaaja, PhysicsObject jonne) 
     143    { 
     144        jonne.Tag = ""; 
     145        Timer.SingleShot(1.0, LuoSytkari); 
     146         
     147    } 
     148    void LuoRajahdys(Vector paikka) 
     149    { 
     150        Explosion rajadys = new Explosion(150); 
     151        rajadys.Position = paikka; 
     152        Add(rajadys, 1); 
     153    } 
     154     
    117155} 
  • 2016/27/OttoK/Survivetown/Survivetown/Survivetown/Survivetown.csproj.Debug.cachefile

    r7786 r7853  
    55Content\mlgnorsurebornedv2.xnb 
    66Content\jonne.xnb 
     7Content\smokingpwenguin.xnb 
     8Content\sytkari.xnb 
  • 2016/27/OttoK/Survivetown/Survivetown/Survivetown/obj/x86/Debug/ContentPipeline-{AF625287-3FBB-4ACD-9F6A-000F734EB560}.xml

    r7786 r7853  
    5656      <Time>2016-07-05T14:10:50.7444051+03:00</Time> 
    5757    </Item> 
     58    <Item> 
     59      <Source>smokingpwenguin.png</Source> 
     60      <Name>smokingpwenguin</Name> 
     61      <Importer>TextureImporter</Importer> 
     62      <Processor>TextureProcessor</Processor> 
     63      <Options>None</Options> 
     64      <Output>C:\MyTemp\OttoK\Survivetown\Survivetown\Survivetown\bin\x86\Debug\Content\smokingpwenguin.xnb</Output> 
     65      <Time>2016-07-06T10:22:10.1908881+03:00</Time> 
     66    </Item> 
     67    <Item> 
     68      <Source>sytkari.png</Source> 
     69      <Name>sytkari</Name> 
     70      <Importer>TextureImporter</Importer> 
     71      <Processor>TextureProcessor</Processor> 
     72      <Options>None</Options> 
     73      <Output>C:\MyTemp\OttoK\Survivetown\Survivetown\Survivetown\bin\x86\Debug\Content\sytkari.xnb</Output> 
     74      <Time>2016-07-06T10:41:23.4256207+03:00</Time> 
     75    </Item> 
    5876    <BuildSuccessful>true</BuildSuccessful> 
    5977    <Settings> 
  • 2016/27/OttoK/Survivetown/Survivetown/Survivetown/obj/x86/Debug/Survivetown.csproj.FileListAbsolute.txt

    r7786 r7853  
    1313C:\MyTemp\OttoK\Survivetown\Survivetown\Survivetown\bin\x86\Debug\Content\mlgnorsurebornedv2.xnb 
    1414C:\MyTemp\OttoK\Survivetown\Survivetown\Survivetown\bin\x86\Debug\Content\jonne.xnb 
     15C:\MyTemp\OttoK\Survivetown\Survivetown\Survivetown\bin\x86\Debug\Content\smokingpwenguin.xnb 
     16C:\MyTemp\OttoK\Survivetown\Survivetown\Survivetown\bin\x86\Debug\Content\sytkari.xnb 
  • 2016/27/OttoK/Survivetown/Survivetown/Survivetown/obj/x86/Debug/cachefile-{AF625287-3FBB-4ACD-9F6A-000F734EB560}-targetpath.txt

    r7786 r7853  
    55Content\mlgnorsurebornedv2.xnb 
    66Content\jonne.xnb 
     7Content\smokingpwenguin.xnb 
     8Content\sytkari.xnb 
  • 2016/27/OttoK/Survivetown/Survivetown/SurvivetownContent/SurvivetownContent.contentproj

    r7786 r7853  
    8787    </Compile> 
    8888  </ItemGroup> 
     89  <ItemGroup> 
     90    <Compile Include="smokingpwenguin.png"> 
     91      <Name>smokingpwenguin</Name> 
     92      <Importer>TextureImporter</Importer> 
     93      <Processor>TextureProcessor</Processor> 
     94    </Compile> 
     95  </ItemGroup> 
     96  <ItemGroup> 
     97    <Compile Include="sytkari.png"> 
     98      <Name>sytkari</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.