1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using Jypeli; |
---|
4 | using Jypeli.Assets; |
---|
5 | using Jypeli.Controls; |
---|
6 | using Jypeli.Effects; |
---|
7 | using Jypeli.Widgets; |
---|
8 | |
---|
9 | public class LABYRINTTI : PhysicsGame |
---|
10 | { |
---|
11 | Image olionKuva = LoadImage("hirviötekstuuri"); |
---|
12 | |
---|
13 | const double RUUDUN_LEVEYS = 50.0; |
---|
14 | const double RUUDUN_KORKEUS = 50.0; |
---|
15 | |
---|
16 | public override void Begin() |
---|
17 | { |
---|
18 | //PhysicsObject mob = new PhysicsObject(500,400); |
---|
19 | //Add(mob); |
---|
20 | //mob.Image = olionKuva; |
---|
21 | // TODO: Kirjoita ohjelmakoodisi tähän |
---|
22 | |
---|
23 | |
---|
24 | Level.Background.Color = Color.Maroon; |
---|
25 | |
---|
26 | |
---|
27 | Keyboard.Listen(Key.D, ButtonState.Down, |
---|
28 | LiikutaPelaajaa, null, new Vector(1000, 0)); |
---|
29 | Keyboard.Listen(Key.A, ButtonState.Down, |
---|
30 | LiikutaPelaajaa, null, new Vector(-1000, 0)); |
---|
31 | Keyboard.Listen(Key.W, ButtonState.Down, |
---|
32 | LiikutaPelaajaa, null, new Vector(0, 1000)); |
---|
33 | Keyboard.Listen(Key.S, ButtonState.Down, |
---|
34 | LiikutaPelaajaa, null, new Vector(0, -1000)); |
---|
35 | |
---|
36 | |
---|
37 | Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); |
---|
38 | } |
---|
39 | void LuoKentta() |
---|
40 | { |
---|
41 | ColorTileMap ruudut = ColorTileMap.FromLevelAsset("labyrintinkenttä"); |
---|
42 | ruudut.SetTileMethod(Color.Black, LuoSeinä); |
---|
43 | ruudut.Execute(RUUDUN_LEVEYS, RUUDUN_KORKEUS); |
---|
44 | } |
---|
45 | void LuoSeinä(Vector paikka, double leveys, double korkeus) |
---|
46 | { |
---|
47 | |
---|
48 | } |
---|
49 | |
---|
50 | |
---|
51 | void LiikutaPelaajaa(Vector vektori) |
---|
52 | { |
---|
53 | |
---|
54 | pelaaja1.Push(vektori); |
---|
55 | } |
---|
56 | |
---|
57 | } |
---|
58 | // TODO: Kirjoita ohjelmakoodisi tähän |
---|
59 | |
---|
60 | |
---|
61 | |
---|
62 | |
---|
63 | |
---|
64 | |
---|