Changeset 3609


Ignore:
Timestamp:
2012-07-05 15:06:44 (11 years ago)
Author:
nikatais
Message:

Talletus.

Location:
2012/27/NikoKa
Files:
100 added
1 edited

Legend:

Unmodified
Added
Removed
  • 2012/27/NikoKa/pong/pong/pong/pong.cs

    r3454 r3609  
    99public class pong : PhysicsGame 
    1010{ 
     11    PhysicsObject spyro; 
    1112    public override void Begin() 
    1213    { 
    13         PhysicsObject spyro = new PhysicsObject(100,0); 
    14         Add(spyro); 
    15         spyro.Shape = Shape.Diamond; 
    16         spyro.Color = Color.Purple; 
    17         Vector impulssi = new Vector(10000, 0); 
    18         spyro.Hit(impulssi); 
    19         Level.CreateBorders(1.0, false); 
    20         Level.BackgroundColor = Color.Black; 
    21         spyro.Restitution = 1.0; 
     14        luokenttä(); 
     15 
     16        aloitapeli(); 
     17         
     18         
     19        
     20 
     21         
     22          
    2223         
    2324         
     
    2930        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
    3031    } 
     32    void luokenttä() 
     33  
     34    { spyro = new PhysicsObject(90,90); 
     35        Add(spyro); 
     36        spyro.Shape = Shape.Circle; 
     37        spyro.Color = Color.Purple; 
     38     Level.CreateBorders(1.0, false); 
     39        Level.BackgroundColor = Color.Black; 
     40        spyro.Restitution = 1.0; 
     41 
     42        LuoMaila(Level.Left + 20.0, 0.0); 
     43        LuoMaila(Level.Right - 20.0, 0.0); 
     44 
     45 
     46    } 
     47    void aloitapeli() 
     48    { 
     49        Vector impulssi = new Vector(5000, 5000); 
     50        spyro.Hit(impulssi); 
     51 
     52    } 
     53    void LuoMaila(double x, double y) 
     54    { 
     55        PhysicsObject maila = PhysicsObject.CreateStaticObject(20.0, 100.0); 
     56        maila.Shape = Shape.Rectangle; 
     57        maila.X=x; 
     58        maila.Y=y; 
     59        maila.Restitution = 1.0; 
     60        Add(maila); 
     61    } 
     62void AsetaOhjaimet() 
     63{ 
     64   Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
     65} 
     66 
     67     
     68 
    3169} 
    3270   
Note: See TracChangeset for help on using the changeset viewer.