Example #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            //光标
            mc_nomal = new Bitmap(@"mc_1.png");
            mc_nomal.SetResolution(96, 96);
            mc_event = new Bitmap(@"mc_2.png");
            mc_event.SetResolution(96, 96);


            Title.init();
            Message.init();
            Statusmenu.init();
            Shop.init();
            Save.init();
            Fight.init();
            Define.define(player, npc, map);

            Map.change_map(map, player, npc, 0, 50, 280, 1, music_player);

            //Button b = new Button();
            //b.click_event += new Button.Click_event(tryevent);
            //b.click();
            Title.show();
            //this.Show();
            //Fight.start(new int[] { 0, 0, -1 }, "fight/f_scene.png", 1, 0, 1, 1, 100);
            Cursor.Hide();
        }
Example #2
0
    //--------------------------------------------------------------
    //操控
    //
    //...............................................................
    public static void key_ctrl(Player[] player, Map[] map, Npc[] npc, KeyEventArgs e)
    {
        if (Player.status != Status.WALK)
        {
            return;
        }
        Player p = player[current_player];

        //切换角色
        if (e.KeyCode == Keys.Tab)
        {
            key_change_player(player);
        }
        //是否转向
        if (e.KeyCode == Keys.Up)
        {
            walk(player, map, Comm.Direction.UP);
        }
        else if (e.KeyCode == Keys.Down)
        {
            walk(player, map, Comm.Direction.DOWN);
        }
        else if (e.KeyCode == Keys.Left)
        {
            walk(player, map, Comm.Direction.LEFT);
        }
        else if (e.KeyCode == Keys.Right)
        {
            walk(player, map, Comm.Direction.RIGHT);
        }
        else if (e.KeyCode == Keys.Escape)
        {
            Statusmenu.show();
            Task.block();
        }
        //npc碰撞
        npc_collision(player, map, npc, e);

        /*
         * //间隔判定
         * if (Comm.Time() - p.last_walk_time <= p.walk_interval)
         *  return;
         * //移动处理
         * if (e.KeyCode == Keys.Down && Map.can_through(map,p.x,p.y+p.speed)) { p.y = p.y + p.speed; } // p.face = 1; }
         * else if (e.KeyCode == Keys.Up && Map.can_through(map, p.x, p.y - p.speed)) { p.y = p.y - p.speed; }  //p.face = 4; }
         * else if (e.KeyCode == Keys.Left && Map.can_through(map, p.x-p.speed, p.y)) { p.x = p.x - p.speed; } //p.face = 2; }
         * else if (e.KeyCode == Keys.Right && Map.can_through(map, p.x+p.speed, p.y)) { p.x = p.x + p.speed; } //p.face = 3; }
         * else return;
         * //动画帧
         * p.anm_frame = p.anm_frame + 1;
         * if (p.anm_frame >= int.MaxValue) p.anm_frame = 0;
         * //时间
         * p.last_walk_time = Comm.Time();
         */
    }
Example #3
0
 public static void mouse_click(Map[] map, Player[] player, Rectangle stage, MouseEventArgs e)
 {
     if (Player.status != Status.WALK)
     {
         return;
     }
     if (e.Button == MouseButtons.Left)
     {
         target_x        = e.X - Map.get_map_sx(map, player, stage);
         target_y        = e.Y - Map.get_map_sy(map, player, stage);
         flag_start_time = Comm.Time();
     }
     else if (e.Button == MouseButtons.Right)
     {
         Statusmenu.show();
         Task.block();
     }
 }