Changeset 2889 for 2012/23


Ignore:
Timestamp:
2012-06-08 13:40:31 (7 years ago)
Author:
hasamati
Message:
 
Location:
2012/23/HannesM/The Game of Rooms/The Game of Rooms
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 2012/23/HannesM/The Game of Rooms/The Game of Rooms/The Game of Rooms/The_Game_of_Rooms.cs

    r2876 r2889  
    1313    bool onTikkaat = false; 
    1414    IntMeter AmmusLaskuri; 
    15      
     15    int kenttaNro = 1; 
     16 
    1617    public override void Begin() 
    1718    { 
    18         luoKentta(); 
    19  
    20         PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
    21         Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
    22  
    23     } 
    24     void luoKentta() 
    25     { 
    26  
    27         TileMap ruudut = TileMap.FromLevelAsset("The Game Of Rooms (map1)"); 
     19        MultiSelectWindow valikko = new MultiSelectWindow("Valikko", "Taso 1", "Taso 2"); 
     20        valikko.ItemSelected += Valinappi; 
     21        Add(valikko); 
     22    } 
     23 
     24    void luoKentta(String kentannimi) 
     25    { 
     26 
     27        TileMap ruudut = TileMap.FromLevelAsset(kentannimi); 
    2828 
    2929        Elama(); 
     
    109109           Hyppaa, null, 100.0); 
    110110        Keyboard.Listen(Key.LeftShift, ButtonState.Pressed, Ammu, null); 
     111        Keyboard.Listen(Key.O, ButtonState.Pressed, Begin, null); 
    111112 
    112113    } 
     
    114115    void luoseina(Vector paikka, double leveys, double korkeus) 
    115116    { 
    116         PhysicsObject seina = PhysicsObject.CreateStaticObject(20, korkeus); 
     117        PhysicsObject seina = PhysicsObject.CreateStaticObject(leveys, korkeus); 
    117118        seina.Position = paikka; 
    118119        seina.Shape = Shape.Rectangle; 
     
    124125    void luoseina2(Vector paikka, double leveys, double korkeus) 
    125126    { 
    126         PhysicsObject seina2 = PhysicsObject.CreateStaticObject(leveys, 47.5); 
     127        PhysicsObject seina2 = PhysicsObject.CreateStaticObject(leveys, korkeus); 
    127128        seina2.Position = paikka; 
    128129        seina2.Shape = Shape.Rectangle; 
     
    490491    } 
    491492 
     493    void SeuraavaKentta(int kentanNro) 
     494    { 
     495        ClearAll(); 
     496 
     497        Laskuri(); 
     498 
     499        Camera.Follow(pelaaja); 
     500        Camera.ZoomFactor = (1.5); 
     501 
     502        Level.BackgroundColor = Color.White; 
     503 
     504        Surface vasenReuna = Surface.CreateLeft(Level, 30, 30, 10); 
     505        vasenReuna.Color = Color.Black; 
     506        Add(vasenReuna); 
     507        Surface oikeaReuna = Surface.CreateRight(Level, 30, 30, 10); 
     508        oikeaReuna.Color = Color.Black; 
     509        Add(oikeaReuna); 
     510        Surface yläReuna = Surface.CreateTop(Level, 30, 30, 10); 
     511        yläReuna.Color = Color.Black; 
     512        Add(yläReuna); 
     513        Surface alaReuna = Surface.CreateBottom(Level, 30, 30, 10); 
     514        alaReuna.Color = Color.Black; 
     515        Add(alaReuna); 
     516 
     517        Gravity = new Vector(0, -800); 
     518 
     519        if (kentanNro == 1) luoKentta("The Game Of Rooms (map1)"); 
     520        else if (kentanNro == 2) luoKentta("The Game Of Rooms (map2)"); 
     521        else if (kentanNro > 3) Exit(); 
     522 
     523        PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
     524        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
     525 
     526    } 
     527 
     528    void Valinappi(int valinta) 
     529    { 
     530        SeuraavaKentta(valinta + 1); 
     531    } 
    492532} 
    493533 
  • 2012/23/HannesM/The Game of Rooms/The Game of Rooms/The Game of RoomsContent/The Game of RoomsContent.contentproj

    r2857 r2889  
    234234    </Compile> 
    235235  </ItemGroup> 
     236  <ItemGroup> 
     237    <Compile Include="The Game Of Rooms %28map2%29.txt"> 
     238      <Name>The Game Of Rooms %28map2%29</Name> 
     239      <Importer>TextFileImporter</Importer> 
     240      <Processor>TextFileContentProcessor</Processor> 
     241    </Compile> 
     242  </ItemGroup> 
    236243  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    237244  <!--  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.