Changeset 7426


Ignore:
Timestamp:
2016-06-17 11:08:58 (7 years ago)
Author:
olhekaur
Message:

kaikki on valmista

Location:
2016/24/OliverK
Files:
66 added
13 edited

Legend:

Unmodified
Added
Removed
  • 2016/24/OliverK/pomppupeli/pomppupeli/pomppupeli/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml

    r7391 r7426  
    3636      <Options>None</Options> 
    3737      <Output>C:\MyTemp\OliverK\pomppupeli\pomppupeli\pomppupeli\bin\x86\Debug\Content\kentta1.xnb</Output> 
    38       <Time>2016-06-16T14:33:24.4675539+03:00</Time> 
     38      <Time>2016-06-17T09:50:06.5153345+03:00</Time> 
    3939    </Item> 
    4040    <Item> 
     
    110110      <Time>2016-06-16T10:32:44.3469004+03:00</Time> 
    111111    </Item> 
     112    <Item> 
     113      <Source>tyyppi.png</Source> 
     114      <Name>tyyppi</Name> 
     115      <Importer>TextureImporter</Importer> 
     116      <Processor>TextureProcessor</Processor> 
     117      <Options>None</Options> 
     118      <Output>C:\MyTemp\OliverK\pomppupeli\pomppupeli\pomppupeli\bin\x86\Debug\Content\tyyppi.xnb</Output> 
     119      <Time>2016-06-17T09:58:05.8214005+03:00</Time> 
     120    </Item> 
    112121    <BuildSuccessful>true</BuildSuccessful> 
    113122    <Settings> 
  • 2016/24/OliverK/pomppupeli/pomppupeli/pomppupeli/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt

    r7391 r7426  
    1111Content\images.xnb 
    1212Content\nyan cat.xnb 
     13Content\tyyppi.xnb 
  • 2016/24/OliverK/pomppupeli/pomppupeli/pomppupeli/obj/x86/Debug/pomppupeli.csproj.FileListAbsolute.txt

    r7391 r7426  
    1919C:\MyTemp\OliverK\pomppupeli\pomppupeli\pomppupeli\bin\x86\Debug\Content\images.xnb 
    2020C:\MyTemp\OliverK\pomppupeli\pomppupeli\pomppupeli\bin\x86\Debug\Content\nyan cat.xnb 
     21C:\MyTemp\OliverK\pomppupeli\pomppupeli\pomppupeli\bin\x86\Debug\Content\tyyppi.xnb 
  • 2016/24/OliverK/pomppupeli/pomppupeli/pomppupeli/pomppupeli.cs

    r7391 r7426  
    1414 
    1515    PlatformCharacter pelaaja1; 
     16    PlatformCharacter pelaaja2; 
     17 
    1618 
    1719    Image palikkakuva = LoadImage("images"); 
    18     Image ukkonKuva = LoadImage("ukko"); 
     20    Image ukkonKuva = LoadImage("tyyppi"); 
    1921    Image pelaajanKuva = LoadImage("ukko2"); 
    2022    Image dl2Kuva = LoadImage("DL2"); 
     
    2729 
    2830 
    29     PhysicsObject ukko2; 
    30  
    31     public double Velocity { get; private set; } 
    32      
     31 
     32 
    3333 
    3434    public override void Begin() 
    3535    { 
    36  
     36        ClearAll(); 
    3737 
    3838        Gravity = new Vector(0, -1000); 
     
    5656        kentta.SetTileMethod('N', LisaaPelaaja); 
    5757        kentta.SetTileMethod('#', lisaaPalikka); 
     58        kentta.SetTileMethod('M', lisaaPelaaja2); 
    5859        kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    5960        Level.CreateBorders(); 
     
    106107        AddCollisionHandler(pelaaja1, "DL2", TormaaTahteen); 
    107108        Add(pelaaja1); 
    108     } 
    109  
    110     void LisaaNappaimet() 
     109 
     110        //Ase 
     111        AssaultRifle ase = new AssaultRifle(30, 20); 
     112        pelaaja1.Weapon = ase; 
     113        ase.IsVisible = false; 
     114 
     115        //Mitä tapahtuu kun ammus osuu johonkin? 
     116        ase.ProjectileCollision = AmmusOsui; 
     117 
     118        Keyboard.Listen(Key.Space, ButtonState.Down, AmmuAseella, "Ammu", pelaaja1); 
     119        ControllerOne.Listen(Button.X, ButtonState.Pressed, AmmuAseella, "Ammu", pelaaja1); 
     120 
     121        pelaaja1.Add(ase); 
     122 
     123        // 
     124    } 
     125    void AmmuAseella(PlatformCharacter pelaaja) 
     126    { 
     127        PhysicsObject ammus = pelaaja.Weapon.Shoot(); 
     128 
     129        if (ammus != null) 
     130        { 
     131            //ammus.Size *= 3; 
     132            //ammus.Image = ... 
     133            //ammus.MaximumLifetime = TimeSpan.FromSeconds(2.0); 
     134        } 
     135    } 
     136 
     137    void AmmusOsui(PhysicsObject ammus, PhysicsObject kohde) 
     138    { 
     139        ammus.Destroy(); 
     140        Begin(); 
     141 
     142    } 
     143 
     144    void lisaaPelaaja2(Vector paikka, double leveys, double korkeus) 
     145    { 
     146        pelaaja2 = new PlatformCharacter(leveys, korkeus); 
     147        pelaaja2.Position = paikka; 
     148        pelaaja2.Mass = 4.0; 
     149        pelaaja2.Image = ukkonKuva; 
     150        AddCollisionHandler(pelaaja2, "DL2", TormaaTahteen); 
     151        Add(pelaaja2); 
     152 
     153        //Ase 
     154        AssaultRifle pelaajan2Ase = new AssaultRifle(30,20); 
     155        pelaaja2.Weapon = pelaajan2Ase; 
     156        pelaajan2Ase.IsVisible = false; 
     157 
     158        Keyboard.Listen(Key.S, ButtonState.Down, AmmuAseella, "Ammu", pelaaja2); 
     159        ControllerTwo.Listen(Button.X, ButtonState.Pressed, AmmuAseella, "Ammu", pelaaja2); 
     160 
     161        //Ammusten määrä aluksi: 
     162        pelaajan2Ase.Ammo.Value = 1000; 
     163 
     164        //Mitä tapahtuu kun ammus osuu johonkin? 
     165        pelaajan2Ase.ProjectileCollision = AmmusOsui; 
     166 
     167        pelaaja1.Add(pelaajan2Ase); 
     168 
     169        // 
     170    } 
     171 
     172 
     173        void LisaaNappaimet() 
    111174    { 
    112175        Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, "Näytä ohjeet"); 
     
    117180        Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
    118181 
     182         
     183 
    119184        ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 
    120185 
     
    122187        ControllerOne.Listen(Button.DPadRight, ButtonState.Down, Liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus); 
    123188        ControllerOne.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
     189 
     190        Keyboard.Listen(Key.A, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja2, -nopeus); 
     191        Keyboard.Listen(Key.D, ButtonState.Down, Liikuta, "Liikkuu vasemmalle", pelaaja2, nopeus); 
     192        Keyboard.Listen(Key.W, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja2, hyppyNopeus); 
     193 
     194        ControllerTwo.Listen(Button.DPadLeft, ButtonState.Down, Liikuta, "Pelaaja liikkuu vasemmalle", pelaaja2, -nopeus); 
     195        ControllerTwo.Listen(Button.DPadRight, ButtonState.Down, Liikuta, "Pelaaja liikkuu oikealle", pelaaja2, nopeus); 
     196        ControllerTwo.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja2, hyppyNopeus); 
     197 
    124198 
    125199 
  • 2016/24/OliverK/pomppupeli/pomppupeli/pomppupeli/pomppupeli.csproj.Debug.cachefile

    r7391 r7426  
    1111Content\images.xnb 
    1212Content\nyan cat.xnb 
     13Content\tyyppi.xnb 
  • 2016/24/OliverK/pomppupeli/pomppupeli/pomppupeliContent/kentta1.txt

    r7391 r7426  
    2121f  ##  ##  ##  ##  ##  ##  h 
    2222f                          j 
    23 n             N            y 
     23nN                        My 
    2424############################ 
  • 2016/24/OliverK/pomppupeli/pomppupeli/pomppupeliContent/pomppupeliContent.contentproj

    r7391 r7426  
    121121    </Compile> 
    122122  </ItemGroup> 
     123  <ItemGroup> 
     124    <Compile Include="tyyppi.png"> 
     125      <Name>tyyppi</Name> 
     126      <Importer>TextureImporter</Importer> 
     127      <Processor>TextureProcessor</Processor> 
     128    </Compile> 
     129  </ItemGroup> 
    123130  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    124131  <!--  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.