Changeset 2683 for 2012


Ignore:
Timestamp:
2012-04-16 10:58:29 (11 years ago)
Author:
anonymous
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2012/JAO/JaakkoSivill/pong/pong/pong/pong.cs

    r2664 r2683  
    99public class pong : PhysicsGame 
    1010{ 
     11    PhysicsObject pallo; 
     12 
     13     
     14 
    1115    public override void Begin() 
    1216    { 
    13         // TODO: Kirjoita ohjelmakoodisi tähän 
    14  
     17        LuoKentta(); 
     18        AloitaPeli(); 
    1519        PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
    1620        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
    1721    } 
     22    void LuoKentta() 
     23    { 
     24        pallo = new PhysicsObject(40.0, 40.0); 
     25        Add(pallo); 
     26        pallo.Shape = Shape.Circle; 
     27        pallo.X = -200.0; 
     28        pallo.Y = 0.0; 
     29        Vector impulssi = new Vector(500.0, 0.0); 
     30        pallo.Hit(impulssi); 
     31        Level.CreateBorders(); 
     32        pallo.Restitution = 1.0; 
     33        Level.BackgroundColor = Color.Black; 
     34        Camera.ZoomToLevel(); 
     35        PhysicsObject maila = PhysicsObject.CreateStaticObject(20.0, 100.0); 
     36        maila.Shape = Shape.Rectangle; 
     37        maila.X = Level.Left + 20.0; 
     38        maila.Y = 0.0; 
     39        maila.Restitution = 1.0; 
     40        Add(maila); 
     41    } 
    1842} 
Note: See TracChangeset for help on using the changeset viewer.