Ignore:
Timestamp:
2013-06-11 10:08:45 (10 years ago)
Author:
betiterv
Message:

Talletus.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2013/24/BenjaminT/Pong/Pong/Pong/Pong.cs

    r4046 r4062  
    99public class Pong : PhysicsGame 
    1010{ 
    11   Vector nopeusYlos = new Vector(0, 200);   
    12   Vector nopeusAlas = new Vector(0, -200); 
     11    Vector nopeusYlos = new Vector(0, 200); 
     12    Vector nopeusAlas = new Vector(0, -200); 
    1313 
    14      
    15      
    16      
     14 
     15 
     16 
    1717    PhysicsObject pallo; 
    1818 
    1919    PhysicsObject maila1; 
    2020    PhysicsObject maila2; 
    21      
     21 
    2222    public override void Begin() 
    2323    { 
     
    4040        Add(pallo); 
    4141 
    42        maila1 = LuoMaila(Level.Left + 20.0, 0.0); 
    43        maila2 = LuoMaila(Level.Right - 20.0, 0.0); 
     42        maila1 = LuoMaila(Level.Left + 20.0, 0.0); 
     43        maila2 = LuoMaila(Level.Right - 20.0, 0.0); 
    4444 
    4545 
    46         
     46 
    4747 
    4848 
     
    7575 
    7676 
    77   PhysicsObject LuoMaila(double x, double y) 
     77    PhysicsObject LuoMaila(double x, double y) 
    7878    { 
    7979        PhysicsObject maila = PhysicsObject.CreateStaticObject(20.0, 100.0); 
     
    8484        Add(maila); 
    8585        return maila; 
    86          
    87     
    88    
    89   } 
     86 
     87 
     88 
     89    } 
    9090 
    9191 
    9292    void AsetaOhjaimet() 
    9393    { 
    94        
    9594 
    96         Keyboard.Listen(Key.A, ButtonState.Down, LiikutaMaila1Ylos, "Pelaaja 1: Liikuta maila ylös"); 
    97         Keyboard.Listen(Key.A, ButtonState.Released, PysaytaMaila1, null); 
     95 
     96        Keyboard.Listen(Key.A, ButtonState.Down, AsetaNopeus, "Pelaaja 1: Liikuta maila ylös" , maila1, nopeusYlos); 
     97        Keyboard.Listen(Key.A, ButtonState.Released, AsetaNopeus , null, maila1, Vector.Zero); 
    9898 
    9999        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
    100100    } 
    101101 
    102     voida AsetaNopeus(PhysicsObject maila, Vector nopeus) 
     102     void AsetaNopeus(PhysicsObject maila, Vector nopeus) 
    103103    { 
    104104 
    105105        maila.Velocity = nopeus; 
     106 
     107 
     108    } 
     109 
     110} 
Note: See TracChangeset for help on using the changeset viewer.