Changeset 7480 for 2016/25


Ignore:
Timestamp:
2016-06-21 15:54:16 (7 years ago)
Author:
koannak
Message:
 
Location:
2016/25/PetteriR
Files:
7 added
11 deleted
23 edited

Legend:

Unmodified
Added
Removed
  • 2016/25/PetteriR/Pang/Pang/Pang/Pang.cs

    r7474 r7480  
    5959    void AloitaPeli() 
    6060    { 
    61         Vector impulssi = new Vector(800.0, 0.0); 
     61        Vector impulssi = new Vector(1000.0, 0.0); 
    6262        pallo.Hit(impulssi); 
    6363    } 
  • 2016/25/PetteriR/hyppelyydd/hyppelyydd/hyppelyydd/hyppelyydd.cs

    r7474 r7480  
    99public class hyppelyydd : PhysicsGame 
    1010{ 
    11     const double nopeus = 200; 
    12     const double hyppyNopeus = 750; 
     11    const double nopeus = 400; 
     12    const double hyppyNopeus = 800; 
    1313    const int RUUDUN_KOKO = 40; 
    1414 
    15     PlatformCharacter pelaaja1; 
    16  
    17     Image pelaajanKuva = LoadImage("pressa"); 
     15    PlatformCharacter pressa; 
     16    PlatformCharacter pollari; 
     17    Image pressanKuva = LoadImage("pressa"); 
     18    Image pollarinKuva = LoadImage("pollari"); 
    1819    Image nippuKuva = LoadImage("nippu"); 
     20    Image aseKuva = LoadImage("asee"); 
    1921 
    2022    SoundEffect maaliAani = LoadSoundEffect("maali"); 
     
    2729        LisaaNappaimet(); 
    2830 
    29         Camera.Follow(pelaaja1); 
    30         Camera.ZoomFactor = 1.2; 
    31         Camera.StayInLevel = true; 
     31        Camera.Follow(pressa,pollari); 
     32        //Camera.ZoomFactor = 1.2; 
     33       // Camera.StayInLevel = true; 
    3234    } 
    3335 
     
    3739        kentta.SetTileMethod('#', LisaaTaso); 
    3840        kentta.SetTileMethod('*', LisaaNippu); 
    39         kentta.SetTileMethod('N', LisaaPelaaja); 
     41        kentta.SetTileMethod('N', LisaaPressa); 
     42        kentta.SetTileMethod('M', LisaaPollari); 
    4043        kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    4144        Level.CreateBorders(); 
    42         Level.Background.CreateGradient(Color.Black, Color.SkyBlue); 
     45        Level.Background.CreateGradient(Color.Blue, Color.SkyBlue); 
    4346    } 
    44      
     47    void LisaaPollari(Vector paikka, double leveys, double korkeus) 
     48    { 
     49         pollari = new PlatformCharacter(leveys, korkeus); 
     50        pollari.Position = paikka; 
     51        pollari.Mass = 4.0; 
     52        pollari.Image = pollarinKuva; 
     53        pollari.Tag = "pollari"; 
     54        Add(pollari); 
     55 
     56 
     57        //pelaaja1 on PlatformCharacter-tyyppinen 
     58        pollari.Weapon = new AssaultRifle(30, 10); 
     59        pollari.Weapon.Image = aseKuva; 
     60        pollari.Weapon.Y = pollari.Weapon.Y - 10; 
     61        //Ammusten määrä aluksi: 
     62        pollari.Weapon.Ammo.Value = 1000; 
     63 
     64        //Mitä tapahtuu kun ammus osuu johonkin? 
     65        pollari.Weapon.ProjectileCollision = AmmusOsui; 
     66    } 
    4567    void LisaaTaso(Vector paikka, double leveys, double korkeus) 
    4668    { 
    4769        PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 
    4870        taso.Position = paikka; 
    49         taso.Color = Color.Black; 
     71        taso.Color = Color.Gray; 
    5072        Add(taso); 
    5173    } 
     
    6183    } 
    6284 
    63     void LisaaPelaaja(Vector paikka, double leveys, double korkeus) 
     85    void LisaaPressa(Vector paikka, double leveys, double korkeus) 
    6486    { 
    65         pelaaja1 = new PlatformCharacter(leveys, korkeus); 
    66         pelaaja1.Position = paikka; 
    67         pelaaja1.Mass = 4.0; 
    68         pelaaja1.Image = pelaajanKuva; 
    69         AddCollisionHandler(pelaaja1, "nippu", Tormaanippuun); 
    70         Add(pelaaja1); 
     87        pressa = new PlatformCharacter(leveys, korkeus); 
     88        pressa.Position = paikka; 
     89        pressa.Mass = 4.0; 
     90        pressa.Image = pressanKuva; 
     91        AddCollisionHandler(pressa, "nippu", Tormaanippuun); 
     92        Add(pressa); 
     93 
     94      
     95        //pelaaja1 on PlatformCharacter-tyyppinen 
     96        pressa.Weapon = new AssaultRifle(30, 10); 
     97        pressa.Weapon.Image = aseKuva; 
     98        pressa.Weapon.Y = pressa.Weapon.Y - 10; 
     99        //Ammusten määrä aluksi: 
     100        pressa.Weapon.Ammo.Value = 1000; 
     101 
     102        //Mitä tapahtuu kun ammus osuu johonkin? 
     103        pressa.Weapon.ProjectileCollision = AmmusOsui; 
    71104    } 
    72  
     105    void AmmusOsui(PhysicsObject ammus, PhysicsObject kohde) 
     106    { 
     107        ammus.Destroy(); 
     108        Explosion rajahdys = new Explosion(20); 
     109        rajahdys.Position = ammus.Position; 
     110        Add(rajahdys); 
     111    } 
    73112    void LisaaNappaimet() 
    74113    { 
     
    76115        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
    77116 
    78         Keyboard.Listen(Key.Left, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, -nopeus); 
    79         Keyboard.Listen(Key.Right, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 
    80         Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
     117        Keyboard.Listen(Key.Left, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pressa, -nopeus); 
     118        Keyboard.Listen(Key.Right, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pressa, nopeus); 
     119        Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pressa, hyppyNopeus); 
     120        Keyboard.Listen(Key.Space, ButtonState.Down, AmmuAseella, "Ammu", pressa); 
    81121 
    82         ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 
    83  
    84         ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, Liikuta, "Pelaaja liikkuu vasemmalle", pelaaja1, -nopeus); 
    85         ControllerOne.Listen(Button.DPadRight, ButtonState.Down, Liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus); 
    86         ControllerOne.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
     122        Keyboard.Listen(Key.A, ButtonState.Down, Liikuta, "Pelaaja liikkuu vasemmalle", pollari, -nopeus); 
     123        Keyboard.Listen(Key.D, ButtonState.Down, Liikuta, "Pelaaja liikkuu oikealle", pollari, nopeus); 
     124        Keyboard.Listen(Key.W, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pollari, hyppyNopeus); 
     125        Keyboard.Listen(Key.Q, ButtonState.Down, AmmuAseella, "Ammu", pollari); 
    87126 
    88127        PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
    89128    } 
    90129 
    91     void Liikuta(PlatformCharacter hahmo, double nopeus) 
     130    void AmmuAseella(PlatformCharacter pelaaja) 
    92131    { 
    93         hahmo.Walk(nopeus); 
     132        PhysicsObject ammus; 
     133        if (pelaaja.Tag.Equals("pollari")) ammus = pollari.Weapon.Shoot(); 
     134        else ammus = pressa.Weapon.Shoot(); 
     135 
     136        if (ammus != null) 
     137        { 
     138            //ammus.Size *= 3; 
     139          //  ammus.Image = ...  
     140            //ammus.MaximumLifetime = TimeSpan.FromSeconds(2.0); 
     141        } 
     142    } 
     143    void Liikuta(PlatformCharacter pollari, double nopeus) 
     144    { 
     145        pollari.Walk(nopeus); 
    94146    } 
    95147 
    96     void Hyppaa(PlatformCharacter hahmo, double nopeus) 
     148    void Hyppaa(PlatformCharacter pressa, double nopeus) 
    97149    { 
    98         hahmo.Jump(nopeus); 
     150        pressa.Jump(nopeus); 
    99151    } 
    100152 
    101     void Tormaanippuun(PhysicsObject hahmo, PhysicsObject nippu) 
     153    void Tormaanippuun(PhysicsObject pressa, PhysicsObject nippu) 
    102154    { 
    103155        maaliAani.Play(); 
    104         MessageDisplay.Add("Sina sait Rahaa!"); 
     156        MessageDisplay.Add("Varastit Rahan!"); 
    105157        nippu.Destroy(); 
    106158    } 
    107 } 
     159    } 
  • 2016/25/PetteriR/hyppelyydd/hyppelyydd/hyppelyydd/hyppelyydd.csproj.Debug.cachefile

    r7474 r7480  
    11Content\maali.xnb 
    2 Content\norsu.xnb 
    3 Content\tahti.xnb 
    42Content\kentta1.xnb 
    5 Content\ukko.xnb 
    6 Content\Trump the Troll.xnb 
    73Content\DollarBillFace.xnb 
    84Content\pressa.xnb 
    95Content\nippu.xnb 
     6Content\asee.xnb 
     7Content\pollari.xnb 
  • 2016/25/PetteriR/hyppelyydd/hyppelyydd/hyppelyydd/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml

    r7474 r7480  
    1212    </Item> 
    1313    <Item> 
    14       <Source>norsu.png</Source> 
    15       <Name>norsu</Name> 
    16       <Importer>TextureImporter</Importer> 
    17       <Processor>TextureProcessor</Processor> 
    18       <Options>None</Options> 
    19       <Output>C:\Users\ohjelmointi\Documents\PetteriR\hyppelyydd\hyppelyydd\hyppelyydd\bin\x86\Debug\Content\norsu.xnb</Output> 
    20       <Time>2016-06-20T13:06:08.5819728+03:00</Time> 
    21     </Item> 
    22     <Item> 
    23       <Source>tahti.png</Source> 
    24       <Name>tahti</Name> 
    25       <Importer>TextureImporter</Importer> 
    26       <Processor>TextureProcessor</Processor> 
    27       <Options>None</Options> 
    28       <Output>C:\Users\ohjelmointi\Documents\PetteriR\hyppelyydd\hyppelyydd\hyppelyydd\bin\x86\Debug\Content\tahti.xnb</Output> 
    29       <Time>2016-06-20T13:06:08.5819728+03:00</Time> 
    30     </Item> 
    31     <Item> 
    3214      <Source>kentta1.txt</Source> 
    3315      <Name>kentta1</Name> 
     
    3618      <Options>None</Options> 
    3719      <Output>C:\Users\ohjelmointi\Documents\PetteriR\hyppelyydd\hyppelyydd\hyppelyydd\bin\x86\Debug\Content\kentta1.xnb</Output> 
    38       <Time>2016-06-20T15:22:15.0361822+03:00</Time> 
    39     </Item> 
    40     <Item> 
    41       <Source>ukko.png</Source> 
    42       <Name>ukko</Name> 
    43       <Importer>TextureImporter</Importer> 
    44       <Processor>TextureProcessor</Processor> 
    45       <Options>None</Options> 
    46       <Output>C:\Users\ohjelmointi\Documents\PetteriR\hyppelyydd\hyppelyydd\hyppelyydd\bin\x86\Debug\Content\ukko.xnb</Output> 
    47       <Time>2016-06-20T13:32:54.7028901+03:00</Time> 
    48     </Item> 
    49     <Item> 
    50       <Source>Trump the Troll.jpg</Source> 
    51       <Name>Trump the Troll</Name> 
    52       <Importer>TextureImporter</Importer> 
    53       <Processor>TextureProcessor</Processor> 
    54       <Options>None</Options> 
    55       <Output>C:\Users\ohjelmointi\Documents\PetteriR\hyppelyydd\hyppelyydd\hyppelyydd\bin\x86\Debug\Content\Trump the Troll.xnb</Output> 
    56       <Time>2016-06-20T13:41:07.6479029+03:00</Time> 
     20      <Time>2016-06-21T15:37:34.3280108+03:00</Time> 
    5721    </Item> 
    5822    <Item> 
     
    7236      <Options>None</Options> 
    7337      <Output>C:\Users\ohjelmointi\Documents\PetteriR\hyppelyydd\hyppelyydd\hyppelyydd\bin\x86\Debug\Content\pressa.xnb</Output> 
    74       <Time>2016-06-20T14:54:50.2510081+03:00</Time> 
     38      <Time>2016-06-21T14:52:54.4249573+03:00</Time> 
    7539    </Item> 
    7640    <Item> 
     
    8145      <Options>None</Options> 
    8246      <Output>C:\Users\ohjelmointi\Documents\PetteriR\hyppelyydd\hyppelyydd\hyppelyydd\bin\x86\Debug\Content\nippu.xnb</Output> 
    83       <Time>2016-06-20T14:12:24.6236089+03:00</Time> 
     47      <Time>2016-06-21T14:53:09.3697965+03:00</Time> 
     48    </Item> 
     49    <Item> 
     50      <Source>asee.png</Source> 
     51      <Name>asee</Name> 
     52      <Importer>TextureImporter</Importer> 
     53      <Processor>TextureProcessor</Processor> 
     54      <Options>None</Options> 
     55      <Output>C:\Users\ohjelmointi\Documents\PetteriR\hyppelyydd\hyppelyydd\hyppelyydd\bin\x86\Debug\Content\asee.xnb</Output> 
     56      <Time>2016-06-21T14:51:17.8567932+03:00</Time> 
     57    </Item> 
     58    <Item> 
     59      <Source>pollari.png</Source> 
     60      <Name>pollari</Name> 
     61      <Importer>TextureImporter</Importer> 
     62      <Processor>TextureProcessor</Processor> 
     63      <Options>None</Options> 
     64      <Output>C:\Users\ohjelmointi\Documents\PetteriR\hyppelyydd\hyppelyydd\hyppelyydd\bin\x86\Debug\Content\pollari.xnb</Output> 
     65      <Time>2016-06-21T15:17:36.1874251+03:00</Time> 
    8466    </Item> 
    8567    <BuildSuccessful>true</BuildSuccessful> 
  • 2016/25/PetteriR/hyppelyydd/hyppelyydd/hyppelyydd/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt

    r7474 r7480  
    11Content\maali.xnb 
    2 Content\norsu.xnb 
    3 Content\tahti.xnb 
    42Content\kentta1.xnb 
    5 Content\ukko.xnb 
    6 Content\Trump the Troll.xnb 
    73Content\DollarBillFace.xnb 
    84Content\pressa.xnb 
    95Content\nippu.xnb 
     6Content\asee.xnb 
     7Content\pollari.xnb 
  • 2016/25/PetteriR/hyppelyydd/hyppelyydd/hyppelyydd/obj/x86/Debug/hyppelyydd.csproj.FileListAbsolute.txt

    r7474 r7480  
    11C:\Users\ohjelmointi\Documents\PetteriR\hyppelyydd\hyppelyydd\hyppelyydd\bin\x86\Debug\Content\maali.xnb 
    2 C:\Users\ohjelmointi\Documents\PetteriR\hyppelyydd\hyppelyydd\hyppelyydd\bin\x86\Debug\Content\norsu.xnb 
    3 C:\Users\ohjelmointi\Documents\PetteriR\hyppelyydd\hyppelyydd\hyppelyydd\bin\x86\Debug\Content\tahti.xnb 
    42C:\Users\ohjelmointi\Documents\PetteriR\hyppelyydd\hyppelyydd\hyppelyydd\bin\x86\Debug\Content\kentta1.xnb 
    53C:\Users\ohjelmointi\Documents\PetteriR\hyppelyydd\hyppelyydd\hyppelyydd\bin\x86\Debug\hyppelyydd.exe 
     
    108C:\Users\ohjelmointi\Documents\PetteriR\hyppelyydd\hyppelyydd\hyppelyydd\obj\x86\Debug\hyppelyydd.exe 
    119C:\Users\ohjelmointi\Documents\PetteriR\hyppelyydd\hyppelyydd\hyppelyydd\obj\x86\Debug\hyppelyydd.pdb 
    12 C:\Users\ohjelmointi\Documents\PetteriR\hyppelyydd\hyppelyydd\hyppelyydd\bin\x86\Debug\Content\ukko.xnb 
    1310C:\Users\ohjelmointi\Documents\PetteriR\hyppelyydd\hyppelyydd\hyppelyydd\obj\x86\Debug\hyppelyydd.csprojResolveAssemblyReference.cache 
    14 C:\Users\ohjelmointi\Documents\PetteriR\hyppelyydd\hyppelyydd\hyppelyydd\bin\x86\Debug\Content\Trump the Troll.xnb 
    1511C:\Users\ohjelmointi\Documents\PetteriR\hyppelyydd\hyppelyydd\hyppelyydd\bin\x86\Debug\Content\DollarBillFace.xnb 
    1612C:\Users\ohjelmointi\Documents\PetteriR\hyppelyydd\hyppelyydd\hyppelyydd\bin\x86\Debug\Content\pressa.xnb 
    1713C:\Users\ohjelmointi\Documents\PetteriR\hyppelyydd\hyppelyydd\hyppelyydd\bin\x86\Debug\Content\nippu.xnb 
     14C:\Users\ohjelmointi\Documents\PetteriR\hyppelyydd\hyppelyydd\hyppelyydd\bin\x86\Debug\Content\asee.xnb 
     15C:\Users\ohjelmointi\Documents\PetteriR\hyppelyydd\hyppelyydd\hyppelyydd\bin\x86\Debug\Content\pollari.xnb 
  • 2016/25/PetteriR/hyppelyydd/hyppelyydd/hyppelyyddContent/hyppelyyddContent.contentproj

    r7474 r7480  
    5151      <Processor>SoundEffectProcessor</Processor> 
    5252    </Compile> 
    53     <Compile Include="norsu.png"> 
    54       <Name>norsu</Name> 
    55       <Importer>TextureImporter</Importer> 
    56       <Processor>TextureProcessor</Processor> 
    57     </Compile> 
    58     <Compile Include="tahti.png"> 
    59       <Name>tahti</Name> 
    60       <Importer>TextureImporter</Importer> 
    61       <Processor>TextureProcessor</Processor> 
    62     </Compile> 
    6353    <Compile Include="kentta1.txt"> 
    6454      <Name>kentta1</Name> 
     
    6858  </ItemGroup> 
    6959  <ItemGroup> 
    70     <Compile Include="ukko.png"> 
    71       <Name>ukko</Name> 
     60    <Compile Include="DollarBillFace.png"> 
     61      <Name>DollarBillFace</Name> 
    7262      <Importer>TextureImporter</Importer> 
    7363      <Processor>TextureProcessor</Processor> 
     
    7565  </ItemGroup> 
    7666  <ItemGroup> 
    77     <Compile Include="Trump the Troll.jpg"> 
    78       <Name>Trump the Troll</Name> 
    79       <Importer>TextureImporter</Importer> 
    80       <Processor>TextureProcessor</Processor> 
    81     </Compile> 
    82   </ItemGroup> 
    83   <ItemGroup> 
    84     <Compile Include="DollarBillFace.png"> 
    85       <Name>DollarBillFace</Name> 
     67    <Compile Include="asee.png"> 
     68      <Name>asee</Name> 
    8669      <Importer>TextureImporter</Importer> 
    8770      <Processor>TextureProcessor</Processor> 
     
    10285    </Compile> 
    10386  </ItemGroup> 
     87  <ItemGroup> 
     88    <Compile Include="pollari.png"> 
     89      <Name>pollari</Name> 
     90      <Importer>TextureImporter</Importer> 
     91      <Processor>TextureProcessor</Processor> 
     92    </Compile> 
     93  </ItemGroup> 
    10494  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    10595  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2016/25/PetteriR/hyppelyydd/hyppelyydd/hyppelyyddContent/kentta1.txt

    r7474 r7480  
    1 ############################################################ 
    2 # *************************N****************************** #                                                 
    3 #######################   #   ##############################                      
    4 #  ***                  #####  *************************** # 
    5 #  ###**************** #######  ##  ####   ###  ###  ##    #                                             
    6 ############################################################                      
     1                                        ############### 
     2                                        #*************# 
     3                                                                            #*************# 
     4                                                                            #########  #### 
     5 ########                               #  M      #####     
     6 #      #                               ######   ###### 
     7 #      #                               #       ####### 
     8 # N #                                     ##  ######## 
     9 ###################################################### 
Note: See TracChangeset for help on using the changeset viewer.