Changeset 8110


Ignore:
Timestamp:
2016-07-26 12:52:39 (7 years ago)
Author:
jotapoti
Message:

Pallopeliin uusi pelaajahahmo

Location:
2016/30/luennot/Pallopeli
Files:
5 added
11 edited

Legend:

Unmodified
Added
Removed
  • 2016/30/luennot/Pallopeli/Pallopeli/Pallopeli/Pallopeli.cs

    r8102 r8110  
    99public class Pallopeli : PhysicsGame 
    1010{ 
     11    PhysicsObject pelaaja1; 
     12    Image pelaajanKuva = LoadImage("pinkman"); 
     13 
    1114    public override void Begin() 
    1215    { 
     16        Level.CreateBorders(); 
    1317 
    1418        LuoPallo(-100.0, -20.5, Color.HotPink); 
    15         LuoPallo(   0.0,  0.0, Color.MidnightBlue); 
     19        LuoPallo(200.0, 0.0, Color.MidnightBlue); 
    1620        LuoPallo(150.0, 0.0, Color.Green); 
    1721        LuoPallo(150.0, 400.0, Color.MediumVioletRed); 
    1822 
     23        LisaaPelaaja(); 
     24 
    1925        PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
    2026        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
     27        Keyboard.Listen(Key.Left, ButtonState.Down, LiikutaPelaajaa, "Liiku vasemmalle", new Vector(-1000, 0)); 
     28        Keyboard.Listen(Key.Right, ButtonState.Down, LiikutaPelaajaa, "Liiku oikealle", new Vector(1000, 0)); 
     29        Keyboard.Listen(Key.Up, ButtonState.Down, LiikutaPelaajaa, "Liiku ylös", new Vector(0, 1000)); 
     30        Keyboard.Listen(Key.Down, ButtonState.Down, LiikutaPelaajaa, "Liiku alas", new Vector(0, -1000)); 
     31    } 
     32 
     33    void LiikutaPelaajaa(Vector vektori) 
     34    { 
     35        pelaaja1.Push(vektori); 
     36    } 
     37    void LisaaPelaaja() 
     38    { 
     39        pelaaja1 = new PhysicsObject(40.0, 40.0); 
     40        pelaaja1.CanRotate = false; 
     41        pelaaja1.Image = pelaajanKuva; 
     42        Add(pelaaja1); 
     43        AddCollisionHandler(pelaaja1, "pallura", PelaajaTormaaPalloon); 
     44    } 
     45 
     46    void PelaajaTormaaPalloon(PhysicsObject pelaajahahmo, PhysicsObject pallonen) 
     47    { 
     48        pallonen.Destroy(); 
     49        pelaajahahmo.Size *= 1.5; 
    2150    } 
    2251 
     
    2756        pallo.X = xkoordinaatti; 
    2857        pallo.Y = ykoordinaatti; 
     58        pallo.Tag = "pallura"; 
    2959        Add(pallo); 
    3060    } 
  • 2016/30/luennot/Pallopeli/Pallopeli/Pallopeli/obj/x86/Debug/ContentPipeline-{E1D1A644-28B6-4869-96C9-94543A574B86}.xml

    r8102 r8110  
    22<XnaContent xmlns:Pipeline="Microsoft.Xna.Framework.Content.Pipeline"> 
    33  <Asset Type="Pipeline:BuildItemCollection"> 
     4    <Item> 
     5      <Source>pinkman.png</Source> 
     6      <Name>pinkman</Name> 
     7      <Importer>TextureImporter</Importer> 
     8      <Processor>TextureProcessor</Processor> 
     9      <Options>None</Options> 
     10      <Output>C:\MyTemp\JouniP_luennot\Pallopeli\Pallopeli\Pallopeli\bin\x86\Debug\Content\pinkman.xnb</Output> 
     11      <Time>2016-07-26T12:44:05.0416742+03:00</Time> 
     12    </Item> 
    413    <BuildSuccessful>true</BuildSuccessful> 
    514    <Settings> 
     
    1625    <Assemblies> 
    1726      <Assembly> 
     27        <Key>C:\Program Files (x86)\Jypeli\lib\ContentExtensions\TextFileContentExtension.dll</Key> 
     28        <Value>2015-02-09T20:18:44+02:00</Value> 
     29      </Assembly> 
     30      <Assembly> 
     31        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.XImporter.dll</Key> 
     32        <Value>2011-09-01T16:22:30+03:00</Value> 
     33      </Assembly> 
     34      <Assembly> 
     35        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.VideoImporters.dll</Key> 
     36        <Value>2011-09-01T16:22:30+03:00</Value> 
     37      </Assembly> 
     38      <Assembly> 
     39        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.TextureImporter.dll</Key> 
     40        <Value>2011-09-01T16:22:30+03:00</Value> 
     41      </Assembly> 
     42      <Assembly> 
     43        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.FBXImporter.dll</Key> 
     44        <Value>2011-09-01T16:22:30+03:00</Value> 
     45      </Assembly> 
     46      <Assembly> 
     47        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.EffectImporter.dll</Key> 
     48        <Value>2011-09-01T16:22:30+03:00</Value> 
     49      </Assembly> 
     50      <Assembly> 
     51        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.AudioImporters.dll</Key> 
     52        <Value>2011-09-01T16:22:30+03:00</Value> 
     53      </Assembly> 
     54      <Assembly> 
     55        <Key>C:\Program Files (x86)\Jypeli\lib\ContentExtensions\AnimationExtension.dll</Key> 
     56        <Value>2015-02-17T22:27:18+02:00</Value> 
     57      </Assembly> 
     58      <Assembly> 
    1859        <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> 
    1960        <Value>2016-06-13T14:34:23.3940496+03:00</Value> 
  • 2016/30/luennot/Pallopeli/Pallopeli/Pallopeli/obj/x86/Debug/Pallopeli.csproj.FileListAbsolute.txt

    r8102 r8110  
    77C:\MyTemp\JouniP_luennot\Pallopeli\Pallopeli\Pallopeli\obj\x86\Debug\Pallopeli.exe 
    88C:\MyTemp\JouniP_luennot\Pallopeli\Pallopeli\Pallopeli\obj\x86\Debug\Pallopeli.pdb 
     9C:\MyTemp\JouniP_luennot\Pallopeli\Pallopeli\Pallopeli\bin\x86\Debug\Content\pinkman.xnb 
  • 2016/30/luennot/Pallopeli/Pallopeli/PallopeliContent/PallopeliContent.contentproj

    r8102 r8110  
    4545    <Reference Include="AnimationExtension" /> 
    4646  </ItemGroup> 
     47  <ItemGroup> 
     48    <Compile Include="pinkman.png"> 
     49      <Name>pinkman</Name> 
     50      <Importer>TextureImporter</Importer> 
     51      <Processor>TextureProcessor</Processor> 
     52    </Compile> 
     53  </ItemGroup> 
    4754  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    4855  <!--  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.