source: 2010/30/jumakall/The_Bus_Game_codetesting/Peli.cs @ 1363

Revision 1363, 1.1 KB checked in by jumakall, 13 years ago (diff)

Räjähdys -sovellus lisätty
The Bus Gamen osoitin lisätty

Line 
1using System;
2using Jypeli;
3using Jypeli.Widgets;
4using Jypeli.Assets;
5
6public class Peli : PhysicsGame
7{
8
9    PhysicsObject osoitin;
10
11    protected override void Begin()
12    {
13        osoitin = LuoOsoitin();
14        Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, "Sulje");
15    }
16
17    protected override void Update(Time time)
18    {
19        base.Update(time);
20        if (osoitin != null)
21        {
22            osoitin.X = Mouse.PositionOnScreen.X;
23            osoitin.Y = Mouse.PositionOnScreen.Y;
24        }
25
26    }
27
28
29    PhysicsObject LuoOsoitin()
30    {
31        PhysicsObject osoitin = new PhysicsObject(10.0, 10.0);
32        osoitin.Shape = Shapes.Circle;
33        osoitin.Color = Color.White;
34        osoitin.X = Mouse.PositionOnScreen.X;
35        osoitin.Y = Mouse.PositionOnScreen.Y;
36        osoitin.Restitution = 1.0;
37
38        osoitin.IgnoresCollisionResponse = true;
39        osoitin.IgnoresGravity = true;
40        osoitin.IgnoresPhysicsLogics = true;
41        osoitin.IgnoresExplosions = true;
42
43        Add(osoitin);
44
45        return osoitin;
46    }
47}
Note: See TracBrowser for help on using the repository browser.