Revision 6642,
1.3 KB
checked in by eemikone, 8 years ago
(diff) |
villelelel
|
Line | |
---|
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 infected : PhysicsGame |
---|
10 | { |
---|
11 | PhysicsObject mies; |
---|
12 | Image mieskuva = LoadImage("hahmon kuva"); |
---|
13 | |
---|
14 | public override void Begin() |
---|
15 | { |
---|
16 | LuoKentta(); |
---|
17 | |
---|
18 | Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); |
---|
19 | } |
---|
20 | void LuoHahmo(Vector paikka, double leveys, double korkeus) |
---|
21 | { |
---|
22 | mies = new PhysicsObject(mieskuva); |
---|
23 | mies.Size = new Vector(50, 50); |
---|
24 | mies.Position = paikka; |
---|
25 | Add(mies); |
---|
26 | } |
---|
27 | void LuoKentta() |
---|
28 | { |
---|
29 | ColorTileMap mappi = ColorTileMap.FromLevelAsset("mappi"); |
---|
30 | mappi.SetTileMethod(Color.Black, LuoTaso); |
---|
31 | mappi.SetTileMethod(Color.Red, LuoHahmo); |
---|
32 | mappi.Execute(40, 40); |
---|
33 | |
---|
34 | Level.CreateBorders(); |
---|
35 | Camera.Follow(); |
---|
36 | Camera.Zoom(1.0); |
---|
37 | } |
---|
38 | |
---|
39 | void LuoTaso(Vector paikka, double leveys, double korkeus) |
---|
40 | { |
---|
41 | PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); |
---|
42 | taso.Position = paikka; |
---|
43 | taso.Color = Color.Black; |
---|
44 | //taso.Image = groundImage; |
---|
45 | taso.CollisionIgnoreGroup = 1; |
---|
46 | Add(taso); |
---|
47 | } |
---|
48 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.