Line | |
---|
1 | using System; |
---|
2 | using Jypeli; |
---|
3 | using Jypeli.Assets; |
---|
4 | using Jypeli.Controls; |
---|
5 | using Jypeli.Effects; |
---|
6 | using Jypeli.Widgets; |
---|
7 | |
---|
8 | public class Player : GenCharacter |
---|
9 | { |
---|
10 | const int speed = 200; |
---|
11 | |
---|
12 | public Player(double width, double height, Shape shape) |
---|
13 | : base(width, height, shape) |
---|
14 | { |
---|
15 | hitPoints = 100; |
---|
16 | addControls(); |
---|
17 | } |
---|
18 | |
---|
19 | public void addControls() |
---|
20 | { |
---|
21 | //Keyboard.Listen(Key.Right, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); |
---|
22 | Game.Keyboard.Listen(Key.Right, ButtonState.Down, moveRight, "Moves right", speed); |
---|
23 | } |
---|
24 | |
---|
25 | public void moveRight(int speed) |
---|
26 | { |
---|
27 | this.Walk(speed); |
---|
28 | } |
---|
29 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.