Changeset 2501 for 2011/31/AleksiR


Ignore:
Timestamp:
2011-08-02 14:57:30 (8 years ago)
Author:
almarimp
Message:

Talletus.

Location:
2011/31/AleksiR
Files:
38 added
6 edited

Legend:

Unmodified
Added
Removed
  • 2011/31/AleksiR/Pong/Pong/Pong/Peli.cs

    r2468 r2501  
    1515    PhysicsObject maila1; 
    1616    PhysicsObject maila2; 
     17    PhysicsObject tahti; 
    1718 
    1819    PhysicsObject oikeaReuna; 
     
    3132    } 
    3233    void LuoKentta() 
    33     {    pallo = new PhysicsObject(20, 20); 
    34         pallo.Shape = Shape.Star; 
     34    { 
     35        pallo = new PhysicsObject(25, 25); 
     36        pallo.Shape = Shape.Circle; 
    3537        pallo.X = -300.0; 
    3638        pallo.Y = 237.2; 
    3739        pallo.Restitution = 1.0; 
     40        pallo.KineticFriction = 0.0; 
     41        pallo.CanRotate = true; 
    3842        pallo.Color = Color.Black; 
    3943        Add(pallo); 
    4044        AddCollisionHandler(pallo, KasittelePallonTormays); 
     45 
     46        FollowerBrain Aly= new FollowerBrain(); 
     47 
     48        tahti = new PhysicsObject(20, 20); 
     49        tahti.X = -200; 
     50        tahti.Y = -100; 
     51        tahti.Color = Color.LightYellow; 
     52        tahti.Brain = Aly; 
     53        tahti.Shape = Shape.Star; 
     54        Add(tahti); 
     55 
     56        Aly.Active = true; 
     57        Aly.Target = pallo; 
     58        Aly.Speed = 400; 
     59        Aly.FollowAlways = true; 
     60        Aly.TargetCloseDistance = 100; 
     61        Aly.StopWhenTargetClose = false; 
    4162 
    4263        maila1 = LuoMaila(Level.Left + 20.0, 0.0); 
     
    4465 
    4566        vasenReuna = Level.CreateLeftBorder(); 
    46         vasenReuna.Restitution = 1.0; 
     67        vasenReuna.Restitution = 1.2; 
    4768        vasenReuna.IsVisible = false; 
    4869 
    4970        oikeaReuna = Level.CreateRightBorder(); 
    50         oikeaReuna.Restitution = 1.0; 
     71        oikeaReuna.Restitution = 1.2; 
    5172        oikeaReuna.IsVisible = false; 
    5273 
    5374        PhysicsObject alaReuna = Level.CreateBottomBorder(); 
    54         alaReuna.Restitution = 1.0; 
     75        alaReuna.Restitution = 1.1; 
    5576        alaReuna.IsVisible = false; 
    5677 
    5778        PhysicsObject ylaReuna = Level.CreateTopBorder(); 
    58         ylaReuna.Restitution = 1.0; 
     79        ylaReuna.Restitution = 1.1; 
    5980        ylaReuna.IsVisible = false; 
    6081 
     
    6788    void AloitaPeli() 
    6889    { 
    69         Vector impulssi = new Vector(700.0, 350.0); 
     90        Vector impulssi = new Vector(500,-100); 
    7091        pallo.Hit(impulssi); 
    7192 
     
    7798        maila.X = x; 
    7899        maila.Y = y; 
    79         maila.Restitution = 1.0; 
     100        maila.Restitution = 1.5; 
    80101        maila.Color = Color.ForestGreen; 
    81102        Add(maila); 
Note: See TracChangeset for help on using the changeset viewer.