Changeset 24 for aki_p/Pong
- Timestamp:
- 2009-07-20 14:44:07 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
aki_p/Pong/Peli.cs
r14 r24 21 21 public class Peli : PhysicsGame 22 22 { 23 PhysicsObject pallo; 24 23 25 protected override void LoadContent() 24 26 { 25 //IShape ympyra = Shapes.CreateCircle(50.8); 26 IShape suorakaide = Shapes.CreateRectangle(40,40); 27 PhysicsObject pallo = new PhysicsObject(10.0, suorakaide); 28 Level.Objects.Add(pallo); 27 Level = LuoKentta(); 28 AloitaPeli(); 29 } 30 31 Level LuoKentta() 32 { 33 Level kentta = new Level(this); 34 kentta.BackgroundColor = Color.Black; 35 36 IShape ympyra = Shapes.CreateCircle(20.0); 37 pallo = new PhysicsObject(10.0, ympyra); 29 38 pallo.X = -200.0; 30 39 pallo.Y = 0.0; 31 //Vector2D impulssi = new Vector2D(2000.0, 0.0);32 //pallo.Hit(impulssi);33 IShape ympyra = Shapes.CreateCircle(50.8);34 PhysicsObject pallo = new PhysicsObject(10.0, ympyra);35 40 pallo.Restitution = 1.0; 36 Level.CreateBorder(1.0, false); 37 Level.BackgroundColor = Color.Black; 41 kentta.Objects.Add(pallo); 42 43 IShape suorakulmio = Shapes.CreateRectangle(20.0, 100.0); 44 PhysicsObject maila = PhysicsObject.CreateStaticObject(suorakulmio); 45 maila.X = kentta.Left + 20.0; 46 maila.Y = 0.0; 47 maila.Restitution = 1.0; 48 kentta.Objects.Add(maila); 49 50 kentta.CreateBorder(1.0, false); 51 52 return kentta; 38 53 } 54 55 void AloitaPeli() 56 { 57 Vector2D impulssi = new Vector2D(2000.0, 0.0); 58 pallo.Hit(impulssi); 59 } 60 39 61 } 40 62 }
Note: See TracChangeset
for help on using the changeset viewer.