source: 2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/Player.cs @ 2218

Revision 2218, 763 bytes checked in by teeevasa, 8 years ago (diff)
RevLine 
[2203]1using System;
2using Jypeli;
3using Jypeli.Assets;
4using Jypeli.Controls;
5using Jypeli.Effects;
6using Jypeli.Widgets;
7
[2205]8public class Player : GenCharacter
[2203]9{
[2206]10    const int speed = 200;
11
[2203]12        public Player(double width, double height, Shape shape)
13        : base(width, height, shape)
14        {
[2206]15        hitPoints = 100;
16        addControls();
17        }
[2205]18
[2206]19    public void addControls()
20    {
[2209]21        //Keyboard.Listen(Key.Right, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus);
[2217]22        Game.Keyboard.Listen(Key.Right, ButtonState.Down, moveRight, "Moves right", speed);
[2206]23    }
[2209]24
25    public void moveRight(int speed)
26    {
27        this.Walk(speed);
28    }
[2218]29
30    public void moveLeft(int speed)
31    {
32        this.Walk(-speed);
33    }
34
[2203]35}
Note: See TracBrowser for help on using the repository browser.