Changeset 230 for arho_m


Ignore:
Timestamp:
2009-08-04 10:16:27 (10 years ago)
Author:
armahlam
Message:
 
Location:
arho_m/Pong
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • arho_m/Pong/Content/Content.contentproj

    r197 r230  
    1 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> 
     1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> 
    22  <PropertyGroup> 
    33    <ProjectGuid>328ac7fe-0567-43b1-8316-ce541d443ef3</ProjectGuid> 
     
    3434    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.XImporter, Version=3.1.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d" /> 
    3535  </ItemGroup> 
     36  <ItemGroup> 
     37    <Compile Include="maila.png"> 
     38      <Name>maila</Name> 
     39      <Importer>TextureImporter</Importer> 
     40      <Processor>TextureProcessor</Processor> 
     41    </Compile> 
     42  </ItemGroup> 
    3643</Project> 
  • arho_m/Pong/Peli.cs

    r221 r230  
    4242                RandomGen.NextDouble(-1000.0, -1000.0)); 
    4343            pallo.Hit(v); 
     44            pallo.StaticFriction = 0.0; 
     45            pallo.KineticFriction = 0.0; 
     46            pallo.Restitution = 1.0; 
    4447        } 
    4548 
    4649        void LuoMailat( double leveys, double korkeus, double dist ) 
    4750        { 
    48             IShape shp = Shapes.CreateRectangle(leveys, korkeus); 
     51            Texture2D tex = Content.Load<Texture2D>("maila"); 
     52            Vector2D vec = new Vector2D(64.0, 128.0); 
     53            IShape shp = Shapes.CreateFromTexture(tex, vec, 10.0); 
     54            //IShape shp = Shapes.CreateRectangle(leveys, korkeus); 
    4955 
    5056            maila1 = PhysicsObject.CreateStaticObject(shp); 
    5157            maila1.Color = Color.White; 
    5258            maila1.X = -dist / 2.0; 
    53             maila1.Y = 0; 
    5459            maila1.Restitution = 1.0; 
    5560 
     
    5762            maila2.Color = Color.White; 
    5863            maila2.X = dist / 2.0; 
    59             maila2.Y = Level.Top; 
    60             maila2.Velocity = new Vector2D(0, Level.Bottom-Level.Top/10*-1); 
    6164            maila2.Restitution = 1.0; 
    6265 
    6366            Timer tm = new Timer(); 
    64             tm.Interval = 1; 
     67            tm.Interval = 1.0 / 60.0; 
    6568            tm.Trigger += new Timer.TriggerHandler(LiikutaMaila2); 
     69            tm.Start(); 
    6670            AddTimer(tm); 
    6771 
     
    9498            if (kohde == Level.RightBorder) 
    9599            { 
    96                 // piste maila1kköselle 
     100                // piste ykköselle 
    97101            } 
    98102            if (kohde == Level.LeftBorder) 
     
    104108        void LiikutaMaila2( Timer sender ) 
    105109        { 
     110            double matka = pallo.Y - maila2.Y; 
     111            maila2.Y += matka; 
    106112        } 
    107113    } 
Note: See TracChangeset for help on using the changeset viewer.