- Timestamp:
- 2016-06-07 15:46:05 (7 years ago)
- Location:
- 2016/23/ohjaajat/Punasininen/Punasininen
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
2016/23/ohjaajat/Punasininen/Punasininen/Punasininen/Player.cs
r7188 r7189 9 9 public class Player : PlatformCharacter2 10 10 { 11 12 11 public Player(double leveys, double korkeus, Image pic, Color color) 13 12 : base(leveys, korkeus) … … 15 14 Image = pic; 16 15 Color = color; 16 CanRotate = false; 17 17 18 Mass = 10.0; 18 Tag = "player"; 19 Acceleration = 5000; 20 19 21 } 20 22 } -
2016/23/ohjaajat/Punasininen/Punasininen/Punasininen/Punasininen.cs
r7188 r7189 48 48 PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 49 49 taso.Position = paikka; 50 taso.Color = Color.Green; 50 taso.Color = Color.Black; 51 AddCollisionHandler(taso, "player", Varjaa); 51 52 Add(taso); 52 53 } … … 59 60 return player; 60 61 62 } 63 64 void Varjaa(PhysicsObject platform, PhysicsObject player) 65 { 66 platform.Color = player.Color; 61 67 } 62 68 … … 79 85 void Move(AnalogState stick, Player player) 80 86 { 87 /*Vector state = stick.StateVector; 88 player.Walk(state.X * 500);*/ 89 81 90 if (stick.StateVector.Magnitude > 0.15) 82 91 player.Walk(stick.StateVector.X > 0 ? Direction.Right : Direction.Left);
Note: See TracChangeset
for help on using the changeset viewer.