Changeset 3460


Ignore:
Timestamp:
2012-07-03 10:38:47 (8 years ago)
Author:
henmatma
Message:

Talletus.

Location:
2012/27/HenriM
Files:
18 added
1 edited

Legend:

Unmodified
Added
Removed
  • 2012/27/HenriM/Pong/Pong/Pong/Pong.cs

    r3448 r3460  
    1010{ 
    1111 
    12     Vector nopeusYlos = new Vector(0, 200); 
    13     Vector nopeusAlas = new Vector(0, -200); 
     12    Vector nopeusYlos = new Vector(0, 400); 
     13    Vector nopeusAlas = new Vector(0, -400); 
    1414 
    1515    PhysicsObject pallo; 
    1616    PhysicsObject maila1; 
    1717    PhysicsObject maila2; 
     18 
     19    PhysicsObject vasenReuna; 
     20    PhysicsObject oikeaReuna; 
    1821 
    1922    IntMeter pelaajan1Pisteet; 
     
    3538    pallo.Y = 0.0; 
    3639    pallo.Restitution = 1.0; 
     40    pallo.KineticFriction = 0.0; 
    3741 
    3842    Add(pallo); 
     
    4145    maila2 = LuoMaila(Level.Right - 20.0, 0.0); 
    4246 
    43     PhysicsObject vasenReuna = Level.CreateLeftBorder(); 
     47    vasenReuna = Level.CreateLeftBorder(); 
    4448    vasenReuna.Restitution = 1.0; 
    4549    vasenReuna.IsVisible = false; 
     50    vasenReuna.KineticFriction = 0.0; 
    4651 
    47     PhysicsObject oikeaReuna = Level.CreateRightBorder(); 
     52    oikeaReuna = Level.CreateRightBorder(); 
    4853    oikeaReuna.Restitution = 1.0; 
    4954    oikeaReuna.IsVisible = false; 
     55    oikeaReuna.KineticFriction = 0.0; 
     56 
     57    PhysicsObject alaReuna = Level.CreateBottomBorder(); 
     58    alaReuna.Restitution = 1.0; 
     59    alaReuna.IsVisible = false; 
     60    alaReuna.KineticFriction = 0.0; 
     61 
     62    PhysicsObject ylaReuna = Level.CreateTopBorder(); 
     63    ylaReuna.Restitution = 1.0; 
     64    ylaReuna.IsVisible = false; 
     65    ylaReuna.KineticFriction = 0.0; 
    5066 
    5167    Level.BackgroundColor = Color.Black; 
     
    130146    void KasittelePallonTormays(PhysicsObject pallo, PhysicsObject kohde) 
    131147    { 
     148        if (kohde == oikeaReuna) 
     149        { 
     150            pelaajan1Pisteet.Value += 1; 
     151        } 
     152        else if (kohde == vasenReuna) 
     153        { 
     154            pelaajan2Pisteet.Value += 1; 
     155        } 
    132156 
    133157    } 
Note: See TracChangeset for help on using the changeset viewer.