Changeset 6028 for 2015


Ignore:
Timestamp:
2015-06-11 14:01:22 (8 years ago)
Author:
iisaaira
Message:
 
Location:
2015/24/TuroR/Omapeli
Files:
6 added
11 edited

Legend:

Unmodified
Added
Removed
  • 2015/24/TuroR/Omapeli/Omapeli/Omapeli/Omapeli.cs

    r5997 r6028  
    99public class Omapeli : PhysicsGame 
    1010{ 
    11     Image taustaKuva = LoadImage(""); 
     11    Image taustaKuva = LoadImage("kokki"); 
    1212 
    1313    Image ukkoAmpuu = LoadImage("ukko ampuu2"); 
     
    1818    Image panoksenKuva = LoadImage("panos"); 
    1919 
    20     Image[] pallonKuvat = LoadImages("apina", "UUS APINA", "sukkamato", "silma", "kännykkä", "Cannon", "possu", "tamm", "putin", "pall o o"); 
     20    Image[] pallonKuvat = LoadImages("apina", "UUS APINA", "sukkamato", "silma", "kännykkä", "Cannon", "possu", "tamm", "putin", "pall o o", "kiekko"); 
    2121 
    2222    AssaultRifle pelaajan1Ase; 
    2323 
    2424    Image ukonKuva = LoadImage("ukko"); 
    25  
     25     
     26    EasyHighScore topLista = new EasyHighScore(); 
    2627 
    2728 
    2829    public override void Begin() 
    2930    { 
    30          
    31  
     31        topLista.HighScoreWindow.Closed += _ => LuoAlkuvalikko(); 
     32        LuoAlkuvalikko(); 
     33    } 
     34 
     35    void AloitaPeli() 
     36    { 
     37        ClearAll(); 
    3238        LuoUusiApina(); 
    3339 
     
    4450        Level.CreateLeftBorder(1.0, false); 
    4551        PhysicsObject ylaReuna = Level.CreateTopBorder(1.0, false); 
    46          
    47  
     52 
     53        Level.Background.Image = taustaKuva; 
     54        Level.Background.FitToLevel(); 
    4855        Surface alaReuna = Surface.CreateBottom(Level, 30, 100, 40, 10); 
    49         alaReuna.Y = Screen.Bottom + 100; 
     56        // vaiha tota jos eri näyttö !!\/ 
     57        alaReuna.Y = Screen.Bottom + 50; 
    5058        Add(alaReuna); 
    5159 
     
    7078        LuoAmmusLaskuri(); 
    7179 
    72         PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
    7380        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
    7481        Mouse.Listen(MouseButton.Left, ButtonState.Down, AmmuAseella, "Ammu",ukko, pelaajan1Ase); 
    7582        Mouse.Listen(MouseButton.Left, ButtonState.Released, AmpumisenLopetus, null, ukko); 
    7683        Keyboard.Listen(Key.W, ButtonState.Down, Hyppääukolla, "Hyppää", ukko); 
    77         Keyboard.Listen(Key.A, ButtonState.Down, Liiku, "Liiku", ukko, Direction.Left); 
    78         Keyboard.Listen(Key.D, ButtonState.Down, Liiku, "Liiku", ukko, Direction.Right); 
     84        Keyboard.Listen(Key.A, ButtonState.Down, Liiku, "Liiku Vasemmalle", ukko, Direction.Left); 
     85        Keyboard.Listen(Key.D, ButtonState.Down, Liiku, "Liiku Oikealle", ukko, Direction.Right); 
    7986        Mouse.ListenMovement(0.0, HiirenLiikutus, "Tahtaa", ukko); 
     87        Keyboard.Listen(Key.R, ButtonState.Pressed, AloitaAlusta, "Aloita alusta"); 
    8088    } 
    8189 
     
    9098            Timer.SingleShot(2.0, delegate { LuoUusiApina(); }); 
    9199            kohde.Destroy(); 
    92             Explosion rajahdys = new Explosion(1100); 
     100            Explosion rajahdys = new Explosion(100); 
    93101            rajahdys.Position = ammus.Position; 
     102 
    94103            Add(rajahdys); 
    95104 
     
    121130    void Hyppääukolla(PlatformCharacter2 ukko) 
    122131    { 
    123         ukko.ForceJump(500.0); 
     132        ukko.Jump(500.0); 
    124133    } 
    125134 
     
    167176    void LuoAmmusLaskuri() 
    168177    { 
    169         ammusLaskuri = new IntMeter(0); 
     178        ammusLaskuri = new IntMeter(0, 0, 50); 
     179        ammusLaskuri.UpperLimit += PeliOhi; 
    170180 
    171181        Label ammusNaytto = new Label(); 
     
    178188        Add(ammusNaytto);  
    179189    } 
     190 
     191    void PeliOhi() 
     192    { 
     193        Timer.SingleShot(2.0, delegate 
     194        { 
     195            ClearAll(); 
     196            topLista.EnterAndShow(pisteLaskuri.Value); 
     197        }); 
     198   } 
     199 
     200    void ParhaatPisteet() 
     201    { 
     202        topLista.Show(); 
     203    } 
     204     
     205 
     206    void LuoAlkuvalikko() 
     207    { 
     208        MultiSelectWindow alkuValikko = new MultiSelectWindow("Pelin alkuvalikko", "Aloita peli", "Parhaat pisteet", "Lopeta"); 
     209       Add(alkuValikko); 
     210       alkuValikko.AddItemHandler(0, AloitaPeli); 
     211       alkuValikko.AddItemHandler(1, ParhaatPisteet); 
     212       alkuValikko.AddItemHandler(2, Exit); 
     213    } 
     214 
     215    void AloitaAlusta() 
     216    { 
     217        AloitaPeli(); 
     218    } 
    180219} 
  • 2015/24/TuroR/Omapeli/Omapeli/Omapeli/Omapeli.csproj.Debug.cachefile

    r5997 r6028  
    1212Content\putin.xnb 
    1313Content\pall o o.xnb 
     14Content\kokki.xnb 
     15Content\kiekko.xnb 
  • 2015/24/TuroR/Omapeli/Omapeli/Omapeli/obj/x86/Debug/ContentPipeline-{595E6F62-26BF-42FB-ABC6-C9280882E6ED}.xml

    r5997 r6028  
    119119      <Time>2015-06-10T12:37:40.4670799+03:00</Time> 
    120120    </Item> 
     121    <Item> 
     122      <Source>kokki.jpg</Source> 
     123      <Name>kokki</Name> 
     124      <Importer>TextureImporter</Importer> 
     125      <Processor>TextureProcessor</Processor> 
     126      <Options>None</Options> 
     127      <Output>C:\MyTemp\TuroR\UusiPeli\Omapeli\Omapeli\Omapeli\bin\x86\Debug\Content\kokki.xnb</Output> 
     128      <Time>2015-06-11T12:32:54.4095624+03:00</Time> 
     129    </Item> 
     130    <Item> 
     131      <Source>kiekko.png</Source> 
     132      <Name>kiekko</Name> 
     133      <Importer>TextureImporter</Importer> 
     134      <Processor>TextureProcessor</Processor> 
     135      <Options>None</Options> 
     136      <Output>C:\MyTemp\TuroR\UusiPeli\Omapeli\Omapeli\Omapeli\bin\x86\Debug\Content\kiekko.xnb</Output> 
     137      <Time>2015-06-11T12:45:59.864619+03:00</Time> 
     138    </Item> 
    121139    <BuildSuccessful>true</BuildSuccessful> 
    122140    <Settings> 
  • 2015/24/TuroR/Omapeli/Omapeli/Omapeli/obj/x86/Debug/Omapeli.csproj.FileListAbsolute.txt

    r5997 r6028  
    3030C:\MyTemp\TuroR\UusiPeli\Omapeli\Omapeli\Omapeli\bin\x86\Debug\Content\putin.xnb 
    3131C:\MyTemp\TuroR\UusiPeli\Omapeli\Omapeli\Omapeli\bin\x86\Debug\Content\pall o o.xnb 
     32C:\MyTemp\TuroR\UusiPeli\Omapeli\Omapeli\Omapeli\bin\x86\Debug\Content\kokki.xnb 
     33C:\MyTemp\TuroR\UusiPeli\Omapeli\Omapeli\Omapeli\bin\x86\Debug\Content\kiekko.xnb 
  • 2015/24/TuroR/Omapeli/Omapeli/Omapeli/obj/x86/Debug/cachefile-{595E6F62-26BF-42FB-ABC6-C9280882E6ED}-targetpath.txt

    r5997 r6028  
    1212Content\putin.xnb 
    1313Content\pall o o.xnb 
     14Content\kokki.xnb 
     15Content\kiekko.xnb 
  • 2015/24/TuroR/Omapeli/Omapeli/OmapeliContent/OmapeliContent.contentproj

    r5997 r6028  
    136136    </Compile> 
    137137  </ItemGroup> 
     138  <ItemGroup> 
     139    <Compile Include="kokki.jpg"> 
     140      <Name>kokki</Name> 
     141      <Importer>TextureImporter</Importer> 
     142      <Processor>TextureProcessor</Processor> 
     143    </Compile> 
     144  </ItemGroup> 
     145  <ItemGroup> 
     146    <Compile Include="kiekko.png"> 
     147      <Name>kiekko</Name> 
     148      <Importer>TextureImporter</Importer> 
     149      <Processor>TextureProcessor</Processor> 
     150    </Compile> 
     151  </ItemGroup> 
    138152  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    139153  <!--  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.