Changeset 8522


Ignore:
Timestamp:
2017-06-12 13:13:42 (2 years ago)
Author:
npo17_28
Message:

jotain

Location:
2017/24/JaakkoK/Pong
Files:
2 edited

Legend:

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

    r8513 r8522  
    2828        pallo.Restitution = 1.0; 
    2929 
    30         PhysicsObject maila = PhysicsObject.CreateStaticObject(20.0, 100.0); 
    31         maila.Shape = Shape.Rectangle; 
    32         maila.X = Level.Left + 20.0; 
    33         maila.Y = 0.0; 
    34         maila.Restitution = 1.0; 
    35         Add(maila); 
     30        LuoMaila(Level.Left + 20.0, 0.0); 
     31        LuoMaila(Level.Right - 20.0, 0.0); 
    3632 
    3733        Level.CreateBorders(1.0, false); 
     
    4541        Vector impulssi = new Vector(500.0, 0.0); 
    4642        pallo.Hit(impulssi); 
     43 
     44 
     45        void LuoMaila(double x, double y) 
     46        { 
     47    PhysicsObject maila = PhysicsObject.CreateStaticObject(20.0, 100.0); 
     48    maila.Shape = Shape.Rectangle; 
     49    maila.X = x; 
     50    maila.Y = y; 
     51    maila.Restitution = 1.0; 
     52    Add(maila); 
     53        } 
    4754    } 
    4855} 
Note: See TracChangeset for help on using the changeset viewer.