Changeset 2398 for 2011/26


Ignore:
Timestamp:
2011-07-01 10:35:14 (12 years ago)
Author:
riroos
Message:

Talletus.

Location:
2011/26/RistoR/ding/ding
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • 2011/26/RistoR/ding/ding/ding/Peli.cs

    r2377 r2398  
    1818public class Peli : PhysicsGame 
    1919{ 
     20    ScoreList topLista = new ScoreList(10, false, 0); 
     21 
    2022    const double nopeus = 250; 
    2123    const double hyppyNopeus = 1000; 
     
    2325    PlatformCharacter pelaaja1; 
    2426    List<Label> valikonKohdat; 
    25  
     27    Image maaliimage = LoadImage("maaliimage"); 
    2628    Image paavalikko = LoadImage("paavalikko"); 
    2729    Image pelaajanKuva = LoadImage("pelaaja"); 
     
    4749        Camera.StayInLevel = true; 
    4850    } 
     51 
    4952    void luoKentta() 
    5053    { 
     
    5861        kentta.Insert(RUUDUN_KOKO, RUUDUN_KOKO); 
    5962        Level.CreateBorders(); 
    60         Level.Background.CreateStars(500); 
     63        Level.Background.CreateGradient(Color.Gray, Color.DarkRed); 
     64 
    6165    } 
    6266    PhysicsObject lisaaTaso() 
     
    129133        Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, "Näytä ohjeet"); 
    130134        Keyboard.Listen(Key.Escape, ButtonState.Pressed, valikko, "Palaa valikkoon"); 
     135        Keyboard.Listen(Key.R, ButtonState.Pressed, AloitaPeli, null); 
     136 
    131137 
    132138        Keyboard.Listen(Key.A, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, -nopeus); 
    133139        Keyboard.Listen(Key.D, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 
    134140        Keyboard.Listen(Key.Space, ButtonState.Down, hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
    135         Keyboard.Listen(Key.Down, ButtonState.Down, AmmuAseella, "Ammu"); 
     141        Keyboard.Listen(Key.G, ButtonState.Down, AmmuAseella, "Ammu"); 
    136142        Keyboard.Listen(Key.W, ButtonState.Down, kaannaasettaylos, "Käännä asetta ylös"); 
    137143        Keyboard.Listen(Key.S, ButtonState.Down, kaannaasettaalas, "Käännä asetta alas"); 
    138         Keyboard.Listen(Key.Up, ButtonState.Pressed, HeitaKranaatti, "Heitä kranaatti"); 
     144        Keyboard.Listen(Key.Up, ButtonState.Pressed, painoylos, "???"); 
     145        Keyboard.Listen(Key.Down, ButtonState.Pressed, painoalas, "???"); 
    139146        ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 
    140147 
     
    155162        if (kohde.Tag.ToString() == "tahti") 
    156163        { 
    157             maaliAani.Play(); 
    158164            pistelaskuri.Value += 1; 
    159165            kohde.Destroy(); 
     
    255261        kranaatti.Y = pelaaja1.Y + 10; 
    256262        Add(kranaatti); 
    257         Vector heittoVoima = Vector.FromLengthAndAngle(4000, pelaaja1.Weapon.Angle); 
     263        Vector heittoVoima = Vector.FromLengthAndAngle(6000, pelaaja1.Weapon.Angle); 
    258264        kranaatti.Hit(heittoVoima); 
    259265    } 
     
    292298    { 
    293299        ClearAll(); 
    294         Level.Background.Image ("paavalikko"); 
     300        Level.Background.Image = LoadImage("paavalikko"); 
    295301        valikonKohdat = new List<Label>(); 
    296  
    297302        Label kohta1 = new Label("Aloita uusi peli"); 
    298303        kohta1.Position = new Vector(0, 40); 
     
    347352    void Voitto() 
    348353    { 
     354        Level.Background.Image = LoadImage("maaliimage"); 
    349355        Label nappi = new Label("Aloita uusi peli"); 
    350356        nappi.Position = new Vector(0, 40); 
     
    367373 
    368374    } 
     375    void painoylos() 
     376    { 
     377        Gravity = new Vector(0.0, 900.0); 
     378    } 
     379    void painoalas() 
     380    { 
     381        Gravity = new Vector(0.0, -900.0); 
     382    } 
     383 
    369384} 
  • 2011/26/RistoR/ding/ding/ding/kentta1.txt

    r2377 r2398  
    2727#################################################################################################################################### *                                                     #                                                                                 #########################                                                **                                                       # 
    2828#################################################################################################################################### *                                                    ###                                                                           ##############################                                                                                                         # 
    29 #################################################################################################################################### *                                                   ##### Z                                                               *       ################################             *                              ###########                                                 # 
     29#################################################################################################################################### *                                                   ##### Z                                                               *       ###############################             *                              ###########                                                  # 
    3030#################################################################################################################################### *                                                 D########                                         *                  ##########################################         ######                 *     ####                                                               # 
    31 #################################################################################################################################### *                                               ############# Z                                    ###############################################################                       *     ####                                                   Z                M  # 
     31#################################################################################################################################### *                                               ############# Z                                    ##############################################################                       *     ####                                                   Z                M   # 
    3232#################################################################################################################################### *                                             #################                                ##################################################################                   ########                                     ***            ########################### 
    3333######################################################################################################################################                 Z                         #####################                        ########################################################################                                                          ###################                            # 
  • 2011/26/RistoR/ding/ding/dingContent/dingContent.contentproj

    r2377 r2398  
    108108    </Compile> 
    109109  </ItemGroup> 
     110  <ItemGroup> 
     111    <Compile Include="maaliimage.png"> 
     112      <Name>maaliimage</Name> 
     113      <Importer>TextureImporter</Importer> 
     114      <Processor>TextureProcessor</Processor> 
     115    </Compile> 
     116  </ItemGroup> 
    110117  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    111118  <!--  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.