Changeset 8658 for 2017/24/SebastianH/JumpingAdventure/JumpingAdventure/JumpingAdventure/JumpingAdventure.cs
- Timestamp:
- 2017-06-14 13:02:58 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2017/24/SebastianH/JumpingAdventure/JumpingAdventure/JumpingAdventure/JumpingAdventure.cs
r8646 r8658 9 9 public class JumpingAdventure : PhysicsGame 10 10 { 11 PhysicsObject janis;11 PhysicsObject spaceship; 12 12 public override void Begin() 13 13 { 14 janis = new PhysicsObject(50.0, 50.0, Shape.Circle); 15 janis.X = 200.0; 16 janis.Y = 400.0; 17 janis.Color = Color.Beige; 18 Add (janis); 14 spaceship = new PhysicsObject(30.0, 70.0, Shape.Star); 15 spaceship.X = 200.0; 16 spaceship.Y = 400.0; 17 spaceship.Color = Color.Fuchsia; 18 spaceship.AngularVelocity = 10.0; 19 Add (spaceship); 20 21 spaceship.CanRotate = false; 19 22 20 23 Level.Background.CreateStars(100000); 21 24 22 Surface alaReuna = Surface.CreateBottom(Level, 30, 100, 40); 23 Add(alaReuna); 24 Surface ylaReuna = Surface.CreateTop(Level, 20, 60, 110); 25 Add(ylaReuna); 26 Surface vasenReuna = Surface.CreateLeft(Level, 40, 150, 80); 27 Add(vasenReuna); 28 Surface oikeaReuna = Surface.CreateRight(Level, 50, 10, 170); 29 Add(oikeaReuna); 25 Level.CreateBorders(false); 30 26 31 27 Keyboard.Listen(Key.Left, ButtonState.Down, LiikutaPelaajaa, null, new Vector(-1000, 0)); … … 41 37 void LiikutaPelaajaa(Vector vektori) 42 38 { 43 janis.Push(vektori);39 spaceship.Push(vektori); 44 40 } 45 41 void PysaytaPelaaja(Vector vektori) 46 42 { 47 janis.Velocity = Vector.Zero;43 spaceship.Velocity = Vector.Zero; 48 44 } 49 45 }
Note: See TracChangeset
for help on using the changeset viewer.