Changeset 5259 for 2014/27


Ignore:
Timestamp:
2014-07-02 09:30:22 (5 years ago)
Author:
jotapoti
Message:

Lisää palloja while-silmukassa.

Location:
2014/27/JouniP_esimerkki/Pongpeli
Files:
5 added
9 edited

Legend:

Unmodified
Added
Removed
  • 2014/27/JouniP_esimerkki/Pongpeli/Pongpeli/Pongpeli/Pongpeli.cs

    r5221 r5259  
    2424        pallo.Hit(impulssi); 
    2525        // AddCollisionHandler(pallo, "maila", CollisionHandler.ExplodeTarget(20.0, false)); 
    26         AddCollisionHandler(pallo, "maila", VaihdaPallonVaria); 
    27         AddCollisionHandler(pallo, "maila", KahdennaPallo); 
     26        // AddCollisionHandler(pallo, "maila", VaihdaPallonVaria); 
     27        // AddCollisionHandler(pallo, "maila", KahdennaPallo); 
    2828        LisaaOhjaimet(); 
    2929 
    3030 
     31    } 
     32 
     33    PhysicsObject LuoPallo(double x, double y) 
     34    { 
     35        PhysicsObject pallo = new PhysicsObject(40, 40); 
     36        pallo.Shape = Shape.Circle; 
     37        pallo.X = x; 
     38        pallo.Y = y; 
     39        pallo.Restitution = 1.0; 
     40        Add(pallo); 
     41        return pallo; 
    3142    } 
    3243 
     
    4152    } 
    4253 
    43     PhysicsObject LuoPallo(double x, double y) 
    44     { 
    45         PhysicsObject pallo = new PhysicsObject(40, 40); 
    46         pallo.Shape = Shape.Circle; 
    47         pallo.X = x; 
    48         pallo.Y = y; 
    49         pallo.Restitution = 1.0; 
    50         Add(pallo); 
    51         return pallo; 
    52     } 
     54 
    5355 
    5456    PhysicsObject LuoMaila(double x, double y) 
     
    6769    {                                                        
    6870        // luodaan peliin pallo:                             
    69         pallo = LuoPallo(0, 0); 
     71        pallo = LuoPallo(0.0, 0.0); 
     72        pallo.Image = LoadImage("ukkeli"); 
     73        pallo.Width = 100; 
     74        pallo.Height = 100; 
     75        // luodaan monta palloa: 
     76        int i = 0; 
     77        while (i < 50) 
     78        { 
     79            // PhysicsObject pallo2 = LuoPallo(50.0, 0.0); 
     80            // PhysicsObject pallo2 = LuoPallo(RandomGen.NextDouble(-100.0, 100.0)  , 0.0); 
     81            // PhysicsObject pallo2 = LuoPallo(RandomGen.NextDouble(Level.Left, Level.Right), 0.0); 
     82            PhysicsObject pallo2 = LuoPallo(RandomGen.NextDouble(Level.Left, Level.Right), RandomGen.NextDouble(Level.Bottom, Level.Top)); 
     83 
     84            pallo2.Color = RandomGen.NextColor(); 
     85            i++; 
     86        } 
     87 
     88 
     89 
    7090        //pallo = new PhysicsObject(40.0, 40.0);               
    7191        //pallo.Shape = Shape.Circle;                          
     
    81101        // luodaan peliin reunat: 
    82102        Level.CreateBorders(1.0, false); 
    83         Level.Background.Color = Color.Black; 
     103        Level.Background.Color = Color.Olive; 
    84104 
    85105    } 
  • 2014/27/JouniP_esimerkki/Pongpeli/Pongpeli/Pongpeli/obj/x86/Debug/Pongpeli.csproj.FileListAbsolute.txt

    r5193 r5259  
    1616C:\MyTemp\JouniP_esimerkki\Pongpeli\Pongpeli\Pongpeli\obj\x86\Debug\Pongpeli.exe 
    1717C:\MyTemp\JouniP_esimerkki\Pongpeli\Pongpeli\Pongpeli\obj\x86\Debug\Pongpeli.pdb 
     18C:\MyTemp\JouniP_esimerkki\Pongpeli\Pongpeli\Pongpeli\bin\x86\Debug\Content\ukkeli.xnb 
  • 2014/27/JouniP_esimerkki/Pongpeli/Pongpeli/PongpeliContent/PongpeliContent.contentproj

    r5192 r5259  
    4444    <Reference Include="TextFileContentExtension" /> 
    4545  </ItemGroup> 
     46  <ItemGroup> 
     47    <Compile Include="ukkeli.png"> 
     48      <Name>ukkeli</Name> 
     49      <Importer>TextureImporter</Importer> 
     50      <Processor>TextureProcessor</Processor> 
     51    </Compile> 
     52  </ItemGroup> 
    4653  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    4754  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2014/27/JouniP_esimerkki/Pongpeli/Pongpeli/PongpeliContent/obj/x86/Debug/ContentPipeline.xml

    r5193 r5259  
    22<XnaContent xmlns:Pipeline="Microsoft.Xna.Framework.Content.Pipeline"> 
    33  <Asset Type="Pipeline:BuildItemCollection"> 
     4    <Item> 
     5      <Source>ukkeli.png</Source> 
     6      <Name>ukkeli</Name> 
     7      <Importer>TextureImporter</Importer> 
     8      <Processor>TextureProcessor</Processor> 
     9      <Options>None</Options> 
     10      <Output>C:\MyTemp\JouniP_esimerkki\Pongpeli\Pongpeli\Pongpeli\bin\x86\Debug\Content\ukkeli.xnb</Output> 
     11      <Time>2014-07-02T09:27:45.356574+03:00</Time> 
     12    </Item> 
    413    <BuildSuccessful>true</BuildSuccessful> 
    514    <Settings> 
     
    1524    <Assemblies> 
    1625      <Assembly> 
     26        <Key>C:\Program Files (x86)\Jypeli\lib\ContentExtensions\TextFileContentExtension.dll</Key> 
     27        <Value>2014-06-10T15:50:44+03:00</Value> 
     28      </Assembly> 
     29      <Assembly> 
     30        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.XImporter.dll</Key> 
     31        <Value>2010-08-23T12:41:18+03:00</Value> 
     32      </Assembly> 
     33      <Assembly> 
     34        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.VideoImporters.dll</Key> 
     35        <Value>2010-08-23T12:41:18+03:00</Value> 
     36      </Assembly> 
     37      <Assembly> 
     38        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.TextureImporter.dll</Key> 
     39        <Value>2010-08-23T12:41:18+03:00</Value> 
     40      </Assembly> 
     41      <Assembly> 
     42        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.FBXImporter.dll</Key> 
     43        <Value>2010-08-23T12:41:18+03:00</Value> 
     44      </Assembly> 
     45      <Assembly> 
     46        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.EffectImporter.dll</Key> 
     47        <Value>2010-08-23T12:41:18+03:00</Value> 
     48      </Assembly> 
     49      <Assembly> 
     50        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.AudioImporters.dll</Key> 
     51        <Value>2010-08-23T12:41:18+03:00</Value> 
     52      </Assembly> 
     53      <Assembly> 
    1754        <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> 
    1855        <Value>2012-04-04T09:57:00.7719393+03:00</Value> 
Note: See TracChangeset for help on using the changeset viewer.