Changeset 8584 for 2017/24


Ignore:
Timestamp:
2017-06-13 13:07:38 (6 years ago)
Author:
npo17_17
Message:
 
Location:
2017/24/TomasM/SpaceInvanders/SpaceInvanders/SpaceInvanders
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • 2017/24/TomasM/SpaceInvanders/SpaceInvanders/SpaceInvanders/SpaceInvanders.cs

    r8567 r8584  
    99public class SpaceInvanders : PhysicsGame 
    1010{ 
     11 
    1112    PhysicsObject pelaaja; 
     13    PhysicsObject Pahis; 
    1214    public override void Begin() 
    1315    { 
    1416        // TODO: Kirjoita ohjelmakoodisi tähän 
    1517        LuoPelaaja(); 
     18        LuoPahis(); 
     19       
    1620        Level.Background.Image = LoadImage ("tahtitaivas"); 
    1721        Level.Background.Size = Screen.Size; 
     22        Level.CreateBorders(); 
    1823 
    1924        Keyboard.Listen(Key.Left, ButtonState.Down, LiikutaPelaajaa, null, new Vector(-1000, 0)); 
     
    2227        Keyboard.Listen(Key.Down, ButtonState.Down, LiikutaPelaajaa, null, new Vector(0, -1000)); 
    2328 
     29 
     30 
     31 
     32 
    2433        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
    2534    } 
    2635    void LiikutaPelaajaa(Vector suunta) 
    2736    { 
     37 
    2838        pelaaja.Move(suunta); 
    2939        pelaaja.Angle = suunta.Angle - Angle.RightAngle; 
     40 
     41        
    3042    } 
    3143    void LuoPelaaja() 
     
    3446        pelaaja = new PhysicsObject(75.0, 75.0); 
    3547        pelaaja.Image = LoadImage("avaruusalus"); 
     48 
     49         
     50 
     51 
    3652        Add(pelaaja); 
     53 
     54 
     55 
     56        
     57 
    3758    } 
     59     
     60 
     61       void LuoPahis(Vector paikka) 
     62    { 
     63        Pahis = new PhysicsObject(75.0, 75.0); 
     64 
     65 
     66 
     67    } 
     68 
     69   
     70     
    3871} 
Note: See TracChangeset for help on using the changeset viewer.