示例#1
0
        // コンストラクタ
        public CharaMove(Character chara, Size scope)
        {
            // キャラクタのポインタの設定
            moveChara = chara;

            // 速度の初期化
            vx = 0;
            vy = 0;

            // バウンド数カウンターの初期化
            boundCounter = 0;

            // 到着フラグの初期化
            this.arrivalFlag = true;

            // 動ける範囲の設定
            scopeFloor = scope;

            // 乱数のシードの設定
            this.rndSeed = Environment.TickCount;
            // 乱数の初期化
            this.random = new Random(rndSeed++);
        }
示例#2
0
    // 初期化
    private void init()
    {
        // 初期位置の初期化
        oldPoint = new Point(this.DesktopLocation.X,this.DesktopLocation.Y);

        // キャラクターの生成
        character = new Chara.Character(new Point(this.DesktopLocation.X, this.DesktopLocation.Y),screenSize);

        // スクリーンサイズと地平線の設定
        setSize();

        // コンテキストメニューの追加
        addContextMenu();

        // フォームの画像等の設定
        setForm();

        // タイマーの設定
        timer = new FPSTimer();
        // タイマーのイベントハンドラの設定
        timer.Tick += new EventHandler(timerEvent);
        // タイマーのスタート
        timer.Enabled = true;
    }