Changeset 7377


Ignore:
Timestamp:
2016-06-16 14:45:38 (3 years ago)
Author:
jijaolri
Message:
 
Location:
2016/24/JimiR
Files:
10 added
6 edited

Legend:

Unmodified
Added
Removed
  • 2016/24/JimiR/PeliIO/PeliIO/PeliIO/PeliIO.cs

    r7372 r7377  
    1111    PhysicsObject pelaaja; 
    1212    string nimi; 
     13    Image taustaKuva = LoadImage("tausta"); 
    1314    public override void Begin() 
    1415    { 
    15  
    1616        KysyNimi(); 
    1717        // TODO: Kirjoita ohjelmakoodisi tähän 
     
    2121    } 
    2222 
    23     void LuoPelaaja() 
     23    void LuoPelaaja(Vector paikka, double koko) 
    2424    { 
     25        pelaaja = new PhysicsObject(koko, koko); 
     26        pelaaja.Color = Color.Red; 
     27        pelaaja.Shape = Shape.Circle; 
     28        pelaaja.LinearDamping = 0.9; 
     29        pelaaja.CanRotate = false; 
     30        pelaaja.Restitution = 0.9; 
     31        pelaaja.Position = paikka; 
     32        Add(pelaaja); 
     33        Label nimilabel = new Label(nimi + " "); 
     34        nimilabel.Y = pelaaja.Y + 50; 
     35        pelaaja.Add(nimilabel); 
    2536 
     37        AddCollisionHandler(pelaaja, "pallo", SyoPallo); 
     38 
     39        Keyboard.Listen(Key.A, ButtonState.Down, LiikutaPelaajaa, null, new Vector(-1000, 0)); 
     40        Keyboard.Listen(Key.D, ButtonState.Down, LiikutaPelaajaa, null, new Vector(1000, 0)); 
     41        Keyboard.Listen(Key.W, ButtonState.Down, LiikutaPelaajaa, null, new Vector(0, 1000)); 
     42        Keyboard.Listen(Key.S, ButtonState.Down, LiikutaPelaajaa, null, new Vector(0, -1000)); 
     43 
     44        Keyboard.Listen(Key.Space, ButtonState.Pressed, Jakaudu, null); 
     45    } 
     46 
     47    void LiikutaPelaajaa(Vector vektori) 
     48    { 
     49        pelaaja.Push(vektori); 
    2650    } 
    2751 
     
    4468    void AloitaPeli() 
    4569    { 
    46         LuoPelaaja(); 
     70        LuoPelaaja(Vector.Zero, 10); 
    4771        Camera.Follow(pelaaja); 
     72        Camera.Zoom(4); 
     73        Level.Width = 1500; 
     74        Level.Height = 1500; 
     75        Level.Background.Image = taustaKuva; 
     76        Level.Background.TileToLevel(); 
     77 
     78        for (int i = 0; i < 500; i++) 
     79        { 
     80            LuoPallo(); 
     81        } 
     82    } 
     83 
     84    void LuoPallo() 
     85    { 
     86        PhysicsObject pallo = new PhysicsObject(5, 5); 
     87        pallo.Shape = Shape.Circle; 
     88        pallo.Color = Color.Red; 
     89        pallo.Tag = "pallo"; 
     90        pallo.Position = Level.GetRandomPosition(); 
     91        Add(pallo); 
     92    } 
     93 
     94    void LuoKolmio() 
     95    { 
     96        PhysicsObject kolmio = new PhysicsObject(50, 50); 
     97        kolmio.Position = Level.GetRandomPosition(); 
     98        Add(kolmio); 
     99    } 
     100 
     101    void SyoPallo(PhysicsObject tormaaja, PhysicsObject kohde) 
     102    { 
     103        kohde.Destroy(); 
     104        pelaaja.Size += new Vector(1, 1); 
     105        LuoPallo(); 
     106 
     107        Camera.ZoomFactor *= 0.995; 
     108    } 
     109 
     110    void Jakaudu() 
     111    { 
     112        double koko = pelaaja.Size.X; 
     113 
     114        pelaaja.Destroy(); 
     115        LuoPelaaja(pelaaja.Position, koko / 2); 
     116        LuoPelaaja(pelaaja.Position, koko / 2); 
    48117    } 
    49118 
  • 2016/24/JimiR/PeliIO/PeliIO/PeliIO/obj/x86/Debug/ContentPipeline-{F17DF82F-DC57-4A16-9389-8719F7F46545}.xml

    r7372 r7377  
    22<XnaContent xmlns:Pipeline="Microsoft.Xna.Framework.Content.Pipeline"> 
    33  <Asset Type="Pipeline:BuildItemCollection"> 
     4    <Item> 
     5      <Source>tausta.png</Source> 
     6      <Name>tausta</Name> 
     7      <Importer>TextureImporter</Importer> 
     8      <Processor>TextureProcessor</Processor> 
     9      <Options>None</Options> 
     10      <Output>C:\MyTemp\JimiR\PeliIO\PeliIO\PeliIO\bin\x86\Debug\Content\tausta.xnb</Output> 
     11      <Time>2016-06-16T13:57:33.3961676+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>2015-09-16T17:36:11.3187616+03:00</Value> 
  • 2016/24/JimiR/PeliIO/PeliIO/PeliIO/obj/x86/Debug/PeliIO.csproj.FileListAbsolute.txt

    r7372 r7377  
    11C:\MyTemp\JimiR\PeliIO\PeliIO\PeliIO\obj\x86\Debug\PeliIO.csprojResolveAssemblyReference.cache 
    22C:\MyTemp\JimiR\PeliIO\PeliIO\PeliIO\obj\x86\Debug\Microsoft.Xna.Framework.RuntimeProfile.txt 
     3C:\MyTemp\JimiR\PeliIO\PeliIO\PeliIO\bin\x86\Debug\PeliIO.exe 
     4C:\MyTemp\JimiR\PeliIO\PeliIO\PeliIO\bin\x86\Debug\PeliIO.pdb 
     5C:\MyTemp\JimiR\PeliIO\PeliIO\PeliIO\bin\x86\Debug\Jypeli.dll 
     6C:\MyTemp\JimiR\PeliIO\PeliIO\PeliIO\bin\x86\Debug\Jypeli.xml 
     7C:\MyTemp\JimiR\PeliIO\PeliIO\PeliIO\obj\x86\Debug\PeliIO.exe 
     8C:\MyTemp\JimiR\PeliIO\PeliIO\PeliIO\obj\x86\Debug\PeliIO.pdb 
     9C:\MyTemp\JimiR\PeliIO\PeliIO\PeliIO\bin\x86\Debug\Content\tausta.xnb 
  • 2016/24/JimiR/PeliIO/PeliIO/PeliIOContent/PeliIOContent.contentproj

    r7372 r7377  
    4545    <Reference Include="AnimationExtension" /> 
    4646  </ItemGroup> 
     47  <ItemGroup> 
     48    <Compile Include="tausta.png"> 
     49      <Name>tausta</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.