source: 2013/27/LeoL/Hounted Hause/Hounted Hause/Hounted Hause/Hounted_Hause.cs @ 4349

Revision 4349, 1.2 KB checked in by leoliukk, 10 years ago (diff)

Talletus.

Line 
1using System;
2using System.Collections.Generic;
3using Jypeli;
4using Jypeli.Assets;
5using Jypeli.Controls;
6using Jypeli.Effects;
7using Jypeli.Widgets;
8
9public class Hounted_Hause : PhysicsGame
10{
11    Image PelaajaKuva = LoadImage("Char");
12
13    public override void Begin()
14    {
15        PhysicsObject pelaaja = new PhysicsObject(40, 40);
16        pelaaja.Image = PelaajaKuva;
17        pelaaja.Shape = Shape.Rectangle;
18        Add(pelaaja);
19
20        Camera.Follow(pelaaja);
21        Camera.ZoomFactor = 4.0;
22
23        ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, LiikutaPelaajaa, null, new Vector(-1000, 0), pelaaja);
24        ControllerOne.Listen(Button.DPadRight, ButtonState.Down, LiikutaPelaajaa, null, new Vector(1000, 0), pelaaja);
25        ControllerOne.Listen(Button.DPadUp, ButtonState.Down, LiikutaPelaajaa, null, new Vector(0, 1000), pelaaja);
26        ControllerOne.Listen(Button.DPadDown, ButtonState.Down, LiikutaPelaajaa, null, new Vector(0, -1000), pelaaja);
27
28        PhoneBackButton.Listen(ConfirmExit, "Lopeta peli");
29        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli");
30    }
31
32    void LiikutaPelaajaa(Vector vektori, PhysicsObject pelaaja)
33    {
34        pelaaja.Push(vektori);
35    }
36}
Note: See TracBrowser for help on using the repository browser.