Ignore:
Timestamp:
2010-07-28 11:29:51 (13 years ago)
Author:
alkivima
Message:

kenttään paikkoja

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2010/30/alkivima/Car Duels/Peli.cs

    r1330 r1354  
    77public class Peli : TopDownPhysicsGame 
    88{ 
     9    PhysicsObject vasenReuna; 
     10    PhysicsObject oikeaReuna; 
     11 
    912    protected override void Begin() 
    1013    { 
    11         KineticFriction = 1.0; // Asetetaan kitka 
     14        KineticFriction = 0.5; // Asetetaan kitka 
    1215 
    13         Automobile auto = new Automobile(80, 40); 
     16        Automobile auto = new Automobile(60, 50); 
    1417        auto.Mass = 100.0; 
    1518        auto.Color = new Color(1, 1, 1); 
     19        auto.X = -200; 
     20        auto.Y = 0; 
     21        auto.LinearDamping = 0.99; 
     22        auto.AngularDamping = 1.0; 
    1623        Add(auto); 
    1724 
    18         Automobile auto2 = new Automobile(80, 40); 
     25        Automobile auto2 = new Automobile(60, 50); 
    1926        auto2.Mass = 100.0; 
    2027        auto2.Color = new Color(255, 255, 255); 
     28        auto2.X = 200; 
     29        auto2.Y = 0; 
     30        auto2.LinearDamping = 0.99; 
     31        auto2.AngularDamping = 1.0; 
     32        auto2.Angle = Angle.Degrees (180.0); 
    2133        Add(auto2); 
    2234 
     
    5769    void Kentta() 
    5870    { 
     71        PhysicsObject pylvas1 = PhysicsObject.CreateStaticObject(50.0, 50.0); 
     72        pylvas1.Shape = Shapes.Rectangle; 
     73        pylvas1.X = 200; 
     74        pylvas1.Y = 200; 
     75        pylvas1.Restitution = 0.2; 
     76        pylvas1.Tag = "pylvas"; 
     77        Add(pylvas1); 
     78 
     79        PhysicsObject pylvas2 = PhysicsObject.CreateStaticObject(50.0, 50.0); 
     80        pylvas2.Shape = Shapes.Rectangle; 
     81        pylvas2.X = -200; 
     82        pylvas2.Y = 200; 
     83        pylvas2.Restitution = 0.2; 
     84        pylvas2.Tag = "pylvas"; 
     85        Add(pylvas2); 
     86 
     87        PhysicsObject pylvas3 = PhysicsObject.CreateStaticObject(50.0, 50.0); 
     88        pylvas3.Shape = Shapes.Rectangle; 
     89        pylvas3.X = -200; 
     90        pylvas3.Y = -200; 
     91        pylvas3.Restitution = 0.2; 
     92        pylvas3.Tag = "pylvas"; 
     93        Add(pylvas3); 
     94 
     95        PhysicsObject pylvas4 = PhysicsObject.CreateStaticObject(50.0, 50.0); 
     96        pylvas4.Shape = Shapes.Rectangle; 
     97        pylvas4.X = 200; 
     98        pylvas4.Y = -200; 
     99        pylvas4.Restitution = 0.2; 
     100        pylvas4.Tag = "pylvas"; 
     101        Add(pylvas4); 
     102 
     103        GameObject maata = new GameObject(800.0, 700.0); 
     104        maata.Shape = Shapes.Circle; 
     105        maata.Color = Color.Gray; 
     106        Add(maata); 
     107 
     108        GameObject Reuna = new GameObject(70.0, 70.0); 
     109        Reuna.Shape = Shapes.Circle; 
     110        Reuna.Color = Color.Black; 
     111        Add(Reuna); 
     112         
     113        GameObject Boostipaikka = new GameObject(60.0, 60.0); 
     114        Boostipaikka.Shape = Shapes.Circle; 
     115        Boostipaikka.Color = Color.Turquoise; 
     116        Add(Boostipaikka); 
     117 
     118 
     119        vasenReuna = Level.CreateLeftBorder(); 
     120        vasenReuna.Restitution = 0.3; 
     121        vasenReuna.IsVisible = true; 
     122        oikeaReuna = Level.CreateRightBorder(); 
     123        oikeaReuna.Restitution = 0.3; 
     124        oikeaReuna.IsVisible = true; 
     125        PhysicsObject ylaReuna = Level.CreateTopBorder(); 
     126        ylaReuna.Restitution = 0.3; 
     127        ylaReuna.IsVisible = true; 
     128        PhysicsObject alaReuna = Level.CreateBottomBorder(); 
     129        alaReuna.Restitution = 0.3; 
     130        alaReuna.IsVisible = true; 
     131    
    59132        Level.BackgroundColor = Color.ForestGreen; 
     133 
     134        Camera.X = 0.0; 
     135        Camera.Y = 0.0; 
     136        Camera.Zoom(1.2); 
     137         
    60138    } 
     139    void PylvaidenVarit() 
     140    {  
     141         
     142    } 
     143 
    61144} 
Note: See TracChangeset for help on using the changeset viewer.