public virtual void update(bool active)
        {
            CommandWindow.update(active && Active && ready);
            bool moved = this.index != CommandWindow.index;

            this.index  = CommandWindow.index;
            this.scroll = CommandWindow.scroll;

            if (moved)
            {
                refresh_loc();
            }

            if (active && Active && ready)
            {
                update_input();
            }
            if (!ready)
            {
                update_page_change();
            }
            if (is_help_active)
            {
                Help_Window.update();
            }
            Left_Arrow.update();
            Right_Arrow.update();
        }
        public void draw(SpriteBatch sprite_batch)
        {
            Vector2 loc = this.loc + draw_vector();

            // Window
            draw_window(sprite_batch, loc);

            sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
            for (int i = Type_Icons.Count - 1; i >= 0; i--)
            {
                if (i != this.type || TypeIconInactive)
                {
                    Type_Icons[i].draw(sprite_batch, -loc);
                }
            }
            if (!TypeIconInactive)
            {
                Type_Icons[this.type].draw(sprite_batch, -loc);
            }

            Left_Arrow.draw(sprite_batch, -(this.loc + arrow_draw_vector()));
            Right_Arrow.draw(sprite_batch, -(this.loc + arrow_draw_vector()));
            if (!Manual_Cursor_Draw)
            {
                draw_cursor(sprite_batch);
            }
            sprite_batch.End();
        }
 public void draw(SpriteBatch sprite_batch)
 {
     Window.draw(sprite_batch, -loc);
     Labels.draw(sprite_batch, -loc);
     Chapter.draw(sprite_batch, -loc);
     Lord_Lvl.draw(sprite_batch, -loc);
     Mode.draw(sprite_batch, -loc);
     Unit_Count.draw(sprite_batch, -loc);
     Gold.draw(sprite_batch, -loc);
     Counter.draw(sprite_batch, -loc);
     Lord_Sprite.draw(sprite_batch, -loc);
     Left_Arrow.draw(sprite_batch, -loc);
     Right_Arrow.draw(sprite_batch, -loc);
 }
Beispiel #4
0
 private void Tetris_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Left || e.KeyCode == Keys.A)
     {
         e.SuppressKeyPress = true;
         Left_Arrow?.Invoke();
         panel_field.Invalidate();
     }
     else if (e.KeyCode == Keys.Right || e.KeyCode == Keys.D)
     {
         e.SuppressKeyPress = true;
         Right_Arrow?.Invoke();
         panel_field.Invalidate();
     }
 }
        protected void update_input()
        {
            Left_Arrow.UpdateInput(-(this.loc + arrow_draw_vector()));
            Right_Arrow.UpdateInput(-(this.loc + arrow_draw_vector()));

            // Change page
            if (Global.Input.repeated(Inputs.Left) ||
                Global.Input.gesture_triggered(TouchGestures.SwipeRight))
            {
                Global.Audio.play_se("System Sounds", "Menu_Move2");
                move_left();
            }
            else if (Global.Input.repeated(Inputs.Right) ||
                     Global.Input.gesture_triggered(TouchGestures.SwipeLeft))
            {
                Global.Audio.play_se("System Sounds", "Menu_Move2");
                move_right();
            }
        }
Beispiel #6
0
        private void Form1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Left)
            {
                Left_Arrow?.Invoke();

                panel1.Invalidate();
            }
            else if (e.KeyCode == Keys.Right)
            {
                Right_Arrow?.Invoke();

                panel1.Invalidate();
            }
            else if (e.KeyCode == Keys.Down)
            {
                timer1.Interval = 100;
            }
        }
Beispiel #7
0
        private void GameBoy_key_down(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Left) // When left arrow is pressed
            {
                MessageBox.Show("działa");
                Left_Arrow?.Invoke(); // Invokean event
                screen.Invalidate();  // Refreshing the screen synchronously
            }

            else if (e.KeyCode == Keys.Right) // When right arrow is pressed
            {
                Right_Arrow?.Invoke();        // Invokean event
                screen.Invalidate();          // Refreshing the screen synchronously
            }

            else if (e.KeyCode == Keys.Down)        // When down arrow is pressed
            {
                timer1.Interval = arrow_down_speed; // speed up the game
            }
        }
Beispiel #8
0
 private void GameBoy_button_right(object sender, MouseEventArgs e)
 {
     Right_Arrow?.Invoke(); // Invokean event
     screen.Invalidate();   // Refreshing the screen synchronously
 }
 public void update()
 {
     Counter.update();
     Left_Arrow.update();
     Right_Arrow.update();
 }