Changeset 4973 for 2014/24/NooraH


Ignore:
Timestamp:
2014-06-12 13:25:58 (5 years ago)
Author:
noaialha
Message:
 
Location:
2014/24/NooraH/Diamond
Files:
5 added
5 deleted
14 edited

Legend:

Unmodified
Added
Removed
  • 2014/24/NooraH/Diamond/Diamond/Diamond/Diamond.cs

    r4960 r4973  
    2020    Image hahmokuva; 
    2121 
    22     Image[] hahmokuvat = LoadImages("Hahmo1", "Hahmo2","Pink"); 
     22    Image[] hahmokuvat = LoadImages("Hympi", "Hahmo2", "Pink", "häntukka"); 
    2323 
    2424    SoundEffect maaliAani = LoadSoundEffect("maali"); 
     25 
     26    IntMeter pisteLaskuri; 
    2527 
    2628    public override void Begin() 
     
    3436    void ValitseHahmo() 
    3537    { 
    36         MultiSelectWindow hahmoValikko = new MultiSelectWindow("Valitse Hahmo", "Hahmo1 ", "Hahmo2" , "Pink "); 
     38        MultiSelectWindow hahmoValikko = new MultiSelectWindow("Valitse Hahmo", "Hympi ", "Korsi", "Pink", "häntukka"); 
    3739        Add(hahmoValikko); 
    3840 
     
    4042        { 
    4143            int indeksi = i; 
    42             hahmoValikko.AddItemHandler(indeksi, delegate { 
     44            hahmoValikko.AddItemHandler(indeksi, delegate 
     45            { 
    4346                hahmokuva = hahmokuvat[indeksi]; 
    4447                AloitaPeli(); 
     
    5154        ClearAll(); 
    5255        LuoKentta(); 
     56        LuoPistelaskuri(); 
    5357        LisaaNappaimet(); 
    5458 
     
    6367 
    6468        TileMap kentta = TileMap.FromLevelAsset("kentta1"); 
    65         kentta.SetTileMethod('#', LisaaTaso1); 
    66         kentta.SetTileMethod('w', LisaaTaso2); 
    6769        kentta.SetTileMethod('t', LisaaTaso3); 
    6870        kentta.SetTileMethod('T', LisaaTaso4); 
     
    7375        kentta.SetTileMethod('u', LisaaTaso5); 
    7476        kentta.SetTileMethod('s', LisaaTaso6); 
     77        kentta.SetTileMethod('R', LisaaTayte1); 
     78        kentta.SetTileMethod('r', LisaaTayte2); 
     79        kentta.SetTileMethod('M', LisaaMaali); 
    7580        kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    7681        Level.CreateBorders(); 
    7782        Level.Background.CreateGradient(Color.White, Color.SkyBlue); 
    78     } 
    79  
    80     void LisaaTaso1(Vector paikka, double leveys, double korkeus) 
    81     {  
    82         LisaaTaso(paikka, leveys, korkeus, LoadImage("Maa")); 
    83     } 
    84  
    85     void LisaaTaso2(Vector paikka, double leveys, double korkeus) 
    86     {  
    87         LisaaTaso(paikka, leveys, korkeus, LoadImage("maanpinta")); 
    8883    } 
    8984 
     
    120115    void LisaaDiamond(Vector paikka, double leveys, double korkeus) 
    121116    { 
    122         PhysicsObject tahti = PhysicsObject.CreateStaticObject(leveys*0.5, korkeus*0.5); 
     117        PhysicsObject tahti = PhysicsObject.CreateStaticObject(leveys * 0.5, korkeus * 0.5); 
    123118        tahti.IgnoresCollisionResponse = true; 
    124119        tahti.Position = paikka; 
     
    130125    void LisaaPelaaja(Vector paikka, double leveys, double korkeus) 
    131126    { 
    132         pelaaja1 = new PlatformCharacter(leveys, korkeus); 
     127        pelaaja1 = new PlatformCharacter(leveys-2, korkeus-2); 
    133128        pelaaja1.Position = paikka; 
    134129        pelaaja1.Mass = 4.0; 
     
    137132        AddCollisionHandler(pelaaja1, "vaara", PelaajaKuolee); 
    138133        AddCollisionHandler(pelaaja1, "painovoima", painovoimamuuttuu); 
     134        AddCollisionHandler(pelaaja1, "Maali", TormaaMaaliin); 
    139135        Add(pelaaja1); 
    140136    } 
     
    176172    void TormaaTahteen(PhysicsObject hahmo, PhysicsObject tahti) 
    177173    { 
    178         maaliAani.Play(); 
    179         MessageDisplay.Add("Keräsit timanttin!"); 
     174        pisteLaskuri.Value++; 
    180175        tahti.Destroy(); 
    181176    } 
     
    184179    { 
    185180 
    186         PlatformCharacter Pahis = new PlatformCharacter(leveys*2, korkeus*2); 
     181        PlatformCharacter Pahis = new PlatformCharacter(leveys * 2, korkeus * 2); 
    187182        Add(Pahis); 
    188183        Pahis.Position = paikka; 
     
    205200    void LisaaPallo(Vector paikka, double leveys = 20, double korkeus = 20) 
    206201    { 
    207         PhysicsObject pallo = new PhysicsObject(leveys/2, korkeus/2); 
     202        PhysicsObject pallo = new PhysicsObject(leveys / 2, korkeus / 2); 
    208203        Add(pallo); 
    209204        pallo.Shape = Shape.Circle; 
     
    217212        hahmo.Position = taso.Position + new Vector(-45, 0); 
    218213    } 
     214 
     215    void LisaaTayte1(Vector paikka, double leveys, double korkeus) 
     216    { 
     217        GameObject taute = LuoTayte(paikka, leveys, korkeus, LoadImage("Tiili")); 
     218        Add(taute); 
     219    } 
     220 
     221    void LisaaTayte2(Vector paikka, double leveys, double korkeus) 
     222    { 
     223        GameObject taute = LuoTayte(paikka, leveys, korkeus, LoadImage("Tiili3")); 
     224        Add(taute); 
     225    } 
     226 
     227    GameObject LuoTayte(Vector paikka, double leveys, double korkeus, Image kuva) 
     228    { 
     229        GameObject tayte = new GameObject(leveys, korkeus); 
     230        tayte.Image = kuva; 
     231        tayte.Position = paikka; 
     232        return tayte; 
     233    } 
     234 
     235     
     236 
     237    void LuoPistelaskuri() 
     238    { 
     239        pisteLaskuri = new IntMeter(0); 
     240 
     241        Label pisteNaytto = new Label(); 
     242        pisteNaytto.X = Screen.Left + 100; 
     243        pisteNaytto.Y = Screen.Top - 100; 
     244        pisteNaytto.TextColor = Color.Fuchsia; 
     245        pisteNaytto.Color = Color.Snow; 
     246        pisteNaytto.IntFormatString = "Timanttia: {0:D1}"; 
     247        pisteNaytto.TextScale = new Vector(1.6, 1.6); 
     248 
     249        pisteNaytto.BindTo(pisteLaskuri); 
     250        Add(pisteNaytto); 
     251    } 
     252 
     253    void LisaaMaali(Vector paikka, double leveys, double korkeus) 
     254    { 
     255        PhysicsObject Maali = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     256        Maali.Position = paikka; 
     257        Maali.Tag = "Maali"; 
     258        //Maali.Image = kuva; 
     259        Maali.Color = Color.Teal; 
     260        Add(Maali); 
     261    } 
     262 
     263    void TormaaMaaliin(PhysicsObject hahmo, PhysicsObject tahti) 
     264    { 
     265        ClearAll(); 
     266        Label Teksti = new Label("Läpäisit pelin"); 
     267        Teksti.TextColor = Color.HotPink; 
     268        Add(Teksti); 
     269        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
     270        Teksti.TextScale = new Vector(5, 5); 
     271    } 
    219272} 
  • 2014/24/NooraH/Diamond/Diamond/Diamond/Diamond.csproj.Debug.cachefile

    r4960 r4973  
    1 Content\maali.xnb 
    21Content\Diamond.xnb 
    32Content\Pahis.xnb 
    4 Content\Hahmo1.xnb 
    53Content\Hahmo2.xnb 
    64Content\kentta1.xnb 
     
    86Content\Lumiukko.xnb 
    97Content\maanpinta.xnb 
    10 Content\Maa.xnb 
    118Content\Tiili2.xnb 
    129Content\Tiili.xnb 
     
    1512Content\Pink.xnb 
    1613Content\Tiili3.xnb 
     14Content\hympi.xnb 
     15Content\hÀntukka.xnb 
     16Content\Maali.xnb 
  • 2014/24/NooraH/Diamond/Diamond/Diamond/obj/x86/Debug/ContentPipeline-{1A7E25CE-F3A7-4CC7-9EF9-562C53D5D0D2}.xml

    r4960 r4973  
    22<XnaContent xmlns:Pipeline="Microsoft.Xna.Framework.Content.Pipeline"> 
    33  <Asset Type="Pipeline:BuildItemCollection"> 
    4     <Item> 
    5       <Source>maali.wav</Source> 
    6       <Name>maali</Name> 
    7       <Importer>WavImporter</Importer> 
    8       <Processor>SoundEffectProcessor</Processor> 
    9       <Options>None</Options> 
    10       <Output>C:\MyTemp\NooraH\Diamond\Diamond\Diamond\bin\x86\Debug\Content\maali.xnb</Output> 
    11       <Time>2014-06-11T10:03:36.7547054+03:00</Time> 
    12     </Item> 
    134    <Item> 
    145      <Source>Diamond.png</Source> 
     
    3021    </Item> 
    3122    <Item> 
    32       <Source>Hahmo1.png</Source> 
    33       <Name>Hahmo1</Name> 
    34       <Importer>TextureImporter</Importer> 
    35       <Processor>TextureProcessor</Processor> 
    36       <Options>None</Options> 
    37       <Output>C:\MyTemp\NooraH\Diamond\Diamond\Diamond\bin\x86\Debug\Content\Hahmo1.xnb</Output> 
    38       <Time>2014-06-11T10:03:36.7587058+03:00</Time> 
    39     </Item> 
    40     <Item> 
    4123      <Source>Hahmo2.png</Source> 
    4224      <Name>Hahmo2</Name> 
     
    5436      <Options>None</Options> 
    5537      <Output>C:\MyTemp\NooraH\Diamond\Diamond\Diamond\bin\x86\Debug\Content\kentta1.xnb</Output> 
    56       <Time>2014-06-11T14:46:00.9484321+03:00</Time> 
     38      <Time>2014-06-12T13:19:45.2897966+03:00</Time> 
    5739    </Item> 
    5840    <Item> 
     
    8264      <Output>C:\MyTemp\NooraH\Diamond\Diamond\Diamond\bin\x86\Debug\Content\maanpinta.xnb</Output> 
    8365      <Time>2014-06-11T12:01:52.9283035+03:00</Time> 
    84     </Item> 
    85     <Item> 
    86       <Source>Maa.png</Source> 
    87       <Name>Maa</Name> 
    88       <Importer>TextureImporter</Importer> 
    89       <Processor>TextureProcessor</Processor> 
    90       <Options>None</Options> 
    91       <Output>C:\MyTemp\NooraH\Diamond\Diamond\Diamond\bin\x86\Debug\Content\Maa.xnb</Output> 
    92       <Time>2014-06-11T12:03:39.8879984+03:00</Time> 
    9366    </Item> 
    9467    <Item> 
     
    146119      <Time>2014-06-11T14:23:40.0155128+03:00</Time> 
    147120    </Item> 
     121    <Item> 
     122      <Source>hympi.png</Source> 
     123      <Name>hympi</Name> 
     124      <Importer>TextureImporter</Importer> 
     125      <Processor>TextureProcessor</Processor> 
     126      <Options>None</Options> 
     127      <Output>C:\MyTemp\NooraH\Diamond\Diamond\Diamond\bin\x86\Debug\Content\hympi.xnb</Output> 
     128      <Time>2014-06-12T11:57:24.0635157+03:00</Time> 
     129    </Item> 
     130    <Item> 
     131      <Source>häntukka.png</Source> 
     132      <Name>häntukka</Name> 
     133      <Importer>TextureImporter</Importer> 
     134      <Processor>TextureProcessor</Processor> 
     135      <Options>None</Options> 
     136      <Output>C:\MyTemp\NooraH\Diamond\Diamond\Diamond\bin\x86\Debug\Content\häntukka.xnb</Output> 
     137      <Time>2014-06-12T12:15:55.0430624+03:00</Time> 
     138    </Item> 
     139    <Item> 
     140      <Source>Maali.png</Source> 
     141      <Name>Maali</Name> 
     142      <Importer>TextureImporter</Importer> 
     143      <Processor>TextureProcessor</Processor> 
     144      <Options>None</Options> 
     145      <Output>C:\MyTemp\NooraH\Diamond\Diamond\Diamond\bin\x86\Debug\Content\Maali.xnb</Output> 
     146      <Time>2014-06-12T13:14:12.8835593+03:00</Time> 
     147    </Item> 
    148148    <BuildSuccessful>true</BuildSuccessful> 
    149149    <Settings> 
  • 2014/24/NooraH/Diamond/Diamond/Diamond/obj/x86/Debug/Diamond.csproj.FileListAbsolute.txt

    r4960 r4973  
    1111C:\MyTemp\NooraH\Diamond\Diamond\Diamond\bin\x86\Debug\Content\Diamond.xnb 
    1212C:\MyTemp\NooraH\Diamond\Diamond\Diamond\bin\x86\Debug\Content\Pahis.xnb 
    13 C:\MyTemp\NooraH\Diamond\Diamond\Diamond\bin\x86\Debug\Content\Hahmo1.xnb 
    1413C:\MyTemp\NooraH\Diamond\Diamond\Diamond\bin\x86\Debug\Content\Hahmo2.xnb 
    1514C:\MyTemp\NooraH\Diamond\Diamond\Diamond\bin\x86\Debug\Content\Siili.xnb 
    1615C:\MyTemp\NooraH\Diamond\Diamond\Diamond\bin\x86\Debug\Content\Lumiukko.xnb 
    1716C:\MyTemp\NooraH\Diamond\Diamond\Diamond\bin\x86\Debug\Content\maanpinta.xnb 
    18 C:\MyTemp\NooraH\Diamond\Diamond\Diamond\bin\x86\Debug\Content\Maa.xnb 
    1917C:\MyTemp\NooraH\Diamond\Diamond\Diamond\bin\x86\Debug\Content\Tiili2.xnb 
    2018C:\MyTemp\NooraH\Diamond\Diamond\Diamond\bin\x86\Debug\Content\Tiili.xnb 
     
    2321C:\MyTemp\NooraH\Diamond\Diamond\Diamond\bin\x86\Debug\Content\Pink.xnb 
    2422C:\MyTemp\NooraH\Diamond\Diamond\Diamond\bin\x86\Debug\Content\Tiili3.xnb 
     23C:\MyTemp\NooraH\Diamond\Diamond\Diamond\bin\x86\Debug\Content\hympi.xnb 
     24C:\MyTemp\NooraH\Diamond\Diamond\Diamond\bin\x86\Debug\Content\hÀntukka.xnb 
  • 2014/24/NooraH/Diamond/Diamond/Diamond/obj/x86/Debug/cachefile-{1A7E25CE-F3A7-4CC7-9EF9-562C53D5D0D2}-targetpath.txt

    r4960 r4973  
    1 Content\maali.xnb 
    21Content\Diamond.xnb 
    32Content\Pahis.xnb 
    4 Content\Hahmo1.xnb 
    53Content\Hahmo2.xnb 
    64Content\kentta1.xnb 
     
    86Content\Lumiukko.xnb 
    97Content\maanpinta.xnb 
    10 Content\Maa.xnb 
    118Content\Tiili2.xnb 
    129Content\Tiili.xnb 
     
    1512Content\Pink.xnb 
    1613Content\Tiili3.xnb 
     14Content\hympi.xnb 
     15Content\hÀntukka.xnb 
     16Content\Maali.xnb 
  • 2014/24/NooraH/Diamond/Diamond/DiamondContent/DiamondContent.contentproj

    r4960 r4973  
    4646  </ItemGroup> 
    4747  <ItemGroup> 
    48     <Compile Include="maali.wav"> 
    49       <Name>maali</Name> 
    50       <Importer>WavImporter</Importer> 
    51       <Processor>SoundEffectProcessor</Processor> 
    52     </Compile> 
    5348    <Compile Include="kentta1.txt"> 
    5449      <Name>kentta1</Name> 
     
    6762    <Compile Include="Pahis.png"> 
    6863      <Name>Pahis</Name> 
    69       <Importer>TextureImporter</Importer> 
    70       <Processor>TextureProcessor</Processor> 
    71     </Compile> 
    72   </ItemGroup> 
    73   <ItemGroup> 
    74     <Compile Include="Hahmo1.png"> 
    75       <Name>Hahmo1</Name> 
    7664      <Importer>TextureImporter</Importer> 
    7765      <Processor>TextureProcessor</Processor> 
     
    10290    <Compile Include="maanpinta.png"> 
    10391      <Name>maanpinta</Name> 
    104       <Importer>TextureImporter</Importer> 
    105       <Processor>TextureProcessor</Processor> 
    106     </Compile> 
    107   </ItemGroup> 
    108   <ItemGroup> 
    109     <Compile Include="Maa.png"> 
    110       <Name>Maa</Name> 
    11192      <Importer>TextureImporter</Importer> 
    11293      <Processor>TextureProcessor</Processor> 
     
    155136    </Compile> 
    156137  </ItemGroup> 
     138  <ItemGroup> 
     139    <Compile Include="hympi.png"> 
     140      <Name>hympi</Name> 
     141      <Importer>TextureImporter</Importer> 
     142      <Processor>TextureProcessor</Processor> 
     143    </Compile> 
     144  </ItemGroup> 
     145  <ItemGroup> 
     146    <Compile Include="häntukka.png"> 
     147      <Name>häntukka</Name> 
     148      <Importer>TextureImporter</Importer> 
     149      <Processor>TextureProcessor</Processor> 
     150    </Compile> 
     151  </ItemGroup> 
     152  <ItemGroup> 
     153    <Compile Include="Maali.png"> 
     154      <Name>Maali</Name> 
     155      <Importer>TextureImporter</Importer> 
     156      <Processor>TextureProcessor</Processor> 
     157    </Compile> 
     158  </ItemGroup> 
    157159  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    158160  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2014/24/NooraH/Diamond/Diamond/DiamondContent/kentta1.txt

    r4960 r4973  
    11TTtTTTtTTTTTTttTTTTTtttTTTtTTTTttttTtTTTTtTTTTTttttTTTTTTTTtTttttttttttTttTTtTtTTTTtTttttttttttttTTTTTtttttTTttttTTTttttTTTttttttttttt 
    2 #                                                                                                                                    t 
    3 #                                                                                                                                    T 
    4 #                                                                                                                                    t 
    5 #                                                                                                                                    T 
    6 # ss                                                                                                                                 T 
    7 #TTT                               P               ***                                                                               t          
    8 #                            wwwwwwwwww  w  w  wwwwwwwwwwww  wwww   wwwwwwwwwww   wwwwwww                                            t 
    9     T                       w#########T        T##########T  ####   ###########   #######w                                           T 
    10    tt N     O   P ******   w##########T        T##########T  ####   ###########   ########w         P *   P  *   * P  
    11 T  tTwwwwwwwwwwwwwwwwwwwwww###########t        t##########T                                      wwwwwwwwwwwwwwwwwwwwwwww    wwwwwwwww    
    12 tt  tTtttttttTTTTTtttttttttTttttttttttt        t##########T                                   tt#########################            T 
    13 TTt                         *****   **         t##########t       P  ********   P           tttT#########################            t 
    14 ttttttttttttttTTTTtttTtTttTttttttttTTtttttttttttTttTttttttttttttttttttttttTttttttTtttttttttTTTTTTttttttttTtttttTttTtttttT            t 
    15 T   T  T   t              p    *      t     tt     T     tt               ttt                 tt           t     t    t u            t 
    16 T   t                t             tt            t          **                     tt                     t             u            T 
    17 t           T    P         P          **                           P     t                  Tt      t                   u        s   t 
    18 TTTTTTtttttttt      tTtttttttttttttttttttttTTTTTTTttttttttttttP         ttttttTTTTTTTtTtTtttTtttTTttTtttTTttttttTTttTTTtttttttTtTTtTtttt 
    19 ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt 
    20  
    21  
    22  
    23  
    24  
    25  
    26  
    27  
    28  
    29  
     2t                                                           t t               t                   t            t                     t 
     3t                                        tttttttt                                                                                    T 
     4t                                                                                                                                    t 
     5t                                                                                                                            *****   T 
     6t ss                                                                                                                         *****   T 
     7tTTT                               P               ***         p         P          ******                                   ttttt  Tt          
     8t                            TTTTTtTTTT  t  t  ttttTTTtTttt  Tttt   TtTTttttttT   TTtTTtttt                                        ttt 
     9     T                      tRRRrrRrRrt        tRRrrrrrrrrt  tTTt   TTtTttttttt   TTtTttTttt                                     Ttttt 
     10    t N      P********     trrrrrrrrRRR        tRRrrRrrRrrr                                         P * P * P * P * P           TttTtt 
     11T  tTTTTTTTTTTTTTTTTTTTTTTTrRRrrRRrRRRt        tRrrrrrrRRRT                                     tTTttttttTTtTttTttttTtttt   ttTttttTtTt   
     12rt  tTtttttttTTTTTtttttttttTttttttttttt        tRrRrRrrRRRT                                   ttRRRRRRRRRrrrrrrrrrrrrrrrt            T 
     13RRt                         *****   **         tRrrrRRrrrrt       P  ********   P     P     tttTRRRRRRrrrrrrrrRRrrrrrrrrT            t 
     14RrttttttttttttTTTTtttTtTttTttttttttTTtttttttttttRRrrrRrRrRttttttttttttttttTttttttTtttttttttTTTTTTttttttttTtttttTttTtttttT            t 
     15TRRRRRRRRRRRRrrrrrrrrrrrrrrrrrrrRRRrrrRrrrrrrrrrRRrrrRrrRrrrrrrRRRRrrRRRrRrrrRrrrRrrrRrrrrrrrrrRRRRRRRRRRrrrrrrrRrrrRrrRt            t 
     16TRRrRrrrRrRRrrrrRrrrrrrrrRRRrRrrrrrrrrRRrRrrrrrrrRRrrrrrrrrRrrrRRrrrRrrrrRrRRrRrRRrRRRrrRRRrRRrRRRRRRRRRRRRRrrrrrrRRrrrRt            T 
     17tRrrrRRrrrrrrrrRRRRRRrrrrrrrrrrrrrrrrrRRRRrrrRrrrrrrrrRRrrRRRrRrRrRRRRRRRRRRRRRRRRRrrrrrrrrrrrrrrrrrrrRRRRrrRrrrrrrRrrrrT            T 
     18MMMMMttttttttttttTTtTttttTTTTTTTttttttTTTTTtttTTTTttttTTTTtttttttTTTtttTTTttTtTTtTtTttTttttttTTtttttttTtTTtTtTtTttttttTTT            t 
     19M   T  T   t              p    *      t     tt     T     tt         p       ttt                 tt          t     t   t u            t 
     20M   t                t             tt            t          **                     tt                     t             u            T 
     21M    **     T    P         P          **   ttttt                P     t         t            Tt      t                  u s s s s p  t 
     22TTtTTTttttttt      tTtt       ttttttttttttTTTTTTTtttttttttttt          ttttttTTTTTTTtTtTtttTtttTTttTtttTTttttttTTttTTTtttttttTtTTtTtttt 
     23RRrrrRrrrrrrtttttttttttttttttttRRrrrrRRRRrrRRRRrrrRRRrrrrRRRttttttttttttRRRrrrRrrRRrrRRRrrRrrrRrRrRrrRRrrrrRrrrRRRrRRrrrrRRRrrRRRrrrRrR 
Note: See TracChangeset for help on using the changeset viewer.