Changeset 8658


Ignore:
Timestamp:
2017-06-14 13:02:58 (2 years ago)
Author:
npo17_13
Message:
 
Location:
2017/24/SebastianH/JumpingAdventure/JumpingAdventure/JumpingAdventure
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • 2017/24/SebastianH/JumpingAdventure/JumpingAdventure/JumpingAdventure/JumpingAdventure.cs

    r8646 r8658  
    99public class JumpingAdventure : PhysicsGame 
    1010{ 
    11     PhysicsObject janis; 
     11    PhysicsObject spaceship; 
    1212    public override void Begin() 
    1313    { 
    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; 
    1922 
    2023        Level.Background.CreateStars(100000); 
    2124 
    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); 
    3026 
    3127        Keyboard.Listen(Key.Left, ButtonState.Down, LiikutaPelaajaa, null, new Vector(-1000, 0)); 
     
    4137    void LiikutaPelaajaa(Vector vektori) 
    4238    { 
    43         janis.Push(vektori); 
     39        spaceship.Push(vektori); 
    4440    } 
    4541    void PysaytaPelaaja(Vector vektori) 
    4642    { 
    47         janis.Velocity = Vector.Zero; 
     43        spaceship.Velocity = Vector.Zero; 
    4844    } 
    4945} 
Note: See TracChangeset for help on using the changeset viewer.