Changeset 8402


Ignore:
Timestamp:
2017-02-18 14:52:41 (6 years ago)
Author:
jotapoti
Message:
 
Location:
2016/koodauskerho/VilleH
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • 2016/koodauskerho/VilleH/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli/ninjakissanhikileikit.cs

    r8376 r8402  
    99public class Tasohyppelypeli1 : PhysicsGame 
    1010{ 
    11     const double nopeus = 550; 
    12     const double hyppyNopeus = 500; 
     11    double nopeus = 650; 
     12    double hyppyNopeus = 500; 
    1313    const int RUUDUN_KOKO = 40; 
    1414 
     
    9292        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
    9393 
    94         Keyboard.Listen(Key.Left, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, -nopeus); 
    95         Keyboard.Listen(Key.Right, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 
    96         Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
     94        Keyboard.Listen(Key.Left, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, -1.0); 
     95        Keyboard.Listen(Key.Right, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, 1.0); 
     96        Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1); 
    9797 
    9898        ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 
    9999 
    100         ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, Liikuta, "Pelaaja liikkuu vasemmalle", pelaaja1, -nopeus); 
    101         ControllerOne.Listen(Button.DPadRight, ButtonState.Down, Liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus); 
    102         ControllerOne.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
     100        ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, Liikuta, "Pelaaja liikkuu vasemmalle", pelaaja1, -1.0); 
     101        ControllerOne.Listen(Button.DPadRight, ButtonState.Down, Liikuta, "Pelaaja liikkuu oikealle", pelaaja1, 1.0); 
     102        ControllerOne.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1); 
     103        Keyboard.Listen(Key.F5, ButtonState.Pressed, Konsoli, ""); 
    103104 
    104         PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
    105        // Keyboard.Listen(Key.Space, ButtonState.Down, AmmuAseella, "Ammu", pelaajan1Ase); 
    106  
     105        
    107106    } 
    108107 
    109     void Liikuta(PlatformCharacter hahmo, double nopeus) 
     108    void Konsoli() 
    110109    { 
    111         hahmo.Walk(nopeus); 
     110 InputWindow kysymysIkkuna = new InputWindow("Konsoli"); 
     111        kysymysIkkuna.TextEntered += ProcessInput; 
     112        Add(kysymysIkkuna); 
    112113    } 
    113114 
    114     void Hyppaa(PlatformCharacter hahmo, double nopeus) 
     115    void ProcessInput(InputWindow ikkuna) 
    115116    { 
    116         hahmo.Jump(nopeus); 
     117        string[] vastaus = ikkuna.InputBox.Text.Split(' '); 
     118 
     119        if(vastaus[0]=="speed") 
     120        { 
     121            nopeus = int.Parse(vastaus[1]); 
     122        } 
     123 
     124        if (vastaus[0] == "gravity") 
     125        { 
     126            Gravity =new Vector(0, int.Parse(vastaus[1])); 
     127        } 
     128        if (vastaus[0] == "BOING") 
     129        { 
     130            hyppyNopeus = int.Parse(vastaus[1]); 
     131        } 
     132        if (vastaus[0]=="sanic") 
     133        { 
     134            nopeus = 3500; 
     135        } 
     136    } 
     137 
     138    void Liikuta(PlatformCharacter hahmo, double suunta) 
     139    { 
     140        hahmo.Walk(nopeus* suunta); 
     141    } 
     142 
     143    void Hyppaa(PlatformCharacter hahmo) 
     144    { 
     145        hahmo.Jump(hyppyNopeus); 
    117146    } 
    118147 
  • 2016/koodauskerho/VilleH/Tasohyppelypeli/Tasohyppelypeli/Tasohyppelypeli/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml

    r8376 r8402  
    88      <Processor>SoundEffectProcessor</Processor> 
    99      <Options>None</Options> 
    10       <Output>C:\MyTemp\villeH\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\maali.xnb</Output> 
    11       <Time>2016-12-17T10:27:34.4476585+02:00</Time> 
     10      <Output>C:\MyTemp\VilleH\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\maali.xnb</Output> 
     11      <Time>2017-02-18T10:36:15.8213537+02:00</Time> 
    1212    </Item> 
    1313    <Item> 
     
    1717      <Processor>TextureProcessor</Processor> 
    1818      <Options>None</Options> 
    19       <Output>C:\MyTemp\villeH\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\norsu.xnb</Output> 
    20       <Time>2016-12-17T10:27:34.5568585+02:00</Time> 
     19      <Output>C:\MyTemp\VilleH\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\norsu.xnb</Output> 
     20      <Time>2017-02-18T10:36:15.9305544+02:00</Time> 
    2121    </Item> 
    2222    <Item> 
     
    2626      <Processor>TextureProcessor</Processor> 
    2727      <Options>None</Options> 
    28       <Output>C:\MyTemp\villeH\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\tahti.xnb</Output> 
    29       <Time>2016-12-17T10:27:34.6504585+02:00</Time> 
     28      <Output>C:\MyTemp\VilleH\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\tahti.xnb</Output> 
     29      <Time>2017-02-18T10:36:16.0085549+02:00</Time> 
    3030    </Item> 
    3131    <Item> 
     
    3535      <Processor>TextureProcessor</Processor> 
    3636      <Options>None</Options> 
    37       <Output>C:\MyTemp\villeH\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\piikki.xnb</Output> 
    38       <Time>2016-12-17T10:27:34.4476585+02:00</Time> 
     37      <Output>C:\MyTemp\VilleH\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\piikki.xnb</Output> 
     38      <Time>2017-02-18T10:36:15.8213537+02:00</Time> 
    3939    </Item> 
    4040    <Item> 
     
    4444      <Processor>TextureProcessor</Processor> 
    4545      <Options>None</Options> 
    46       <Output>C:\MyTemp\villeH\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\doritos-nacho-cheese.xnb</Output> 
    47       <Time>2016-12-17T10:27:34.4632585+02:00</Time> 
     46      <Output>C:\MyTemp\VilleH\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\doritos-nacho-cheese.xnb</Output> 
     47      <Time>2017-02-18T10:36:15.8369538+02:00</Time> 
    4848    </Item> 
    4949    <Item> 
     
    5353      <Processor>TextureProcessor</Processor> 
    5454      <Options>None</Options> 
    55       <Output>C:\MyTemp\villeH\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\tyyppi.xnb</Output> 
    56       <Time>2016-12-17T10:27:34.4476585+02:00</Time> 
     55      <Output>C:\MyTemp\VilleH\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\tyyppi.xnb</Output> 
     56      <Time>2017-02-18T10:36:15.8213537+02:00</Time> 
    5757    </Item> 
    5858    <Item> 
     
    6262      <Processor>TextureProcessor</Processor> 
    6363      <Options>None</Options> 
    64       <Output>C:\MyTemp\villeH\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\kissa.xnb</Output> 
    65       <Time>2016-12-17T10:27:34.6504585+02:00</Time> 
     64      <Output>C:\MyTemp\VilleH\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\kissa.xnb</Output> 
     65      <Time>2017-02-18T10:36:16.024155+02:00</Time> 
    6666    </Item> 
    6767    <Item> 
     
    7171      <Processor>TextFileContentProcessor</Processor> 
    7272      <Options>None</Options> 
    73       <Output>C:\MyTemp\villeH\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\kentta1.xnb</Output> 
    74       <Time>2016-12-17T13:40:10.124043+02:00</Time> 
     73      <Output>C:\MyTemp\VilleH\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\kentta1.xnb</Output> 
     74      <Time>2017-02-18T10:36:15.8369538+02:00</Time> 
    7575    </Item> 
    7676    <BuildSuccessful>true</BuildSuccessful> 
     
    8181      <BuildConfiguration>Debug</BuildConfiguration> 
    8282      <CompressContent>false</CompressContent> 
    83       <RootDirectory>C:\MyTemp\villeH\Tasohyppelypeli\Tasohyppelypeli\TasohyppelypeliContent\</RootDirectory> 
    84       <LoggerRootDirectory>C:\MyTemp\villeH\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\</LoggerRootDirectory> 
    85       <IntermediateDirectory>C:\MyTemp\villeH\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\obj\x86\Debug\</IntermediateDirectory> 
    86       <OutputDirectory>C:\MyTemp\villeH\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\</OutputDirectory> 
     83      <RootDirectory>C:\MyTemp\VilleH\Tasohyppelypeli\Tasohyppelypeli\TasohyppelypeliContent\</RootDirectory> 
     84      <LoggerRootDirectory>C:\MyTemp\VilleH\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\</LoggerRootDirectory> 
     85      <IntermediateDirectory>C:\MyTemp\VilleH\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\obj\x86\Debug\</IntermediateDirectory> 
     86      <OutputDirectory>C:\MyTemp\VilleH\Tasohyppelypeli\Tasohyppelypeli\Tasohyppelypeli\bin\x86\Debug\Content\</OutputDirectory> 
    8787    </Settings> 
    8888    <Assemblies> 
     
    121121      <Assembly> 
    122122        <Key>C:\Windows\Microsoft.Net\assembly\GAC_32\Microsoft.Xna.Framework.Content.Pipeline\v4.0_4.0.0.0__842cf8be1de50553\Microsoft.Xna.Framework.Content.Pipeline.dll</Key> 
    123         <Value>2015-09-16T19:52:38.3293055+03:00</Value> 
     123        <Value>2015-09-16T12:26:20.8291525+03:00</Value> 
    124124      </Assembly> 
    125125    </Assemblies> 
Note: See TracChangeset for help on using the changeset viewer.