Changeset 3366 for 2012/26


Ignore:
Timestamp:
2012-06-29 10:49:04 (11 years ago)
Author:
alvirmas
Message:

Talletus.

Location:
2012/26/AleksanteriV/Polla ja Rosvo/Poliisi ja Rosvo/Poliisi ja Rosvo
Files:
6 added
2 edited

Legend:

Unmodified
Added
Removed
  • 2012/26/AleksanteriV/Polla ja Rosvo/Poliisi ja Rosvo/Poliisi ja Rosvo/Poliisi ja Rosvo/Poliisi_ja_Rosvo.cs

    r3333 r3366  
    2222        ClearAll(); 
    2323 
     24        IsFullScreen = true; 
     25 
    2426        MultiSelectWindow valikko = new MultiSelectWindow("Tervetuloa peliin: Poliisi ja Rosvo", 
    25 "Kenttä 1", "Kenttä 2", "Kenttä 3","Kenttä 4","Kenttä 5 1-4.","Kenttä 6","Kenttä 7 1-4","Kenttä 8 1-3","Lopeta"); 
     27"Kenttä 1 2p.", "Kenttä 2 2p.", "Kenttä 3 2p.", "Kenttä 4 2p.", "Kenttä 5 4p.", "Kenttä 6", "Kenttä 7 4p.", "Kenttä 8 3p.", "Kenttä 9 4p.", "Kenttä 10 2p."); 
    2628        valikko.ItemSelected += PainettiinValikonNappia; 
    2729        valikko.Color = Color.Green; 
     
    2931        Add(valikko); 
    3032    } 
    31  
     33    void PainettiinValikonNappia(int valinta) 
     34    { 
     35        switch (valinta) 
     36        { 
     37            case 0: 
     38                AloitaPeli("kentta3"); 
     39                break; 
     40            case 1: 
     41                AloitaPeli("kentta4"); 
     42                break; 
     43            case 2: 
     44                AloitaPeli("kentta2"); 
     45                break; 
     46            case 3: 
     47                AloitaPeli("Kenttä"); 
     48                break; 
     49            case 4: 
     50                AloitaPeli("kentta5"); 
     51                break; 
     52            case 5: 
     53                AloitaPeli("kentta6"); 
     54                break; 
     55            case 6: 
     56                AloitaPeli("kentta7"); 
     57                break; 
     58            case 7: 
     59                AloitaPeli("kentta8"); 
     60                break; 
     61            case 8: 
     62                AloitaPeli("kentta9"); 
     63                break; 
     64            case 9: 
     65                AloitaPeli("kentta10"); 
     66                break; 
     67 
     68        } 
     69    }  
    3270    void AloitaPeli(string kentanNimi) 
    3371    { 
     
    3775        Level.CreateBorders(); 
    3876        LuoPistelaskuri(); 
    39  
    40         string musa = RandomGen.SelectOne<string>( 
    41             "nitrome - avalanche", 
    42             "nitrome - Canopy", 
    43             "nitrome - dog house", 
    44             "nitrome - fat cat", 
    45             "nitrome - office trap", 
    46             "the benny hill show theme song" 
    47  
    48         ); 
    49         MediaPlayer.Play(musa); 
     77         
     78        
     79        MediaPlayer.Play("the benny hill show theme song"); 
    5080 
    5181        PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
     
    5383        Keyboard.Listen(Key.Space, ButtonState.Pressed, Begin, "aloita alusta"); 
    5484        //Image taustaKuva = LoadImage("moi"); 
    55         Level.BackgroundColor = Color.Black; 
     85        Level.BackgroundColor = Color.DarkRed; 
    5686        Level.Background.Image = LoadImage("moi"); 
    5787        Level.Background.ScaleToLevelFull(); 
     
    6999        kentta.SetTileMethod(Color.Blue, Luopelaaja4); 
    70100        kentta.SetTileMethod(Color.Gray, LuoHarmaaPalikka); 
     101        kentta.SetTileMethod(new Color(0, 255, 255), Luopallo); 
    71102        kentta.SetTileMethod(new Color(255, 255, 0), LuoPallonurmiPalikka); 
    72103        kentta.SetTileMethod(new Color(255, 106, 0), LuoOranssiPalikka); 
     
    112143        Add(palikka); 
    113144    } 
    114     void LuoPallonurmiPalikka(Vector paikka, double leveys, double korkeus) 
    115     { 
    116          
    117  
     145    void Luopallo(Vector paikka, double leveys, double korkeus) 
     146    { 
    118147        pallo = new PhysicsObject(19, 19); 
    119148        pallo.Position = paikka; 
    120149        pallo.Shape = Shape.Circle; 
    121         pallo.Color = Color.White; 
     150        pallo.Image = LoadImage("jalkapallo"); 
     151 
     152        Add(pallo, 1); 
     153        AddCollisionHandler(pallo, "Rosvo", potkaisepalloa); 
     154        AddCollisionHandler(pallo, "Poliisi", potkaisepalloa); 
     155     
     156    } 
     157    void LuoPallonurmiPalikka(Vector paikka, double leveys, double korkeus) 
     158    { 
     159         
     160 
     161        pallo = new PhysicsObject(19, 19); 
     162        pallo.Position = paikka; 
     163        pallo.Shape = Shape.Circle; 
     164        pallo.Image = LoadImage("jalkapallo"); 
    122165 
    123166        Add(pallo ,1); 
     
    180223    void potkaisepalloa(PhysicsObject tormaaja, PhysicsObject kohde)  
    181224    { 
    182         tormaaja.Hit(Vector.FromLengthAndAngle(1000, kohde.Angle)); 
     225        tormaaja.Hit(Vector.FromLengthAndAngle(500, kohde.Angle)); 
    183226    } 
    184227    void aloitaalusta(PhysicsObject tormaaja, PhysicsObject kohde) 
     
    219262        Keyboard.Listen(Key.S, ButtonState.Released, PysaytaPelaaja2Y, null); 
    220263        //---------------------------------------------------- 
    221         Keyboard.Listen(Key.V, ButtonState.Down, LiikutaPelaajaa3, null, new Vector(-205, 0)); 
    222         Keyboard.Listen(Key.N, ButtonState.Down, LiikutaPelaajaa3, null, new Vector(205, 0)); 
    223         Keyboard.Listen(Key.G, ButtonState.Down, LiikutaPelaajaa3, null, new Vector(0, 205)); 
    224         Keyboard.Listen(Key.B, ButtonState.Down, LiikutaPelaajaa3, null, new Vector(0, -205)); 
     264        Keyboard.Listen(Key.V, ButtonState.Down, LiikutaPelaajaa3, null, new Vector(-200, 0)); 
     265        Keyboard.Listen(Key.N, ButtonState.Down, LiikutaPelaajaa3, null, new Vector(200, 0)); 
     266        Keyboard.Listen(Key.G, ButtonState.Down, LiikutaPelaajaa3, null, new Vector(0, 200)); 
     267        Keyboard.Listen(Key.B, ButtonState.Down, LiikutaPelaajaa3, null, new Vector(0, -200)); 
    225268 
    226269        Keyboard.Listen(Key.V, ButtonState.Released, PysaytaPelaaja3X, null); 
     
    229272        Keyboard.Listen(Key.B, ButtonState.Released, PysaytaPelaaja3Y, null); 
    230273        //---------------------------------------------------------- 
    231         Keyboard.Listen(Key.NumPad4, ButtonState.Down, LiikutaPelaajaa4, null, new Vector(-205, 0)); 
    232         Keyboard.Listen(Key.NumPad6, ButtonState.Down, LiikutaPelaajaa4, null, new Vector(205, 0)); 
    233         Keyboard.Listen(Key.NumPad8, ButtonState.Down, LiikutaPelaajaa4, null, new Vector(0, 205)); 
    234         Keyboard.Listen(Key.NumPad5, ButtonState.Down, LiikutaPelaajaa4, null, new Vector(0, -205)); 
     274        Keyboard.Listen(Key.NumPad4, ButtonState.Down, LiikutaPelaajaa4, null, new Vector(-200, 0)); 
     275        Keyboard.Listen(Key.NumPad6, ButtonState.Down, LiikutaPelaajaa4, null, new Vector(200, 0)); 
     276        Keyboard.Listen(Key.NumPad8, ButtonState.Down, LiikutaPelaajaa4, null, new Vector(0, 200)); 
     277        Keyboard.Listen(Key.NumPad5, ButtonState.Down, LiikutaPelaajaa4, null, new Vector(0, -200)); 
    235278 
    236279        Keyboard.Listen(Key.NumPad4, ButtonState.Released, PysaytaPelaaja4X, null); 
     
    246289        } 
    247290        pelaaja.Move(liikuttaja); 
     291        pelaaja.Angle = liikuttaja.Angle + Angle.FromDegrees(90); 
    248292    } 
    249293    void PysaytaPelaajaX() 
     
    257301    void LiikutaPelaajaa2(Vector liikuttaja)//------------------------------------------- 
    258302    { 
     303        if (pelaajia > 2) 
     304        { 
     305            liikuttaja = liikuttaja + Vector.FromLengthAndAngle(-5, liikuttaja.Angle); 
     306        } 
    259307        pelaaja2.Move(liikuttaja); 
     308        pelaaja2.Angle = liikuttaja.Angle + Angle.FromDegrees(90); 
    260309    } 
    261310    void PysaytaPelaaja2X() 
     
    270319    { 
    271320        pelaaja3.Move(liikuttaja); 
     321        pelaaja3.Angle = liikuttaja.Angle + Angle.FromDegrees(90); 
    272322    } 
    273323    void PysaytaPelaaja3X() 
     
    282332    { 
    283333        pelaaja4.Move(liikuttaja); 
     334        pelaaja4.Angle = liikuttaja.Angle + Angle.FromDegrees(90); 
    284335    } 
    285336    void PysaytaPelaaja4X() 
     
    291342        pelaaja4.StopVertical(); 
    292343    } 
    293     void PainettiinValikonNappia(int valinta) 
    294 { 
    295   switch (valinta) 
    296   { 
    297     case 0: 
    298         AloitaPeli("kentta3"); 
    299         break; 
    300     case 1: 
    301         AloitaPeli("kentta4"); 
    302         break; 
    303     case 2: 
    304         AloitaPeli("kentta2"); 
    305         break; 
    306     case 3: 
    307         AloitaPeli("Kenttä"); 
    308         break; 
    309       case 4: 
    310         AloitaPeli("kentta5"); 
    311         break; 
    312       case 5: 
    313         AloitaPeli("kentta6"); 
    314         break; 
    315       case 6: 
    316         AloitaPeli("kentta7"); 
    317         break; 
    318       case 7: 
    319         AloitaPeli("kentta8"); 
    320         break; 
    321     case 8: 
    322         Exit(); 
    323         break; 
    324  
    325   }  
    326 }  
     344     
    327345    
    328346 
  • 2012/26/AleksanteriV/Polla ja Rosvo/Poliisi ja Rosvo/Poliisi ja Rosvo/Poliisi ja RosvoContent/Poliisi ja RosvoContent.contentproj

    r3333 r3366  
    9595  </ItemGroup> 
    9696  <ItemGroup> 
    97     <Compile Include="nitrome - avalanche.mp3"> 
    98       <Name>nitrome - avalanche</Name> 
    99       <Importer>Mp3Importer</Importer> 
    100       <Processor>SongProcessor</Processor> 
    101     </Compile> 
    102     <Compile Include="nitrome - Canopy.mp3"> 
    103       <Name>nitrome - Canopy</Name> 
    104       <Importer>Mp3Importer</Importer> 
    105       <Processor>SongProcessor</Processor> 
    106     </Compile> 
    107     <Compile Include="nitrome - dog house.mp3"> 
    108       <Name>nitrome - dog house</Name> 
    109       <Importer>Mp3Importer</Importer> 
    110       <Processor>SongProcessor</Processor> 
    111     </Compile> 
    112     <Compile Include="nitrome - fat cat.mp3"> 
    113       <Name>nitrome - fat cat</Name> 
    114       <Importer>Mp3Importer</Importer> 
    115       <Processor>SongProcessor</Processor> 
    116     </Compile> 
    117     <Compile Include="nitrome - office trap.mp3"> 
    118       <Name>nitrome - office trap</Name> 
    119       <Importer>Mp3Importer</Importer> 
    120       <Processor>SongProcessor</Processor> 
    121     </Compile> 
    122   </ItemGroup> 
    123   <ItemGroup> 
    124     <Compile Include="Metalli.PNG"> 
    125       <Name>Metalli</Name> 
    126       <Importer>TextureImporter</Importer> 
    127       <Processor>TextureProcessor</Processor> 
    128     </Compile> 
    129     <Compile Include="tiili palkki.png"> 
    130       <Name>tiili palkki</Name> 
    131       <Importer>TextureImporter</Importer> 
    132       <Processor>TextureProcessor</Processor> 
    133     </Compile> 
    134   </ItemGroup> 
    135   <ItemGroup> 
    13697    <Compile Include="kentta5.png"> 
    13798      <Name>kentta5</Name> 
     
    176137  </ItemGroup> 
    177138  <ItemGroup> 
    178     <Compile Include="seina1.png"> 
    179       <Name>seina1</Name> 
     139    <Compile Include="seina2.png"> 
     140      <Name>seina2</Name> 
    180141      <Importer>TextureImporter</Importer> 
    181142      <Processor>TextureProcessor</Processor> 
    182143    </Compile> 
    183     <Compile Include="seina2.png"> 
    184       <Name>seina2</Name> 
     144  </ItemGroup> 
     145  <ItemGroup> 
     146    <Compile Include="jalkapallo.png"> 
     147      <Name>jalkapallo</Name> 
     148      <Importer>TextureImporter</Importer> 
     149      <Processor>TextureProcessor</Processor> 
     150    </Compile> 
     151  </ItemGroup> 
     152  <ItemGroup> 
     153    <Compile Include="kentta9.png"> 
     154      <Name>kentta9</Name> 
     155      <Importer>TextureImporter</Importer> 
     156      <Processor>TextureProcessor</Processor> 
     157    </Compile> 
     158  </ItemGroup> 
     159  <ItemGroup> 
     160    <Compile Include="kentta10.png"> 
     161      <Name>kentta10</Name> 
    185162      <Importer>TextureImporter</Importer> 
    186163      <Processor>TextureProcessor</Processor> 
Note: See TracChangeset for help on using the changeset viewer.