Changeset 4259 for 2013


Ignore:
Timestamp:
2013-06-27 13:00:19 (10 years ago)
Author:
juiitamm
Message:

Talletus.

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

Legend:

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

    r4257 r4259  
    99public class Jump_Game : PhysicsGame 
    1010{ 
    11     int kenttaNro = 1; 
     11    int kenttaNro = 6; 
    1212    PhysicsObject piikki = new PhysicsObject(20, 20); 
     13    Image pomminkuva = LoadImage("pommi"); 
    1314 
    1415    Image piikinkuva = LoadImage("piikki"); 
     
    3940        else if (kenttaNro == 4) LuoKentta("Kentta4"); 
    4041        else if (kenttaNro == 5) LuoKentta("kentta5"); 
    41         else if (kenttaNro > 5) Exit(); 
     42        else if (kenttaNro == 6) LuoKentta("kentta6"); 
     43        else if (kenttaNro > 6) Exit(); 
    4244        LuoOhjaimet(); 
    4345    } 
     
    6062        ruudut.SetTileMethod("FFD800", LuoTahti); 
    6163        ruudut.SetTileMethod("808080", LuoPiikki); 
     64        ruudut.SetTileMethod("1900FF", LuoPommi); 
    6265        ruudut.Execute(20, 20); 
    6366        Camera.ZoomToLevel(); 
    64         Level.BackgroundColor = Color.Black; 
     67        Level.BackgroundColor = Color.DarkAzure; 
     68 
    6569        Level.CreateBorders(false); 
    6670        Gravity = new Vector(0, -500); 
     
    8387            Begin(); 
    8488        }); 
     89        AddCollisionHandler(pelaaja, "pommi", delegate(PhysicsObject olio, PhysicsObject pommi) 
     90        { 
     91            Explosion rajahdys = new Explosion(100); 
     92            rajahdys.Position = pommi.Position; 
     93            Add(rajahdys); 
     94            pommi.Destroy(); 
     95        });   
    8596    } 
    8697 
     
    147158    } 
    148159 
    149  
     160    void LuoPommi(Vector paikka, double leveys, double korkeus) 
     161    { 
     162        PhysicsObject pommi = new PhysicsObject(10, 10); 
     163        pommi.Image = pomminkuva; 
     164        pommi.Position = paikka; 
     165        pommi.Tag = "pommi"; 
     166        Add(pommi); 
     167    } 
    150168 
    151169} 
     170     
    152171    
  • 2013/26/AkseliT/Jump Game/Jump Game/Jump GameContent/Jump GameContent.contentproj

    r4257 r4259  
    115115    </Compile> 
    116116  </ItemGroup> 
     117  <ItemGroup> 
     118    <Compile Include="kentta6.png"> 
     119      <Name>kentta6</Name> 
     120      <Importer>TextureImporter</Importer> 
     121      <Processor>TextureProcessor</Processor> 
     122    </Compile> 
     123  </ItemGroup> 
     124  <ItemGroup> 
     125    <Compile Include="pommi.png"> 
     126      <Name>pommi</Name> 
     127      <Importer>TextureImporter</Importer> 
     128      <Processor>TextureProcessor</Processor> 
     129    </Compile> 
     130  </ItemGroup> 
    117131  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    118132  <!--  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.