Changeset 5260 for 2014/27


Ignore:
Timestamp:
2014-07-02 09:46:22 (5 years ago)
Author:
mijoilmo
Message:
 
Location:
2014/27/AleksanteriV/Protokolla236TrueSurvivor
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • 2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Player.cs

    r5256 r5260  
    99public class Player : PhysicsObject 
    1010{ 
     11    public void rotate(double rotSpeed) 
     12 
    1113    GameObject thrusterEffect; 
    1214    public void rotate(double rotSpeed) 
     15 
     16 
    1317    { 
     18 
    1419        this.AngularVelocity = rotSpeed; 
    1520    } 
     21    public void throttle() 
    1622    public void thrusterStart(double speed) 
    1723    { 
     24        this.Push(Vector.FromLengthAndAngle(100, this.Angle + Angle.RightAngle)); 
    1825        this.thrusterEffect.IsVisible = true; 
    1926        this.Push(Vector.FromLengthAndAngle(speed*800, this.Angle + Angle.RightAngle)); 
    2027    } 
     28    public Player() 
    2129    public void thrusterEnd() 
    2230    { 
     
    2533    } 
    2634    public Player() 
    27         : base(40, 40) 
    28     { 
    29         this.Image = Proto236b.images["player"]; 
    30         bool IDS = true; //inertial dampening system, katsotaan pistetäänkö ostettavaksi peliin 
    31         if (IDS == true) 
    32         { 
    33             this.LinearDamping = 0.97; 
    34         } 
    35         else 
    36         { 
    37             this.LinearDamping = 1; 
    38         } 
    39         this.AngularDamping = 0.7; 
    40  
    41         this.thrusterEffect = new GameObject(40,40); 
    42         thrusterEffect.Image = Proto236b.images["player_thruster"]; 
    43         thrusterEffect.IsVisible = false; 
    44         thrusterEffect.Y -= 20; 
    45         Add(thrusterEffect); 
    46     } 
    47 } 
  • 2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor.cs

    r5256 r5260  
    1616    { 
    1717        Keyboard.Listen(Key.Escape, ButtonState.Down, Exit, "Lopeta Peli"); 
     18        Keyboard.Listen(Key.Up, ButtonState.Down, player.throttle, "Lento"); 
     19 
     20 
     21 
    1822        Keyboard.Listen(Key.Up, ButtonState.Down, player.thrusterStart, "Lento", 1.0); 
    1923        Keyboard.Listen(Key.Up, ButtonState.Up, player.thrusterEnd, "Lento"); 
     
    2529    void LoadAllImages() 
    2630    { 
     31        images["background0"] = LoadImage("graphics/backgrounds/space_background"); 
     32        images["player"] = LoadImage("graphics/ships/player"); 
     33        images["tile0"] = LoadImage("graphics/tiles/tile0.png"); 
    2734        images["background0"] =                 LoadImage("graphics/backgrounds/space_background"); 
    2835        images["player"] =                      LoadImage("graphics/ships/player"); 
     
    3037        images["tile0"] =                       LoadImage("graphics/tiles/tile0.png"); 
    3138    } 
     39    void LoadLevel(int level) 
    3240    void LoadLevel(string level) 
    3341    { 
     
    4351        tileMap.SetTileMethod(Color.FromHexCode("000000"), createTile, ""); 
    4452        tileMap.SetTileMethod(Color.FromHexCode("ff0000"), spawnPlayer); 
     53        tileMap.Execute(20,20); 
    4554        tileMap.Execute(40,40); 
    4655    } 
     
    6574        LoadAllImages(); 
    6675        this.player = new Player(); 
     76        LoadLevel(0); 
    6777        LoadLevel("test"); 
    6878    } 
  • 2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/obj/x86/Debug/ContentPipeline-{5156C658-EF8C-4216-BA6D-9928D133FE72}.xml

    r5224 r5260  
    1818      <Options>None</Options> 
    1919      <Output>C:\MyTemp\AleksanteriV\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\bin\x86\Debug\Content\graphics\levels\0.xnb</Output> 
    20       <Time>2014-07-01T12:28:07.7470428+03:00</Time> 
     20      <Time>2014-07-01T14:56:17.7711213+03:00</Time> 
    2121    </Item> 
    2222    <Item> 
Note: See TracChangeset for help on using the changeset viewer.