Changeset 7189 for 2016


Ignore:
Timestamp:
2016-06-07 15:46:05 (3 years ago)
Author:
jotapoti
Message:

pelaajan liikkumista säädetty

Location:
2016/23/ohjaajat/Punasininen/Punasininen
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • 2016/23/ohjaajat/Punasininen/Punasininen/Punasininen/Player.cs

    r7188 r7189  
    99public class Player : PlatformCharacter2 
    1010{ 
    11  
    1211    public Player(double leveys, double korkeus, Image pic, Color color) 
    1312        : base(leveys, korkeus) 
     
    1514        Image = pic; 
    1615        Color = color; 
     16        CanRotate = false; 
    1717 
    18         Mass = 10.0; 
     18        Tag = "player"; 
     19        Acceleration = 5000; 
     20 
    1921    } 
    2022} 
  • 2016/23/ohjaajat/Punasininen/Punasininen/Punasininen/Punasininen.cs

    r7188 r7189  
    4848        PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 
    4949        taso.Position = paikka; 
    50         taso.Color = Color.Green; 
     50        taso.Color = Color.Black; 
     51        AddCollisionHandler(taso, "player", Varjaa); 
    5152        Add(taso); 
    5253    } 
     
    5960        return player; 
    6061 
     62    } 
     63 
     64    void Varjaa(PhysicsObject platform, PhysicsObject player) 
     65    { 
     66        platform.Color = player.Color;  
    6167    } 
    6268 
     
    7985    void Move(AnalogState stick, Player player) 
    8086    { 
     87        /*Vector state = stick.StateVector; 
     88        player.Walk(state.X * 500);*/ 
     89         
    8190        if (stick.StateVector.Magnitude > 0.15) 
    8291            player.Walk(stick.StateVector.X > 0 ? Direction.Right : Direction.Left); 
Note: See TracChangeset for help on using the changeset viewer.