Changeset 6052 for 2015/24


Ignore:
Timestamp:
2015-06-12 11:29:11 (8 years ago)
Author:
laaljoso
Message:
 
Location:
2015/24/AleksiS/CandyLand
Files:
7 added
13 edited

Legend:

Unmodified
Added
Removed
  • 2015/24/AleksiS/CandyLand/CandyLand/CandyLand/CandyLand.cs

    r6024 r6052  
    1515    PlatformCharacter pelaaja1; 
    1616    PlatformCharacter vihollinen; 
    17  
     17    String kenttaNimi = "kentta1"; 
     18 
     19    Image taustakuva = LoadImage("CandyLandBackgroundImage"); 
    1820    Image pelaajanKuva = LoadImage("tikku-ukko"); 
    1921    Image KarkinKuva = LoadImage("YellowCandy"); 
     
    2729    Timer aikaLaskuri; 
    2830 
     31    EasyHighScore topLista = new EasyHighScore(); 
     32 
     33 
    2934    MultiSelectWindow alkuValikko; 
    3035 
     
    3237    { 
    3338        ClearAll(); 
    34         alkuValikko = new MultiSelectWindow("Candy Land", "Pelaa", "Tarina", "Info", "Lopeta"); 
     39        alkuValikko = new MultiSelectWindow("Candy Land", "Pelaa", "Info", "Lopeta"); 
     40        alkuValikko.ActiveColor = Color.Yellow; 
    3541        Add(alkuValikko); 
    36         alkuValikko.AddItemHandler(0, Pelaa); 
    37         alkuValikko.AddItemHandler(1, Tarina); 
    38         alkuValikko.AddItemHandler(2, Info); 
    39         alkuValikko.AddItemHandler(3, Exit); 
     42        alkuValikko.AddItemHandler(0, Tarina); 
     43        alkuValikko.AddItemHandler(1, Info); 
     44        alkuValikko.AddItemHandler(2, Exit); 
    4045    } 
    4146 
     
    4348    { 
    4449        ClearAll(); 
     50        Level.Width = Screen.Width; 
     51        Level.Height = Screen.Height; 
     52        Camera.Follow(pelaaja1); 
    4553        Gravity = new Vector(0, -1000); 
     54 
     55       // Level.Background.Image = taustakuva; 
     56        GameObject tausta = new GameObject(Level.Width * 0.5, Level.Height); 
     57        tausta.Image = taustakuva; 
     58        Add(tausta, -2); 
    4659 
    4760        LuoPisteLaskuri(); 
     
    7083        Add(b); 
    7184 
    72         MultiSelectWindow takaisin = new MultiSelectWindow("", "Takaisin"); 
    73         takaisin.AddItemHandler(0, Begin); 
    74         Add(takaisin); 
     85        MultiSelectWindow aloita = new MultiSelectWindow("", "Aloita peli"); 
     86        aloita.AddItemHandler(0, Pelaa); 
     87        Add(aloita); 
    7588 
    7689    } 
     
    8093        Label a = new Label("Candy Land, versio 1.0"); 
    8194        Label b = new Label("Copyright 2015 Aleksis Games by Aleksi Soikkala"); 
    82         Label c = new Label("Pelin tiedot ja päivitykset: http://aleksis-games.webnode.fi/candyland"); 
     95        Label c = new Label("Pelin tiedot ja päivitykset: http://aleksis-games.webnode.fi/pelit/candyland"); 
    8396        Label d = new Label("Aleksis Gamesin nettisivut: http://aleksis-games.webnode.fi"); 
    8497 
     
    102115    void LuoKentta() 
    103116    { 
    104         TileMap kentta = TileMap.FromLevelAsset("kentta1"); 
     117        TileMap kentta = TileMap.FromLevelAsset(kenttaNimi); 
    105118        kentta.SetTileMethod('#', LisaaTaso); 
    106119        kentta.SetTileMethod('*', LisaaTahti); 
     
    109122        kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    110123        Level.CreateBorders(); 
    111         Level.Background.CreateGradient(Color.White, Color.SkyBlue); 
     124        //Level.Background.CreateGradient(Color.White, Color.SkyBlue); 
    112125    } 
    113126 
     
    117130    { 
    118131        pisteLaskuri = new IntMeter(0, 0, 0); 
     132        pisteLaskuri.UpperLimit += VoititPelin; 
    119133 
    120134        pisteNaytto = new Label(); 
     
    130144        Add(pisteNaytto); 
    131145 
     146 
     147    } 
     148 
     149    void VoititPelin() 
     150    { 
     151 
     152        MessageDisplay.Add("Voitit pelin!"); 
     153        topLista.EnterAndShow(pisteLaskuri.Value); 
     154        kenttaNimi = "kentta2"; 
     155        topLista.HighScoreWindow.Closed += delegate(Window sender) { Pelaa(); }; 
     156 
    132157    } 
    133158 
     
    142167 
    143168            Label aikaNaytto = new Label(); 
    144             aikaNaytto.TextColor = Color.White; 
     169            aikaNaytto.X = Screen.Right - 150; 
     170            aikaNaytto.Y = Screen.Top - 100; 
     171            aikaNaytto.TextColor = Color.Black; 
     172            aikaNaytto.Color = Color.White; 
    145173            aikaNaytto.DecimalPlaces = 1; 
    146174            aikaNaytto.BindTo(alaspainLaskuri); 
     
    190218        pelaaja1.Mass = 4.0; 
    191219        pelaaja1.Image = pelaajanKuva; 
     220        pelaaja1.Shape = Shape.FromImage(pelaajanKuva); 
    192221        pelaaja1.Tag = "pelaaja"; 
    193222        AddCollisionHandler(pelaaja1, "tahti", KeraaKarkki); 
     
    202231            tekstiLaatikko.Position -= new Vector(0, 100); 
    203232 
     233            kenttaNimi = "kentta1"; 
    204234            pelaaja1.Destroy(); 
    205             Timer.SingleShot(5.0, Begin); 
     235 
     236            Timer.SingleShot(5.0, delegate { topLista.EnterAndShow(pisteLaskuri.Value); IsPaused = true; }); 
     237            topLista.HighScoreWindow.Closed += delegate(Window sender) { IsPaused = false;  Begin(); }; 
     238            //Timer.SingleShot(5.0, Begin); 
    206239             
    207240        }); 
     
    216249        vihollinen.Mass = 4.0; 
    217250        vihollinen.Image = vihollisenKuva; 
    218         vihollinen.Shape = Shape.FromImage(vihollisenKuva); 
     251         
    219252        vihollinen.Tag = "vihollinen"; 
    220253        vihollinen.IgnoresGravity = true; 
     
    236269        Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
    237270 
    238         ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 
    239  
    240         ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, Liikuta, "Pelaaja liikkuu vasemmalle", pelaaja1, -nopeus); 
    241         ControllerOne.Listen(Button.DPadRight, ButtonState.Down, Liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus); 
    242         ControllerOne.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
    243  
    244         PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
     271        //ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 
     272 
     273        //ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, Liikuta, "Pelaaja liikkuu vasemmalle", pelaaja1, -nopeus); 
     274        //ControllerOne.Listen(Button.DPadRight, ButtonState.Down, Liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus); 
     275        //ControllerOne.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
     276 
     277        //PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
    245278    } 
    246279    void TauotaPeli() 
  • 2015/24/AleksiS/CandyLand/CandyLand/CandyLand/CandyLand.csproj.Debug.cachefile

    r5978 r6052  
    44Content\YellowCandy.xnb 
    55Content\CandyThief.xnb 
     6Content\CandyLandBackgroundImage.xnb 
     7Content\kentta2.xnb 
  • 2015/24/AleksiS/CandyLand/CandyLand/CandyLand/obj/x86/Debug/CandyLand.csproj.FileListAbsolute.txt

    r5978 r6052  
    1212C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\YellowCandy.xnb 
    1313C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\CandyThief.xnb 
     14C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\CandyLandBackgroundImage.xnb 
     15C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\kentta2.xnb 
  • 2015/24/AleksiS/CandyLand/CandyLand/CandyLand/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml

    r6024 r6052  
    2727      <Options>None</Options> 
    2828      <Output>C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\tikku-ukko.xnb</Output> 
    29       <Time>2015-06-09T14:51:37.4592493+03:00</Time> 
     29      <Time>2015-06-12T10:45:58.8476151+03:00</Time> 
    3030    </Item> 
    3131    <Item> 
     
    4646      <Output>C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\CandyThief.xnb</Output> 
    4747      <Time>2015-06-11T12:59:18.9848266+03:00</Time> 
     48    </Item> 
     49    <Item> 
     50      <Source>CandyLandBackgroundImage.png</Source> 
     51      <Name>CandyLandBackgroundImage</Name> 
     52      <Importer>TextureImporter</Importer> 
     53      <Processor>TextureProcessor</Processor> 
     54      <Options>None</Options> 
     55      <Output>C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\CandyLandBackgroundImage.xnb</Output> 
     56      <Time>2015-06-12T09:39:27.5557129+03:00</Time> 
     57    </Item> 
     58    <Item> 
     59      <Source>kentta2.txt</Source> 
     60      <Name>kentta2</Name> 
     61      <Importer>TextFileImporter</Importer> 
     62      <Processor>TextFileContentProcessor</Processor> 
     63      <Options>None</Options> 
     64      <Output>C:\MyTemp\AleksiS\CandyLand\CandyLand\CandyLand\bin\x86\Debug\Content\kentta2.xnb</Output> 
     65      <Time>2015-06-12T10:28:14.9682378+03:00</Time> 
    4866    </Item> 
    4967    <BuildSuccessful>true</BuildSuccessful> 
  • 2015/24/AleksiS/CandyLand/CandyLand/CandyLand/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt

    r5978 r6052  
    44Content\YellowCandy.xnb 
    55Content\CandyThief.xnb 
     6Content\CandyLandBackgroundImage.xnb 
     7Content\kentta2.xnb 
  • 2015/24/AleksiS/CandyLand/CandyLand/CandyLandContent/CandyLandContent.contentproj

    r6020 r6052  
    5858  </ItemGroup> 
    5959  <ItemGroup> 
    60     <Compile Include="tikku-ukko.png"> 
    61       <Name>tikku-ukko</Name> 
    62       <Importer>TextureImporter</Importer> 
    63       <Processor>TextureProcessor</Processor> 
    64     </Compile> 
    65   </ItemGroup> 
    66   <ItemGroup> 
    6760    <Compile Include="YellowCandy.png"> 
    6861      <Name>YellowCandy</Name> 
     
    7871    </Compile> 
    7972  </ItemGroup> 
     73  <ItemGroup> 
     74    <Compile Include="CandyLandBackgroundImage.png"> 
     75      <Name>CandyLandBackgroundImage</Name> 
     76      <Importer>TextureImporter</Importer> 
     77      <Processor>TextureProcessor</Processor> 
     78    </Compile> 
     79  </ItemGroup> 
     80  <ItemGroup> 
     81    <Compile Include="kentta2.txt"> 
     82      <Name>kentta2</Name> 
     83      <Importer>TextFileImporter</Importer> 
     84      <Processor>TextFileContentProcessor</Processor> 
     85    </Compile> 
     86  </ItemGroup> 
     87  <ItemGroup> 
     88    <Compile Include="tikku-ukko.png"> 
     89      <Name>tikku-ukko</Name> 
     90      <Importer>TextureImporter</Importer> 
     91      <Processor>TextureProcessor</Processor> 
     92    </Compile> 
     93  </ItemGroup> 
    8094  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    8195  <!--  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.