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 SeesObjectTest : PhysicsGame |
---|
10 | { |
---|
11 | public override void Begin() |
---|
12 | { |
---|
13 | // TODO: Kirjoita ohjelmakoodisi tähän |
---|
14 | |
---|
15 | PhysicsObject target = new PhysicsObject(10.0, 10.0); |
---|
16 | target.Color = Color.Black; |
---|
17 | Add(target); |
---|
18 | |
---|
19 | PhysicsObject obstacle = new PhysicsObject(100.0, 100.0); |
---|
20 | obstacle.Position = new Vector(0.0, -150.0); |
---|
21 | obstacle.Color = Color.Black; |
---|
22 | Add(obstacle); |
---|
23 | |
---|
24 | Mouse.Listen(MouseButton.Left, ButtonState.Pressed, delegate { MessageDisplay.Add(target.SeesTarget(Mouse.PositionOnWorld).ToString()); }, null); |
---|
25 | Mouse.IsCursorVisible = true; |
---|
26 | PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); |
---|
27 | Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); |
---|
28 | } |
---|
29 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.