예제 #1
0
        void ScaleRenderer(double scale)
        {
            HugeBawls.ScaleRenderer(scale);

            tbRenderer.Value = (int)(tbRenderer.Maximum / scale);

            txtRenderer.Text = String.Format("{0}", HugeBawls.RenderRegulator.Interval());
        }
예제 #2
0
        void ScaleUpdate(double scale)
        {
            HugeBawls.ScaleUpdate(scale);

            tbUpdate.Value = (int)(tbUpdate.Maximum / scale);

            txtUpdate.Text = String.Format("{0}", HugeBawls.UpdateRegulator.Interval());
        }
예제 #3
0
        public static void ScaleRenderer(double scale)
        {
            HugeBawls.Pause();

            s_RenderRegulator.Disable();

            s_RenderRegulator.Dispose();

            s_RenderRegulator = new Regulator((int)(Settings.PeriodRender * scale));

            HugeBawls.Run();
        }
예제 #4
0
        public static void ScaleUpdate(double scale)
        {
            HugeBawls.Pause();

            s_UpdateRegulator.Disable();

            s_UpdateRegulator.Dispose();

            s_UpdateRegulator = new Regulator((int)(Settings.PeriodUpdate * scale));

            HugeBawls.Run();
        }
예제 #5
0
 private void btnPlayPause_Click(object sender, EventArgs e)
 {
     if (HugeBawls.Running)
     {
         HugeBawls.Pause();
         btnPlayPause.Text = "&Play";
     }
     else
     {
         HugeBawls.Run();
         btnPlayPause.Text = "Sto&p";
     }
 }
예제 #6
0
파일: World.cs 프로젝트: rootd00d/hugebawls
        public static void InitializePartitions()
        {
            s_Partitions = new Partition <Vehicle> [s_NumPartitions, s_NumPartitions];

            for (int i = 0; i < s_NumPartitions; i++)
            {
                for (int j = 0; j < s_NumPartitions; j++)
                {
                    s_Partitions[i, j] =
                        new Partition <Vehicle>(i, j, s_PartitionSizeI, s_PartitionSizeJ);
                }
            }

            VisibleEntities = new Dictionary <string, List <Vehicle> >();

            foreach (Type type in HugeBawls.GetTypes("HugeBawls.Entities"))
            {
                VisibleEntities.Add(
                    type.Name,
                    new List <Vehicle>(Settings.NumEntities / (Settings.WorldPartitions * Settings.WorldPartitions)));
            }
        }
예제 #7
0
        public UI()
        {
            InitializeComponent();

            s_TextBox = txtConsole;

            this.SetStyle(
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.UserPaint |
                ControlStyles.DoubleBuffer, true);

            Initialize();

            HugeBawls.Initialize();

            SetDefaults();

            InitializeToolbox();

            s_Pointer = new Entities.Pointer(this, btnCursor.Image);

            pbxMain.Cursor = s_Pointer.CursorFromImage(btnCursor.Image);
        }
예제 #8
0
        private void tlsRandomize_Click(object sender, EventArgs e)
        {
            HugeBawls.Reset();

            HugeBawls.Randomize();
        }
예제 #9
0
        private void btnClear_Click(object sender, EventArgs e)
        {
            HugeBawls.Reset();

            txtConsole.Clear();
        }
예제 #10
0
 private void timerMain_Tick(object sender, EventArgs e)
 {
     HugeBawls.Update((double)timerMain.Interval);
 }