Go to the documentation of this file.00001 using System;
00002 using System.Collections.Generic;
00003 using Jypeli;
00004 using Jypeli.Assets;
00005 using Jypeli.Controls;
00006 using Jypeli.Effects;
00007 using Jypeli.Widgets;
00008
00009
00010
00011
00012
00013
00014 public class Lumiukko : PhysicsGame
00015 {
00016
00017
00018
00019 public override void Begin()
00020 {
00021 Level.BackgroundColor = Color.Black;
00022 Level.Size = Screen.Size;
00023 Camera.ZoomToLevel();
00024 Level.CreateBorders();
00025
00026 PhysicsObject p1 = new PhysicsObject(2 * 100.0, 2 * 100.0, Shape.Circle);
00027 p1.Y = Level.Bottom + 200.0;
00028 Add(p1);
00029
00030 PhysicsObject p2 = new PhysicsObject(2 * 50.0, 2 * 50.0, Shape.Circle);
00031 p2.Y = p1.Y + 100 + 50;
00032 Add(p2);
00033
00034 PhysicsObject p3 = new PhysicsObject(2 * 30.0, 2 * 30.0, Shape.Circle);
00035 p3.Y = p2.Y + 50 + 30;
00036 Add(p3);
00037
00038
00039
00040
00041 Gravity = new Vector(0, -400);
00042
00043 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli");
00044 Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, "Lopeta peli");
00045
00046
00047 Keyboard.Listen(Key.Left, ButtonState.Pressed, LyoPalloa, "Lyö yläpalloa vasemmalle", p3, new Vector(-1000, 0));
00048 Keyboard.Listen(Key.Tab, ButtonState.Pressed, LyoPalloa, "Lyö alapalloa oikealle", p1, new Vector(1000, 0));
00049 Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, "Avustus");
00050
00051 }
00052
00053
00054
00055
00056
00057
00058
00059 public static void LyoPalloa(PhysicsObject pallo, Vector suunta)
00060 {
00061 pallo.Hit(suunta);
00062 }
00063 }