Changeset 4260 for 2013


Ignore:
Timestamp:
2013-06-27 14:01:26 (10 years ago)
Author:
juiitamm
Message:

Talletus.

Location:
2013/26/AkseliT/Jump Game/Jump Game
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • 2013/26/AkseliT/Jump Game/Jump Game/Jump Game/Jump_Game.cs

    r4259 r4260  
    99public class Jump_Game : PhysicsGame 
    1010{ 
    11     int kenttaNro = 6; 
     11    int kenttaNro = 1; 
    1212    PhysicsObject piikki = new PhysicsObject(20, 20); 
    1313    Image pomminkuva = LoadImage("pommi"); 
    1414 
     15    ExplosionSystem rajahdys = new ExplosionSystem(LoadImage("efecti"), 200); 
    1516    Image piikinkuva = LoadImage("piikki"); 
    1617    Image tahdenkuva = LoadImage("tahti"); 
     
    4344        else if (kenttaNro > 6) Exit(); 
    4445        LuoOhjaimet(); 
     46        LuoRajahdys(); 
    4547    } 
    4648 
     
    8082        AddCollisionHandler(pelaaja, "tahti", CollisionHandler.DestroyTarget); 
    8183        AddCollisionHandler(pelaaja, "tahti", CollisionHandler.AddMeterValue(tahtiLaskuri, -1)); 
     84        AddCollisionHandler(pelaaja, "tahti", CollisionHandler.AddEffectOnObject(rajahdys, 100)); 
    8285        Add(pelaaja); 
    8386        AddCollisionHandler(pelaaja, "piikki", CollisionHandler.ExplodeObject(100, true)); 
    8487        AddCollisionHandler(pelaaja, "piikki", delegate(PhysicsObject p, PhysicsObject o) 
    8588        { 
    86             ClearAll(); 
    87             Begin(); 
     89            Timer.SingleShot(1.0, 
     90 
     91  delegate { ClearAll(); Begin(); } 
     92); 
     93            
    8894        }); 
    8995        AddCollisionHandler(pelaaja, "pommi", delegate(PhysicsObject olio, PhysicsObject pommi) 
    9096        { 
    91             Explosion rajahdys = new Explosion(100); 
    92             rajahdys.Position = pommi.Position; 
    93             Add(rajahdys); 
     97            Explosion rajahdys2 = new Explosion(100); 
     98            rajahdys2.Position = pommi.Position; 
     99            Add(rajahdys2); 
    94100            pommi.Destroy(); 
    95101        });   
     
    167173    } 
    168174 
     175    void LuoRajahdys() 
     176    { 
     177        //rajahdys = new ExplosionSystem(LoadImage("efecti"), 200); 
     178        Add(rajahdys); 
     179    }      
    169180} 
    170181     
  • 2013/26/AkseliT/Jump Game/Jump Game/Jump GameContent/Jump GameContent.contentproj

    r4259 r4260  
    129129    </Compile> 
    130130  </ItemGroup> 
     131  <ItemGroup> 
     132    <Compile Include="efecti.png"> 
     133      <Name>efecti</Name> 
     134      <Importer>TextureImporter</Importer> 
     135      <Processor>TextureProcessor</Processor> 
     136    </Compile> 
     137  </ItemGroup> 
    131138  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    132139  <!--  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.