Changeset 3498


Ignore:
Timestamp:
2012-07-03 15:07:40 (11 years ago)
Author:
fralnauk
Message:

Talletus.

Location:
2012/27/Alex
Files:
1 added
1 edited

Legend:

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

    r3453 r3498  
    99public class pong : PhysicsGame 
    1010{ 
     11    PhysicsObject takua; 
    1112    public override void Begin() 
    1213    { 
     
    1516        LuoKentta(); 
    1617 
    17         Vector impulssi = new Vector(5000.0, 0.0); 
    18         ony.Hit(impulssi); 
    19         
     18        Vector impulssi = new Vector(1000.0, 0.0); 
     19        takua.Hit(impulssi); 
     20 
    2021        PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
    2122        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
    22      
    23    } 
     23 
     24    } 
    2425 
    2526    void LuoKentta() 
    2627    { 
    27         PhysicsObject ony = new PhysicsObject(551.0, 5.0); 
    28         ony.Shape = Shape.Triangel; 
    29         ony.Color = Color.Blue; 
    30         ony.Y = 0.0; 
    31         ony.X = -200.0; 
    32         Add(ony); 
     28        takua = new PhysicsObject(50.0, 50.0); 
     29        takua.Shape = Shape.Circle; 
     30        takua.Color = Color.Red; 
     31        takua.Y = 0.0; 
     32        takua.X = -200.0; 
     33        Add(takua); 
     34 
     35        PhysicsObject makuta = PhysicsObject.CreateStaticObject(11.1, 77.7); 
     36        makuta.Shape = Shape.Circle; 
     37        makuta.Color = 
     38        makuta.X = Level.Left + 20.0; 
     39        makuta.Y = 0.0; 
     40        makuta.Restitution = 1.0; 
     41        Add(makuta); 
     42 
    3343        Level.CreateBorders(1.0, false); 
    34         ony.Restitution = 1.0; 
     44        takua.Restitution = 1.0; 
    3545        Level.BackgroundColor = Color.Gray; 
    3646 
Note: See TracChangeset for help on using the changeset viewer.