source: 2014/30/MiskaK/SeesObjectTest/SeesObjectTest/SeesObjectTest/SeesObjectTest.cs @ 5515

Revision 5515, 963 bytes checked in by anlakane, 7 years ago (diff)
Line 
1using System;
2using System.Collections.Generic;
3using Jypeli;
4using Jypeli.Assets;
5using Jypeli.Controls;
6using Jypeli.Effects;
7using Jypeli.Widgets;
8
9public 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.