Esempio n. 1
0
 public GameScreen_MenuScreen(MotorkiGame game)
 {
     this.game = game;
     oResult = null;
     iResult = MenuReturnCodes.Error;
     OnExit = null;
 }
Esempio n. 2
0
 /// <param name="motorID">index in gameMotors table of the leading bike for UI</param>
 public GameScreen_GameUI(MotorkiGame game, int motorID, int width, int height)
     : base(game)
 {
     this.motorID = motorID;
     this.width = width;
     this.height = height;
 }
Esempio n. 3
0
 public UILabel(MotorkiGame game)
     : base(game)
 {
     ControlType = UIControlType.UILabel;
     AutoSize = true;
     fontColor = Color.Black;
 }
Esempio n. 4
0
 public UIButton(MotorkiGame game)
     : base(game)
 {
     ControlType = UIControlType.UIButton;
     State = UIButtonState.Normal;
     Action = null;
     InputEvents.MouseMoved += InputEvents_MouseMoved;
     InputEvents.MouseLeftChanged += InputEvents_MouseLeftChanged;
 }
Esempio n. 5
0
 public UIKeyPicker(MotorkiGame game)
     : base(game)
 {
     ControlType = UIControlType.UIKeyPicker;
     State = UIKeyPickerState.Normal;
     KeyChanged = null;
     InputEvents.KeyPressed += InputEvents_KeyPressed;
     InputEvents.MouseMoved += InputEvents_MouseMoved;
     InputEvents.MouseLeftChanged += InputEvents_MouseLeftChanged;
 }
Esempio n. 6
0
 public UIParent(MotorkiGame game)
 {
     if (UI != null)
         throw new UIParentExistsException();
     UI = this;
     this.game = game;
     drawRequests = new List<UIDrawRequest>();
     InputEvents.KeyPressed += InputEvents_KeyPressed;
     defaultTextures = game.Content.Load<Texture2D>("UIdefaulttextures");
     defaultFont = game.Content.Load<SpriteFont>("UIdefaultfont");
     ESCHook = null;
 }
Esempio n. 7
0
 public UICheckBox(MotorkiGame game)
     : base(game)
 {
     ControlType = UIControlType.UICheckBox;
     button = new UIButton(game);
     label = new UILabel(game);
     CheckChanged = null;
     check = false;
     button.Action += (UIButton_Action)((btn) =>
     {
         Checked = !Checked;
     });
 }
Esempio n. 8
0
 public UIScrollBar(MotorkiGame game, bool vertical = true)
     : base(game)
 {
     ControlType = UIControlType.UIScrollBar;
     orientation = vertical;
     btnMinus = new UIScrollBarButton(game, this, false);
     btnPlus = new UIScrollBarButton(game, this, true);
     thumb = new UIScrollBarThumb(game, this);
     ValueChanged = null;
     PositionAndSize = new Rectangle(0, 0, 0, 0);
     InputEvents.MouseMoved += InputEvents_MouseMoved;
     InputEvents.MouseLeftChanged += InputEvents_MouseLeftChangedOrRepeat;
     InputEvents.MouseLeftRepeat += InputEvents_MouseLeftChangedOrRepeat;
 }
Esempio n. 9
0
        public BotMotor(MotorkiGame game, Color motorColor)
            : base(game, motorColor, new Color(255 - motorColor.R, 255 - motorColor.G, 255 - motorColor.B))
        {
            int a = MotorkiGame.random.Next(1000);
            for (int i = 0; i < a * 1000; i++)
                a = (a + a - a) * a / a;

            cmd = new int[2]; //0 - forward/backward, 1 - left/right
            cmd_time = new int[2];
            cmd_time[0] = 0;
            cmd_time[1] = 0;

            sophistication = BotSophistication.Easy;
        }
Esempio n. 10
0
        public BotMotor(MotorkiGame game, Color motorColor, BotSophistication sophistication = BotSophistication.Easy)
            : base(game, motorColor, new Color(255 - motorColor.R, 255 - motorColor.G, 255 - motorColor.B))
        {
            //do some randomization
            int a = MotorkiGame.random.Next(1000);
            for (int i = 0; i < a * 1000; i++)
                a = (a + a - a) * a / a;

            cmd = new int[2]; //0 - brakes active/inactive, 1 - forward/left/right
            cmd_time = new int[2];
            cmd_time[0] = 0;
            cmd_time[1] = 0;

            this.sophistication = sophistication;
        }
