Changeset 3646 for 2012/27


Ignore:
Timestamp:
2012-07-06 11:46:27 (11 years ago)
Author:
lekopakk
Message:

Talletus.

Location:
2012/27/LeeviK/PhysicsBall/PhysicsBall
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • 2012/27/LeeviK/PhysicsBall/PhysicsBall/PhysicsBall/PhysicsBall.cs

    r3635 r3646  
    99public class PhysicsBall : PhysicsGame 
    1010{ 
     11    Image GAMEOVER = LoadImage("Game Over"); 
     12    PhysicsObject Tynnyri42; 
     13    PhysicsObject este12; 
     14    PhysicsObject este11; 
     15    PhysicsObject este10; 
    1116    PhysicsObject Este5; 
    1217    PhysicsObject Pelaaja4; 
     
    230235        Add(este2); 
    231236        este2.Image = BLOCK; 
     237        este2.Tag = "ESTE2"; 
    232238 
    233239 
     
    251257            MessageDisplay.Add("Kuolit!"); 
    252258        } 
    253  
     259        else if (kohde.Tag.ToString() == "ESTE2") 
     260        { 
     261            Pelaaja1.X = -400; 
     262            Pelaaja1.Y = -100; 
     263            MessageDisplay.Add("Kuolit!"); 
     264        } 
    254265 
    255266 
     
    302313        Add(este5); 
    303314        este5.X = -10; 
    304         este5.Y = 0; 
     315        este5.Y = -30; 
    305316        este5.Image = BLOCK; 
    306317        este5.Tag = "ESTE5"; 
     
    317328        este4.Tag = "ESTE4"; 
    318329        este4.X = -30; 
    319         este4.Y = -250; 
     330        este4.Y = -225; 
    320331        este4.Image = BLOCK; 
    321332 
     
    329340 
    330341        AddCollisionHandler(Pelaaja3, KasittelePallonTormays4); 
     342 
     343         
    331344 
    332345 
     
    369382        Camera.Follow(Pelaaja4); 
    370383            Camera.ZoomFactor = 2.0; 
     384            Pelaaja.KineticFriction = 0.8; 
     385            Pelaaja.Restitution = 0.2; 
    371386 
    372387        ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, 
     
    396411        AddCollisionHandler(Pelaaja4, KasittelePallonTormays5); 
    397412 
    398         PhysicsObject Este5 = PhysicsObject.CreateStaticObject(20, 525); 
     413        PhysicsObject Este5 = PhysicsObject.CreateStaticObject(20, 500 ); 
    399414        Add(Este5); 
    400415        Este5.X = -300; 
     
    403418        Este5.Tag = "ESTE1"; 
    404419 
     420        PhysicsObject este10 = PhysicsObject.CreateStaticObject(50, 525); 
     421         
     422        Add(este10); 
     423        este10.Tag = "ESTE10"; 
     424        este10.X = -100; 
     425        este10.Y = -0; 
     426        este10.Image = BLOCK; 
     427 
     428        PhysicsObject este11 = PhysicsObject.CreateStaticObject(50, 500); 
     429        Add(este11); 
     430        este11.Tag = "ESTE11"; 
     431        este11.X = 300; 
     432        este11.Y = -50; 
     433        este11.Image = BLOCK; 
     434 
     435        PhysicsObject este12 = PhysicsObject.CreateStaticObject(50, 525); 
     436        Add(este12); 
     437        este12.Tag = "ESTE12"; 
     438        este12.X = -200; 
     439        este12.Y = 150; 
     440        este12.Image = BLOCK; 
     441 
     442        PhysicsObject Tynnyri42 = PhysicsObject.CreateStaticObject(50, 50); 
     443        Add(Tynnyri42); 
     444        Tynnyri42.X = Level.Left; 
     445        Tynnyri42.Y = Level.Bottom; 
     446        Tynnyri42.Image = Barrel; 
     447        Tynnyri42.Tag = "TYNNYRI42"; 
    405448 
    406449 
     
    419462            MessageDisplay.Add("Kuolit!"); 
    420463 
     464        } 
     465        else if (kohde.Tag.ToString() == "TYNNYRI42") 
     466        { 
     467            kohde.Destroy(); 
     468            ClearGameObjects(); 
     469            Camera.ZoomToLevel(); 
     470            Level.BackgroundColor = Color. Black; 
     471            Level.Background.Image = GAMEOVER;     
    421472        } 
    422473 
  • 2012/27/LeeviK/PhysicsBall/PhysicsBall/PhysicsBallContent/PhysicsBallContent.contentproj

    r3581 r3646  
    142142    </Compile> 
    143143  </ItemGroup> 
     144  <ItemGroup> 
     145    <Compile Include="Game Over.png"> 
     146      <Name>Game Over</Name> 
     147      <Importer>TextureImporter</Importer> 
     148      <Processor>TextureProcessor</Processor> 
     149    </Compile> 
     150  </ItemGroup> 
    144151  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    145152  <!--  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.