Changeset 214


Ignore:
Timestamp:
2009-08-03 14:43:43 (14 years ago)
Author:
zhjiang
Message:
 
Location:
zhipeng_j
Files:
11 added
2 edited

Legend:

Unmodified
Added
Removed
  • zhipeng_j/pengJ/Peli.cs

    r201 r214  
    5656            t.Accelerate(vaanto); 
    5757 
    58             return false; 
     58            
    5959        } 
    6060 
    61         bool kaannaPutkea(ControlEvent e) 
    62         { 
    63             Tank t = e.Parameter0 as Tank; 
    64             Angle kaanto = e.Parameter1.ToAngle(); 
    6561 
    66             // Tässä käännetään tankin piippua 
    67             t.TurnCannon(kaanto); 
    6862 
    69             return false; 
     63 
    7064        } 
    7165    } 
  • zhipeng_j/pong/Peli.cs

    r207 r214  
    2323        protected override void LoadContent() 
    2424        { 
    25            IShape ympyra =Shapes . CreateCircle(20.0); 
    26            PhysicsObject pallo = new PhysicsObject(10.0, ympyra); 
    27            Level.Objects.Add(pallo); 
     25            Level = LuoKentta(); 
     26 
     27        } 
     28 
     29        Level LuoKentta() 
     30        { 
     31            Level kentta = new Level(this); 
     32            kentta.BackgroundColor = Color.Black; 
     33 
     34            IShape ympyra = Shapes.CreateCircle(20.0); 
     35            PhysicsObject pallo = new PhysicsObject(10.0, ympyra); 
     36            pallo.X = -200.0; 
     37            pallo.Y = 0.0; 
     38            pallo.Restitution = 1.0; 
     39            kentta.Objects.Add(pallo); 
     40 
     41            IShape suorakulmio = Shapes.CreateRectangle(20.0, 100.0); 
     42            PhysicsObject maila = PhysicsObject.CreateStaticObject(suorakulmio); 
     43            maila.X = kentta.Left + 20.0; 
     44            maila.Y = 0.0; 
     45            maila.Restitution = 1.0; 
     46            kentta.Objects.Add(maila); 
     47            return kentta; 
     48          
     49            
     50 
     51            
     52            
     53 
    2854             
     55            maila.X = kentta.Left + 20.0; 
     56            maila.Y = 0.0; 
     57            maila.Restitution = 1.0; 
     58            kentta.Objects.Add(maila); 
     59 
     60            Level kentta.CreateBorder(1.0, false); 
     61              
     62            kentta.BackgroundColor = Color.Black; 
    2963 
    3064 
     
    3367        } 
    3468    } 
     69 
    3570} 
    36   
     71 
     72 
     73 
     74 
     75 
     76 
     77 
Note: See TracChangeset for help on using the changeset viewer.