Changeset 8528 for 2017/24


Ignore:
Timestamp:
2017-06-12 14:56:39 (2 years ago)
Author:
npo17_24
Message:
 
Location:
2017/24/VeikkaL/Pong
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • 2017/24/VeikkaL/Pong/Pong/Pong/Pong.cs

    r8521 r8528  
    3636        Level.CreateBorders(1.0, false); 
    3737        pallo.Restitution = 1.0; 
    38         PhysicsObject maila = PhysicsObject.CreateStaticObject(20.0, 100.0); 
    39         maila.Shape = Shape.Rectangle; 
    40         maila.X = Level.Left + 20.0; 
    41         maila.Y = 0.0; 
    42         maila.Restitution = 1.0; 
    43         Add(maila); 
     38        
     39        LuoMaila(Level.Left + 20.0, 0.0); 
     40        LuoMaila(Level.Right - 20.0, 0.0); 
     41        
    4442 
    4543        Level.Background.Color = Color.Red; 
     
    6260        base.Update(time); 
    6361    } 
     62    void LuoMaila(double x, double y) 
     63    { 
     64        PhysicsObject maila = PhysicsObject.CreateStaticObject(20.0, 100.0); 
     65        maila.Shape = Shape.Rectangle; 
     66        maila.X = x; 
     67        maila.Y = y; 
     68 
     69        maila.Restitution = 1.0; 
     70        Add(maila); 
     71    } 
    6472} 
Note: See TracChangeset for help on using the changeset viewer.