Ignore:
Timestamp:
2016-06-16 14:57:31 (7 years ago)
Author:
majuvika
Message:
 
Location:
2016/24/MattiK/ZlandZ/ZlandZ
Files:
10 added
12 edited

Legend:

Unmodified
Added
Removed
  • 2016/24/MattiK/ZlandZ/ZlandZ/ZlandZ/ZlandZ.cs

    r7336 r7382  
    1212    const double hyppyNopeus = 750; 
    1313    const int RUUDUN_KOKO = 40; 
     14    private int bossinElamat = 500; 
     15    EasyHighScore topLista = new EasyHighScore(); 
    1416 
    1517    PlatformCharacter Leaf; 
     
    1820 
    1921    LaserGun LeafinAse; 
    20  
     22    IntMeter pisteLaskuri; 
    2123    Image pelaajanKuva = LoadImage("lintu"); 
     24    Image gene = LoadImage("gene"); 
     25    Image nuke = LoadImage("nuke"); 
    2226    Image orkki = LoadImage("orkki"); 
    2327    Image GuninKuva = LoadImage("gun"); 
     
    3135    public override void Begin() 
    3236    { 
     37        MultiSelectWindow alkuValikko = new MultiSelectWindow("ZlandZ", 
     38"Aloita peli", "Parhaat pisteet", "Lopeta"); 
     39        Add(alkuValikko); 
     40        alkuValikko.AddItemHandler(0, AloitaPeli); 
     41        alkuValikko.AddItemHandler(1, ParhaatPisteet); 
     42        alkuValikko.AddItemHandler(2, Exit); 
     43        Level.Background.Image = LoadImage("niga"); 
     44        Level.Background.FitToLevel(); 
     45        alkuValikko.Color = Color.Red; 
     46        Level.Background.Color = Color.Black; 
     47    } 
     48 
     49 
     50 
     51    void AloitaPeli() 
     52    { 
     53        ClearAll(); 
    3354        Gravity = new Vector(0, -1000); 
    3455 
     
    4364    } 
    4465 
     66    void ParhaatPisteet() 
     67    { 
     68    } 
     69 
    4570    void LuoKentta() 
    4671    { 
     
    4974 
    5075        kentta.SetTileMethod('#', LisaaTaso); 
     76        kentta.SetTileMethod('d', LisaaGene); 
    5177        kentta.SetTileMethod('G', Lisaagun); 
    5278        kentta.SetTileMethod('O', LisaaOrkki); 
     
    5480        kentta.SetTileMethod('b', LisaaBox); 
    5581        kentta.SetTileMethod('N', LisaaPelaaja); 
     82        kentta.SetTileMethod('L', LisaaNuke); 
    5683        kentta.SetTileMethod('P', LisaaPiikki); 
    5784        kentta.SetTileMethod('S', LisaaVihu); 
     
    5986        Level.CreateBorders(); 
    6087        Level.Background.CreateGradient(Color.Black, Color.Red); 
     88 
    6189 
    6290    } 
     
    98126        Add(Orkki); 
    99127        Orkki.Image = orkki; 
    100         Orkki.Tag = "pahis"; 
     128        Orkki.Tag = "orkki"; 
    101129        PlatformWandererBrain tasoAivot = new PlatformWandererBrain(); 
    102130        tasoAivot.Speed = 50; 
     
    131159        Add(Box); 
    132160    } 
     161    void LisaaNuke(Vector paikka, double leveys, double korkeus) 
     162    { 
     163        PhysicsObject nuke = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     164        nuke.IgnoresCollisionResponse = true; 
     165        nuke.Position = paikka; 
     166        nuke.Image = this.nuke; 
     167        nuke.Tag = "nuke"; 
     168        Add(nuke); 
     169 
     170    } 
     171 
     172    void LisaaGene(Vector paikka, double leveys, double korkeus) 
     173    { 
     174        PhysicsObject gene = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     175        gene.IgnoresCollisionResponse = true; 
     176        gene.Position = paikka; 
     177        gene.Image = this.gene; 
     178        gene.Tag = "gene"; 
     179        Add(gene); 
     180 
     181    } 
     182 
     183 
    133184    void LisaaVihu(Vector paikka, double leveys, double korkeus) 
    134185    { 
     
    170221        AddCollisionHandler(Leaf, "pahis", TormaaVihuun); 
    171222        AddCollisionHandler(Leaf, "piikki", TormaaPiikkiin); 
     223        AddCollisionHandler(Leaf, "gene", TormaaGeneen); 
    172224        Add(Leaf); 
    173225        //pelaaja1 on PlatformCharacter-tyyppinen 
     
    188240            kohde.Destroy(); 
    189241        } 
     242        if (kohde.Tag.Equals("orkki")) 
     243        { 
     244            bossinElamat -= 10; 
     245            if (bossinElamat <= 0) kohde.Destroy(); 
     246        } 
    190247    } 
    191248    void AmmuAseella(PlatformCharacter pelaaja) 
     
    206263    { 
    207264        Sombombo.Destroy(); 
     265        pisteLaskuri.Value += 2; 
     266    } 
     267 
     268 
     269    void LuoPistelaskuri() 
     270    { 
     271        pisteLaskuri = new IntMeter(0); 
     272 
     273        Label pisteNaytto = new Label(); 
     274        pisteNaytto.X = Screen.Left + 100; 
     275        pisteNaytto.Y = Screen.Top - 100; 
     276        pisteNaytto.TextColor = Color.Black; 
     277        pisteNaytto.Color = Color.White; 
     278 
     279        pisteNaytto.BindTo(pisteLaskuri); 
     280        Add(pisteNaytto); 
    208281    } 
    209282 
     
    222295        ControllerOne.Listen(Button.DPadRight, ButtonState.Down, Liikuta, "Pelaaja liikkuu oikealle", Leaf, nopeus); 
    223296        ControllerOne.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", Leaf, hyppyNopeus); 
    224  
    225  
    226  
    227     } 
     297        IntMeter pisteLaskuri; 
     298    } 
     299 
     300 
     301 
    228302 
    229303    void Liikuta(PlatformCharacter hahmo, double nopeus) 
     
    243317        MessageDisplay.Add("Keräsit Boxin!"); 
    244318        Box.Destroy(); 
     319        pisteLaskuri.Value += 5; 
    245320    } 
    246321    void TormaaVihuun(PhysicsObject hahmo, PhysicsObject vihu) 
     
    261336        MessageDisplay.Add("You died"); 
    262337        Giant.Destroy(); 
     338 
    263339    } 
    264340    void TormaaPiikkiin(PhysicsObject hahmo, PhysicsObject piikki) 
     
    279355        Leaf.Weapon.ProjectileCollision = AmmusOsui; 
    280356    } 
    281  
     357    void TormaaGeneen(PhysicsObject pelaaja, PhysicsObject gene) 
     358    { 
     359        StopAll(); 
     360        PelaajaKuoli(); 
     361 
     362 
     363 
     364    } 
     365 
     366    void PelaajaKuoli() 
     367    { 
     368 
     369        topLista.EnterAndShow(pisteLaskuri.Value); 
     370        topLista.HighScoreWindow.Closed += PeliLoppui; 
     371    } 
     372 
     373    void PeliLoppui(Window sender) 
     374    { 
     375        ClearAll(); 
     376        Begin(); 
     377    } 
    282378} 
  • 2016/24/MattiK/ZlandZ/ZlandZ/ZlandZ/ZlandZ.csproj.Debug.cachefile

    r7336 r7382  
    1111Content\gun.xnb 
    1212Content\orkki.xnb 
     13Content\niga.xnb 
     14Content\gene.xnb 
     15Content\nuke.xnb 
  • 2016/24/MattiK/ZlandZ/ZlandZ/ZlandZ/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml

    r7336 r7382  
    3636      <Options>None</Options> 
    3737      <Output>C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\kentta1.xnb</Output> 
    38       <Time>2016-06-15T14:40:38.3402243+03:00</Time> 
     38      <Time>2016-06-16T14:23:58.4053836+03:00</Time> 
    3939    </Item> 
    4040    <Item> 
     
    110110      <Time>2016-06-15T13:25:01.0026751+03:00</Time> 
    111111    </Item> 
     112    <Item> 
     113      <Source>niga.png</Source> 
     114      <Name>niga</Name> 
     115      <Importer>TextureImporter</Importer> 
     116      <Processor>TextureProcessor</Processor> 
     117      <Options>None</Options> 
     118      <Output>C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\niga.xnb</Output> 
     119      <Time>2016-06-16T10:23:11.56569+03:00</Time> 
     120    </Item> 
     121    <Item> 
     122      <Source>gene.png</Source> 
     123      <Name>gene</Name> 
     124      <Importer>TextureImporter</Importer> 
     125      <Processor>TextureProcessor</Processor> 
     126      <Options>None</Options> 
     127      <Output>C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\gene.xnb</Output> 
     128      <Time>2016-06-16T11:02:20.9326671+03:00</Time> 
     129    </Item> 
     130    <Item> 
     131      <Source>nuke.png</Source> 
     132      <Name>nuke</Name> 
     133      <Importer>TextureImporter</Importer> 
     134      <Processor>TextureProcessor</Processor> 
     135      <Options>None</Options> 
     136      <Output>C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\nuke.xnb</Output> 
     137      <Time>2016-06-16T11:15:53.088256+03:00</Time> 
     138    </Item> 
    112139    <BuildSuccessful>true</BuildSuccessful> 
    113140    <Settings> 
  • 2016/24/MattiK/ZlandZ/ZlandZ/ZlandZ/obj/x86/Debug/ZlandZ.csproj.FileListAbsolute.txt

    r7336 r7382  
    1919C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\gun.xnb 
    2020C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\orkki.xnb 
     21C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\niga.xnb 
     22C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\gene.xnb 
     23C:\MyTemp\MattiK\ZlandZ\ZlandZ\ZlandZ\bin\x86\Debug\Content\nuke.xnb 
  • 2016/24/MattiK/ZlandZ/ZlandZ/ZlandZ/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt

    r7336 r7382  
    1111Content\gun.xnb 
    1212Content\orkki.xnb 
     13Content\niga.xnb 
     14Content\gene.xnb 
     15Content\nuke.xnb 
  • 2016/24/MattiK/ZlandZ/ZlandZ/ZlandZContent/ZlandZContent.contentproj

    r7336 r7382  
    123123    </Compile> 
    124124  </ItemGroup> 
     125  <ItemGroup> 
     126    <Compile Include="niga.png"> 
     127      <Name>niga</Name> 
     128      <Importer>TextureImporter</Importer> 
     129      <Processor>TextureProcessor</Processor> 
     130    </Compile> 
     131  </ItemGroup> 
     132  <ItemGroup> 
     133    <Compile Include="gene.png"> 
     134      <Name>gene</Name> 
     135      <Importer>TextureImporter</Importer> 
     136      <Processor>TextureProcessor</Processor> 
     137    </Compile> 
     138  </ItemGroup> 
     139  <ItemGroup> 
     140    <Compile Include="nuke.png"> 
     141      <Name>nuke</Name> 
     142      <Importer>TextureImporter</Importer> 
     143      <Processor>TextureProcessor</Processor> 
     144    </Compile> 
     145  </ItemGroup> 
    125146  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    126147  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2016/24/MattiK/ZlandZ/ZlandZ/ZlandZContent/kentta1.txt

    r7336 r7382  
    33          
    44          
    5           
    6 ################################################################################################################################################################################################ 
     5 
     6 
    77            
    8                                                                                                                                                                                                      # 
     8                                                                                                                                                                                                      
    99                                                                                                                                                                                                                                                                     
    10                                                                                                                                                                                                                                                                                                                       # 
     10                                                                                                                                                                                                                                                                                                                       
    1111 
    12                                                                                                                                                                                            # 
    13                                           b  b                                                  b 
    14                                                                                                                                           S   S                                                                                     # 
    15                                         #  ###  #                   b  b  b                 # P # P #            # #         b    b    b    b 
    16        O       S      S              ##             ##               S  B  S               # P       P #           G          P    P    P    P                #   #   #   #          # 
    17 N           ####PPP####            PPP S PPPPPPP S PPP    B      ##P##P##P##P##         # PPPPPPPPPPPPP #        # #         P    P    P    P                # S # S # S #                         
    18 ############################################################################################################################################################################################################## 
    19                                                                                          
     12                                                                                                                                                                                            
     13                                            b                                                    b 
     14                                                                                                                               S   S                                                                                     
     15                                        #  ###  #                   b  b  b                 # P # P #            # #         b    b    b    b                #   #   #   #                           O 
     16              S      S              ##             ##               S  B  S               # P       P #           G          P    P    P    P                #   #   #   #           
     17N           ####PPP####   b        PPP S PPPPPPP S PPP    B      ##P##P##P##P##         # PPPPPPPPPPPPP #        # #         P    P    P    P                # S # S # S #                                  dL 
     18#############################################################################################################################################################PPPPPPPPPPPPP#################################### 
     19                                                                                                                                                                                   
Note: See TracChangeset for help on using the changeset viewer.