Esempio n. 11
0
 public UITextBox(MotorkiGame game)
     : base(game)
 {
     ControlType = UIControlType.UITextBox;
     Text = "";
     PasswordChar = '\0';
     TextLenghtLimit = -1;
     CursorPos = -1;
     FirstVisibleChar = 0;
     Hilited = false;
     lastMouseOver = false;
     InputEvents.MouseMoved += InputEvents_MouseMoved;
     InputEvents.MouseLeftChanged += InputEvents_MouseLeftChanged;
     InputEvents.KeyPressed += InputEvents_KeyPressedOrRepeated;
     InputEvents.KeyRepeated += InputEvents_KeyPressedOrRepeated;
 }
Esempio n. 12
0
 /// <summary>
 /// loads map parameters from file
 /// </summary>
 public Map(MotorkiGame game, string filename)
 {
     this.game = game;
     Parameters = new MapParameters(filename);
     Points = new List<MapPoint>();
     Edges = new List<MapEdge>();
     SpawnPoints = new List<MapSpawnPoint>();
     SpawnInUse = new List<bool>();
     Sectors = new List<MapSector>();
     Rects = new List<MapRect>();
     Slices = new MapSlice[(int)(Parameters.Size.X / Parameters.Slicing.X + (Parameters.Size.X % Parameters.Slicing.X != 0.0f ? 1.0f : 0.0f)),
                           (int)(Parameters.Size.Y / Parameters.Slicing.Y + (Parameters.Size.Y % Parameters.Slicing.Y != 0.0f ? 1.0f : 0.0f))];
     for (int x = 0; x < Slices.GetLength(0); x++)
         for (int y = 0; y < Slices.GetLength(1); y++)
             Slices[x, y] = null;
 }
Esempio n. 13
0
 public GameScreen_Main(MotorkiGame game)
     : base(game)
 {
 }
Esempio n. 14
0
            private bool plusButton; //true - plus button, false - minus button

            #endregion Fields

            #region Constructors

            public UIScrollBarButton(MotorkiGame game, UIScrollBar parent, bool plusButton)
                : base(game)
            {
                ControlType = UIControlType.UIScrollBarButton;
                Parent = parent;
                State = UIButtonState.Normal;
                IsPlusButton = plusButton;
            }
Esempio n. 15
0
 /// <param name="iPlayerID">0 - player, -1 - empty slot for network player</param>
 /// <param name="framingRect">map limits</param>
 public PlayerMotor(MotorkiGame game, int iPlayerID, Color motorColor)
     : base(game, motorColor, new Color(255 - motorColor.R, 255 - motorColor.G, 255 - motorColor.B))
 {
     this.iPlayerID = iPlayerID;
 }
Esempio n. 16
0
 public MapSlice(MotorkiGame game, Rectangle posandsize)
 {
     PositionAndSize = posandsize;
     picture = new RenderTarget2D(game.GraphicsDevice, PositionAndSize.Width, PositionAndSize.Height, false, SurfaceFormat.Color, DepthFormat.None, 1, RenderTargetUsage.PreserveContents);
 }
Esempio n. 17
0
 public UIScrollBarThumb(MotorkiGame game, UIScrollBar parent)
     : base(game)
 {
     ControlType = UIControlType.UIScrollBarThumb;
     Parent = parent;
     State = UIButtonState.Normal;
 }
Esempio n. 18
0
 public UIImage(MotorkiGame game)
     : base(game)
 {
     ControlType = UIControlType.UIImage;
 }
Esempio n. 19
0
 public GameScreen_JoinGame(MotorkiGame game)
     : base(game)
 {
 }
Esempio n. 20
0
 public UIProgress(MotorkiGame game)
     : base(game)
 {
     ControlType = UIControlType.UIProgress;
     percent = 0;
 }
Esempio n. 21
0
 /// <param name="subscreen">0 - game settings, 1 - game slots settings</param>
 public GameScreen_NewGame(MotorkiGame game, int subscreen = 0)
     : base(game)
 {
     this.subscreen = subscreen;
 }
Esempio n. 22
0
 /// <param name="subscreen">values: -1 - main, 0 - player, 1 - video, 2 - audio, 3 - common</param>
 public GameScreen_Options(MotorkiGame game, int subscreen = -1)
     : base(game)
 {
     this.subscreen = subscreen;
 }
Esempio n. 23
0
 public UIControl(MotorkiGame game)
 {
     this.game = game;
     if (UIParent.UI == null)
         throw new UIParentNotExistsException();
     ControlType = UIControlType.UIControl;
     isLoaded = false;
     enabled = true;
     visible = true;
     name = "";
     text = "";
     layerDepth = 1;
     PosAndSize = new Rectangle(0, 0, 0, 0);
 }