Changeset 2600 for 2011/31


Ignore:
Timestamp:
2011-08-05 12:27:37 (12 years ago)
Author:
daalhaat
Message:

Talletus.

Location:
2011/31/DanH
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • 2011/31/DanH/Dragonfighter/Dragonfighter/Dragonfighter/Dragonfighter.csproj

    r2564 r2600  
    125125      <CopyToOutputDirectory>Always</CopyToOutputDirectory> 
    126126    </Content> 
     127    <Content Include="Slayer - Raining Blood.mp3" /> 
    127128    <Content Include="Stance.png" /> 
    128129    <Content Include="StanceGood.png" /> 
  • 2011/31/DanH/Dragonfighter/Dragonfighter/Dragonfighter/Peli.cs

    r2564 r2600  
    1212{ 
    1313 
     14       List<Label> valikonKohdat; 
     15 
     16 
    1417 
    1518       Image olionKuva = LoadImage("Thunderbolt3"); 
     
    1922 
    2023 
    21     const double nopeus = 450; 
    22     const double hyppyNopeus = 1500; 
     24    const double nopeus = 360; 
     25    const double hyppyNopeus = 2000; 
    2326    const int RUUDUN_KOKO = 50; 
    2427 
     
    5255 
    5356 
    54         
    55         
    56         
    57  
    58  
    59  
     57 
     58 
     59 
     60 
     61 
     62  
     63      
    6064 
    6165 
     
    7074 
    7175      public override void Begin() 
    72     { 
    73  
    74  
    75           
    76  
    77            
    78           pelaaja1Elama = new DoubleMeter( 100 ); 
    79         pelaaja1Elama.MaxValue = 100; 
    80  
    81         pelaaja2Elama = new DoubleMeter(100); 
    82         pelaaja2Elama.MaxValue = 100; 
    83  
    84  
    85         paikallaanOikealle = Image.Mirror(paikallaanVasemmalle); 
    86         kavelyOikealle = Image.Mirror(kavelyVasemmalle); 
    87  
    88         paikallaanOikealle2 = Image.Mirror(paikallaanVasemmalle2); 
    89         kavelyOikealle2 = Image.Mirror(kavelyVasemmalle2); 
    90          
    91  
    92         Gravity = new Vector(0, -900); 
    93  
    94         luoKentta(); 
    95         lisaaNappaimet(); 
    96  
    97         IsFullScreen = true; 
    98  
    99         Camera.ZoomToLevel(); 
    100  
    101      
     76      { 
     77 
     78          { 
     79              Valikko(); 
     80          } 
     81 
     82 
     83 
    10284      } 
    103  
    104  
    105  
    106        
    107         
    108  
    10985 
    11086 
     
    12399        kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    124100        Level.CreateBorders(); 
    125         Level.Background.CreateGradient(Color.White, Color.Blue); 
     101        Level.Background.CreateGradient(Color.Green, Color.Blue); 
    126102 
    127103 
     
    143119        pelaaja1 = new PlatformCharacter (leveys, korkeus); 
    144120        pelaaja1.Position = paikka; 
    145         pelaaja1.Mass = 1.0; 
     121        pelaaja1.Mass = 7.0; 
    146122        pelaaja1.Image = Dragon; 
    147123 
     
    152128 
    153129        pelaaja1.Weapon = new PlasmaCannon(20, 5); 
    154  
     130        pelaaja1.Weapon.IsVisible = false; 
     131        pelaaja1.Weapon.Ammo.Value = int.MaxValue; 
    155132        pelaaja1.Weapon.ProjectileCollision = AmmusOsui; 
    156133 
     
    167144        pelaaja1ElamaPalkki.Color = Color.Black; 
    168145        pelaaja1ElamaPalkki.BarColor = Color.Red; 
     146         
    169147        Add(pelaaja1ElamaPalkki); 
    170148 
     
    181159        pelaaja2 = new PlatformCharacter(leveys, korkeus); 
    182160        pelaaja2.Position = paikka; 
    183         pelaaja2.Mass = 4.0; 
     161        pelaaja2.Mass = 7.0; 
    184162        pelaaja2.Image = Hunter; 
    185163 
     
    187165 
    188166        pelaaja2.Weapon = new PlasmaCannon(20, 5); 
    189  
     167        pelaaja2.Weapon.IsVisible = false; 
     168        pelaaja2.Weapon.Ammo.Value = int.MaxValue; 
    190169        pelaaja2.Weapon.ProjectileCollision = AmmusOsui2; 
    191  
    192170        pelaaja2.LeftIdleAnimation = new Animation(paikallaanVasemmalle2); 
    193171        pelaaja2.RightIdleAnimation = new Animation(paikallaanOikealle2); 
     
    223201        Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, "Näytä ohjeet"); 
    224202        Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, "Poistu pelistä"); 
    225  
    226         Keyboard.Listen(Key.Left, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, - nopeus); 
    227         Keyboard.Listen(Key.Right, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 
    228         Keyboard.Listen(Key.Up, ButtonState.Pressed, hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
    229         Keyboard.Listen(Key.L, ButtonState.Pressed, AmmuAseella, "Ammu"); 
     203        Keyboard.Listen(Key.P, ButtonState.Pressed, Valikko, "Palaa valikkoon"); 
     204         
     205        Keyboard.Listen(Key.A, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, - nopeus); 
     206        Keyboard.Listen(Key.D, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 
     207        Keyboard.Listen(Key.W, ButtonState.Pressed, hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
     208        Keyboard.Listen(Key.G, ButtonState.Pressed, AmmuAseella, "Ammu"); 
    230209 
    231210        ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 
     
    236215 
    237216 
    238         Keyboard.Listen(Key.A, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja2, -nopeus); 
    239         Keyboard.Listen(Key.D, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja2, nopeus); 
    240         Keyboard.Listen(Key.W, ButtonState.Pressed, hyppaa, "Pelaaja hyppää", pelaaja2, hyppyNopeus); 
    241         Keyboard.Listen(Key.G, ButtonState.Pressed, AmmuAseella2, "Ammu" ); 
    242      
    243      
     217        Keyboard.Listen(Key.Left, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja2, -nopeus); 
     218        Keyboard.Listen(Key.Right, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja2, nopeus); 
     219        Keyboard.Listen(Key.Up, ButtonState.Pressed, hyppaa, "Pelaaja hyppää", pelaaja2, hyppyNopeus); 
     220        Keyboard.Listen(Key.L, ButtonState.Pressed, AmmuAseella2, "Ammu" ); 
     221 
     222         
    244223     
    245224                                                                  
     
    262241    { 
    263242        PhysicsObject ammus = pelaaja1.Weapon.Shoot(); 
    264          
     243 
    265244        if (ammus != null) 
     245 
    266246        { 
    267247            ammus.Size *= 5; 
     
    276256 
    277257        if (ammus2 != null) 
     258 
    278259        { 
    279260            ammus2.Size *= 5; 
     
    297278        { 
    298279            pelaaja2Elama.Value--; 
    299         } 
     280           
     281 
     282            if (pelaaja2Elama.Value == 0) 
     283            { 
     284                pelaaja2.Destroy(); 
     285            } 
     286         
     287        } 
     288 
    300289 
    301290        
     
    305294    void AmmusOsui2(PhysicsObject ammus2, PhysicsObject kohde) 
    306295    { 
     296        ammus2.Destroy(); 
    307297 
    308298        if (kohde == pelaaja1) 
     
    310300            pelaaja1Elama.Value--; 
    311301        } 
    312         ammus2.Destroy(); 
    313         
    314          
    315     } 
    316  
    317  
    318  
    319         
    320     
     302        if (pelaaja1Elama.Value == 0) 
     303        { 
     304            pelaaja1.Destroy(); 
     305 
     306        } 
     307        
     308         
     309    } 
     310 
     311 
     312 
     313 
     314    void Valikko() 
     315    { 
     316        ClearAll(); 
     317        valikonKohdat = new List<Label>(); 
     318 
     319        Label kohta1 = new Label("Start"); 
     320        kohta1.Position = new Vector(0, 40); 
     321        valikonKohdat.Add(kohta1); 
     322 
     323        Label kohta2 = new Label("Exit"); 
     324        kohta2.Position = new Vector(0, -40); 
     325         
     326        valikonKohdat.Add(kohta2); 
     327 
     328        foreach (Label valikonKohta in valikonKohdat) 
     329        { 
     330            Add(valikonKohta); 
     331        } 
     332 
     333        Mouse.ListenOn(kohta1, MouseButton.Left, ButtonState.Pressed, AloitaPeli, null); 
     334        Mouse.ListenOn(kohta2, MouseButton.Left, ButtonState.Pressed, Exit, null); 
     335 
     336        Mouse.IsCursorVisible = true; 
     337        Mouse.ListenMovement(1.0, ValikossaLiikkuminen, null); 
     338        Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, ""); 
     339    } 
     340 
     341    void ValikossaLiikkuminen(AnalogState hiirenTila) 
     342    { 
     343        foreach (Label kohta in valikonKohdat) 
     344        { 
     345            if (Mouse.IsCursorOn(kohta)) 
     346            { 
     347                kohta.TextColor = Color.Red; 
     348            } 
     349            else 
     350            { 
     351                kohta.TextColor = Color.Black; 
     352            } 
     353 
     354        } 
     355    } 
     356 
     357    void AloitaPeli() 
     358    { 
     359        ClearAll(); 
     360        MessageDisplay.Add("Song: Slayer-Raining Blood"); 
     361        MessageDisplay.MessageTime = new TimeSpan(0, 0, 10); 
     362 
     363 
     364 
     365 
     366        pelaaja1Elama = new DoubleMeter(100); 
     367        pelaaja1Elama.MaxValue = 100; 
     368 
     369        pelaaja2Elama = new DoubleMeter(100); 
     370        pelaaja2Elama.MaxValue = 100; 
     371 
     372 
     373        paikallaanOikealle = Image.Mirror(paikallaanVasemmalle); 
     374        kavelyOikealle = Image.Mirror(kavelyVasemmalle); 
     375 
     376        paikallaanOikealle2 = Image.Mirror(paikallaanVasemmalle2); 
     377        kavelyOikealle2 = Image.Mirror(kavelyVasemmalle2); 
     378 
     379 
     380        Gravity = new Vector(0, -1900); 
     381 
     382        luoKentta(); 
     383        lisaaNappaimet(); 
     384 
     385        IsFullScreen = true; 
     386 
     387        Camera.ZoomFactor = 0.6; 
     388 
     389 
     390 
     391 
     392 
     393 
     394        MediaPlayer.Play("Slayer - Raining Blood"); 
     395    } 
     396 
    321397    
    322398    
    323399    
    324400} 
     401 
     402 
     403 
     404 
     405 
     406 
  • 2011/31/DanH/Dragonfighter/Dragonfighter/Dragonfighter/kentta1.txt

    r2564 r2600  
    11  
    22 
     3    
    34 
     5 
     6   
     7           ###############          
     8 
     9     ###                     ### 
     10 
     11 
     12 
     13 
     14               ###     #####     ###   
    415  
    516 
    617 
    718 
    8                 
    9        ###########  
    1019 
    11                     
    12     ###    ###    ### 
    13  
    14             
    15   N           #            X   
    16   ############################  
     20               ### ### 
     21   N              #                X   
     22  ################################## 
  • 2011/31/DanH/Dragonfighter/Dragonfighter/DragonfighterContent/DragonfighterContent.contentproj

    r2564 r2600  
    100100    </Compile> 
    101101  </ItemGroup> 
     102  <ItemGroup> 
     103    <Compile Include="Slayer - Raining Blood.mp3"> 
     104      <Name>Slayer - Raining Blood</Name> 
     105      <Importer>Mp3Importer</Importer> 
     106      <Processor>SongProcessor</Processor> 
     107    </Compile> 
     108  </ItemGroup> 
    102109  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    103110  <!--  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.