Example #1
0
 public DeclareVarBlock() : base(BlockType.DECLAREVAR)
 {
     _panel = new Blocky.Blocks.Controls.PDeclareVarBlock();
 }
Example #2
0
 private void Start()
 {
     blockPanel = GameObject.Find("BlockPanel").GetComponent <BlockPanel>();
 }
Example #3
0
 private void Start()
 {
     _grid       = GameObject.FindGameObjectWithTag("BlockGrid").GetComponent <BlockGrid>();
     _blockPanel = GetComponentInParent <BlockPanel>();
 }
Example #4
0
 private void Start()
 {
     panel = FindObjectOfType <BlockPanel>();
     transform.position = menu;
 }
Example #5
0
 public EntryBlock() : base(BlockType.ENTRY)
 {
     _panel = new Blocky.Blocks.Controls.PEntryBlock();
 }
Example #6
0
 public bool IsCollided(Pingpong ball, BlockPanel blockPanel)
 {
     return(ball.VerticalCoordinate + ball.Height > blockPanel.VerticalCoordiante && ball.HorizontalCoordinate + ball.Width / 2 >= blockPanel.HorizontalCoordinate && ball.HorizontalCoordinate + ball.Width / 2 <= blockPanel.HorizontalCoordinate + blockPanel.Width);
 }
Example #7
0
        private void MainForm_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F1)
            {
                InformationScreen();
            }
            if (e.KeyCode == Keys.F2)
            {
                if (!editModeStatus)
                {
                    BlockPanel bPanel = new BlockPanel();
                    fpanel.Controls.Add(bPanel);
                    blockPanels.Add(bPanel);
                }
                else
                {
                    MessageBox.Show("Please turn off edit mode!", "Edit mode is active.", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            if (e.KeyCode == Keys.F3)
            {
                new AddBlock().Show();
            }
            if (e.KeyCode == Keys.F4)
            {
                Application.Exit();
            }
            if (e.KeyCode == Keys.F5)
            {
                DeleteEveryBlockPanel();
            }
            if (e.KeyCode == Keys.F6)
            {
                if (editModeStatus)
                {
                    editModeStatus = false;
                }
                else
                {
                    editModeStatus = true;
                }

                foreach (BlockPanel panel in blockPanels)
                {
                    Control[] checkBoxes = panel.Controls.Find("editMode_checkBox", false);
                    if (checkBoxes.Length > 0)
                    {
                        if (checkBoxes[0].Visible)
                        {
                            checkBoxes[0].Visible = false;
                        }
                        else
                        {
                            checkBoxes[0].Visible = true;
                        }
                    }
                    else
                    {
                        MessageBox.Show("I dont know why happing like that. Please report to me", "I dont know why", MessageBoxButtons.OK);
                    }
                }
            }
        }