Changeset 3546 for 2012


Ignore:
Timestamp:
2012-07-04 14:58:23 (7 years ago)
Author:
jomajusi
Message:

Talletus.

Location:
2012/27/JoukoS/Data Tunnel/Data Tunnel
Files:
5 added
3 edited

Legend:

Unmodified
Added
Removed
  • 2012/27/JoukoS/Data Tunnel/Data Tunnel/Data Tunnel/Data Tunnel.csproj

    r3488 r3546  
    120120  </ItemGroup> 
    121121  <ItemGroup> 
    122     <ProjectReference Include="..\Data_TunnelContent\Data_TunnelContent.contentproj"> 
    123       <Name>Data_TunnelContent</Name> 
    124       <XnaReferenceType>Content</XnaReferenceType> 
    125     </ProjectReference> 
    126   </ItemGroup> 
    127   <ItemGroup> 
    128122    <BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client"> 
    129123      <Visible>False</Visible> 
     
    152146    </BootstrapperPackage> 
    153147  </ItemGroup> 
     148  <ItemGroup> 
     149    <ProjectReference Include="..\Data TunnelContent\Data TunnelContent.contentproj"> 
     150      <Project>{286C053D-937B-483F-A23E-012FD678BD73}</Project> 
     151      <Name>Data TunnelContent %28Content%29</Name> 
     152      <XnaReferenceType>Content</XnaReferenceType> 
     153    </ProjectReference> 
     154  </ItemGroup> 
    154155  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> 
    155156  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" /> 
  • 2012/27/JoukoS/Data Tunnel/Data Tunnel/Data Tunnel/Data_Tunnel.cs

    r3488 r3546  
    99public class Data_Tunnel : PhysicsGame 
    1010{ 
    11     PhysicsObject VihuPallo; 
     11    Image TEO = LoadImage("Threadeateroikealle"); 
     12    Image TEV = LoadImage("Threadeatervasemmalle"); 
     13    Image ThreadO = LoadImage("Threadoikealle"); 
     14    Image ThreadV = LoadImage("Threadvasemmalle"); 
     15    PhysicsObject VihuPallovasen; 
     16    PhysicsObject VihuPalloOikea; 
    1217    PhysicsObject hyvaPallo; 
     18    PhysicsObject vasenReuna; 
     19    PhysicsObject oikeaReuna; 
    1320    Vector liikuOikealle = new Vector(500, 0); 
    1421    Vector liikuVasemmalle = new Vector(-500, 0); 
    1522    public override void Begin() 
    16     { 
    17         Level.BackgroundColor = Color.Black; 
    18         Gravity = new Vector(0, -1000); 
     23    {    
    1924        PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
    2025        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
    21         LuoPallo(300, 400, 50, 100, Color.Azure, Shape.Ellipse); 
    22         hyvaPallo = new PhysicsObject(50, 50); 
    23         hyvaPallo.Shape = Shape.Circle; 
    24         hyvaPallo.Color = Color.Red; 
    25         hyvaPallo.X = -200; 
    26         hyvaPallo.Y = 300; 
    27         Add(hyvaPallo); 
    28         PhysicsObject alaReuna = Level.CreateBottomBorder(); 
    29         PhysicsObject ylaReuna = Level.CreateTopBorder(); 
    30         PhysicsObject vasenReuna = Level.CreateLeftBorder(); 
    31         vasenReuna.Restitution = 0; 
     26        LuoKentta(); 
     27        LuoPallo(100, 245); 
     28        LuoPallo2(150, 105); 
     29        LuoPallo2(-200, 105); 
     30        LuoPallo(-150, -35); 
     31        LuoPallo(305, -80); 
     32        LuoThread(); 
     33        Nappaimet(); 
     34    } 
     35    void LuoKentta() 
     36    { 
     37        ColorTileMap ruudut = ColorTileMap.FromLevelAsset("kentta"); 
     38        ruudut.SetTileMethod(Color.Black, LuoPalikka); 
     39        ruudut.Execute(20, 20); 
     40        vasenReuna = Level.CreateLeftBorder(); 
     41        vasenReuna.Restitution = 1.0; 
    3242        vasenReuna.KineticFriction = 0.0; 
    3343        vasenReuna.IsVisible = false; 
    34         PhysicsObject oikeaReuna = Level.CreateRightBorder(); 
    35         vasenReuna.Restitution = 0; 
    36         vasenReuna.KineticFriction = 0.0; 
    37         vasenReuna.IsVisible = false; 
     44        Add(vasenReuna); 
     45        oikeaReuna = Level.CreateRightBorder(); 
     46        oikeaReuna.Restitution = 1.0; 
     47        oikeaReuna.KineticFriction = 1.0; 
     48        oikeaReuna.IsVisible = false; 
     49        Add(oikeaReuna); 
     50        Level.BackgroundColor = Color.White; 
     51        Gravity = new Vector(0, -1000); 
    3852        Camera.ZoomToLevel(); 
    39         Nappaimet(); 
    4053    } 
    41     void LuoPallo(int Size1, int Size2, double x, double y, Color vari, Shape muoto) 
     54    void LuoPalikka(Vector paikka, double leveys, double korkeus)  
     55    {  
     56    PhysicsObject palikka = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     57    palikka.Position = paikka; 
     58    palikka.Shape = Shape.Rectangle; 
     59    palikka.Color = Color.Black; 
     60    palikka.Restitution = (0.0); 
     61    Add(palikka); 
     62    } 
     63    void LuoThread() 
    4264    { 
    43         VihuPallo = new PhysicsObject(Size1, Size2); 
    44         VihuPallo.Shape = muoto; 
    45         VihuPallo.Color = vari; 
    46         VihuPallo.X = x; 
    47         VihuPallo.Y = y; 
    48         Add(VihuPallo); 
     65        hyvaPallo = new PhysicsObject(50, 50); 
     66        hyvaPallo.Image = ThreadO; 
     67        hyvaPallo.Restitution = (0.0); 
     68        hyvaPallo.X = -250; 
     69        hyvaPallo.Y = 250; 
     70        Add(hyvaPallo); 
     71    } 
     72    void LuoPallo(double x, double y) 
     73    { 
     74        VihuPallovasen = new PhysicsObject(50,50); 
     75        VihuPallovasen.Image = TEV; 
     76        VihuPallovasen.X = x; 
     77        VihuPallovasen.Y = y; 
     78        VihuPallovasen.Restitution = (0.0); 
     79        Add(VihuPallovasen); 
     80    } 
     81    void LuoPallo2(double x, double y) 
     82    { 
     83        VihuPalloOikea = new PhysicsObject(50, 50); 
     84        VihuPalloOikea.Image = TEO; 
     85        VihuPalloOikea.X = x; 
     86        VihuPalloOikea.Y = y; 
     87        VihuPalloOikea.Restitution = (0.0); 
     88        Add(VihuPalloOikea); 
    4989    } 
    5090    void Nappaimet() 
     
    5999        hyvaPallo.Velocity = nopeus; 
    60100    } 
     101    void LuoTaso(Vector paikka) 
     102    { 
     103        PhysicsObject taso = PhysicsObject.CreateStaticObject(50, 50); 
     104        taso.Position = paikka; 
     105        taso.Color = Color.Black; 
     106        Add(taso); 
     107    } 
    61108 
    62109} 
  • 2012/27/JoukoS/Data Tunnel/Data Tunnel/Data TunnelContent/Data TunnelContent.contentproj

    r3488 r3546  
    4444    <Reference Include="TextFileContentExtension" /> 
    4545  </ItemGroup> 
     46  <ItemGroup> 
     47    <Compile Include="Threadeateroikealle.png"> 
     48      <Name>Threadeateroikealle</Name> 
     49      <Importer>TextureImporter</Importer> 
     50      <Processor>TextureProcessor</Processor> 
     51    </Compile> 
     52    <Compile Include="Threadeatervasemmalle.png"> 
     53      <Name>Threadeatervasemmalle</Name> 
     54      <Importer>TextureImporter</Importer> 
     55      <Processor>TextureProcessor</Processor> 
     56    </Compile> 
     57    <Compile Include="Threadoikealle.png"> 
     58      <Name>Threadoikealle</Name> 
     59      <Importer>TextureImporter</Importer> 
     60      <Processor>TextureProcessor</Processor> 
     61    </Compile> 
     62    <Compile Include="Threadvasemmalle.png"> 
     63      <Name>Threadvasemmalle</Name> 
     64      <Importer>TextureImporter</Importer> 
     65      <Processor>TextureProcessor</Processor> 
     66    </Compile> 
     67  </ItemGroup> 
     68  <ItemGroup> 
     69    <Compile Include="Kentta.png"> 
     70      <Name>Kentta</Name> 
     71      <Importer>TextureImporter</Importer> 
     72      <Processor>TextureProcessor</Processor> 
     73    </Compile> 
     74  </ItemGroup> 
    4675  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    4776  <!--  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.