Changeset 1557 for 2010/31


Ignore:
Timestamp:
2010-08-03 13:47:04 (13 years ago)
Author:
paaaanro
Message:

Pääsin vaihe seitsemään.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2010/31/kirsipienmaki@gmail.com/Pong/Peli.cs

    r1554 r1557  
    1818        LuoKentta(); 
    1919        AsetaOhjaimet(); 
     20        LisaaLaskurit(); 
    2021        AloitaPeli(); 
    2122    } 
     
    3839        Camera.ZoomToLevel(); 
    3940    } 
     41 
    4042    void AloitaPeli() 
    4143    { 
     
    5557        return maila; 
    5658    } 
     59 
    5760    void AsetaOhjaimet() 
    5861    { 
     
    7174    } 
    7275    void AsetaNopeus(PhysicsObject maila, Vector nopeus) 
     76    {  
     77        if ((nopeus.Y < 0) && (maila.Bottom < Level.Bottom)) 
     78        { 
     79            maila.Velocity = Vector.Zero; 
     80            return; 
     81        } 
     82 
     83        if ((nopeus.Y > 0) && (maila.Top > Level.Top)) 
     84        { 
     85            maila.Velocity = Vector.Zero; 
     86            return; 
     87        } 
     88 
     89     
     90        maila.Velocity = nopeus; 
     91    } 
     92    void LisaaLaskurit() 
    7393    { 
    74         maila.Velocity = nopeus; 
     94    //... 
     95    } 
     96    IntMeter LuoPisteLaskuri( double x, double y ) 
     97    { 
     98        IntMeter laskuri = new IntMeter(0); 
     99        laskuri.MaxValue = 10; 
     100        Label nautto = new Label(); 
     101        naytto.BindTo(laskuri); 
     102        naytto.X = x; 
     103        naytto.Y = y; 
     104        naytto.TextColor = Color.White; 
     105        Add(naytto); 
     106        return laskuri; 
    75107    } 
    76108 
    77109} 
    78110 
    79  
    80  
Note: See TracChangeset for help on using the changeset viewer.