public override void Init(PitchPitch parent, Size viewSize) { base.Init(parent, viewSize); _rowNum = _needRowNum; double holeY = (int)(_needRowNum / 2.0); double holeRad = _holeRadMax; Random _rand = new Random(); for (int i = 0; i < _columnNum; i++) { // 穴の中心 holeY += _holeGap * (_rand.NextDouble() - 0.5); if (holeY - holeRad < 0) holeY = holeRad; if (holeY + holeRad > _needRowNum) holeY = _needRowNum - holeRad; // 穴の大きさ holeRad += _holeRadGap * (_rand.NextDouble() - 0.5); if (holeRad > _holeRadMax) holeRad = _holeRadMax; if (holeRad < _holeRadMin) holeRad = _holeRadMin; uint[] tmp = new uint[_needRowNum]; for (int j = 0; j < _needRowNum; j++) tmp[j] = (j < holeY - holeRad || j > holeY + holeRad) ? (uint)1 : (uint)0; _chips.Add(tmp); } }
public override void Init(PitchPitch parent) { if (_prevSurface != null) _prevSurface.Dispose(); _prevSurface = null; _selectedIdx = 0; base.Init(parent); }
public override void Init(PitchPitch Parent) { base.Init(Parent); _rad = _minRad * 2; _vx = _defaultVx; _hp = _maxHp; initExplosion(); }
public override void Init(PitchPitch parent, Size viewSize) { base.Init(parent, viewSize); _rowNum = _needRowNum; _holeY = _rowNum / 2.0; _holeRad = _holeRadMax; _chips = new List<uint[]>(); _lastColumnIndex = 0; }
public virtual void Init(PitchPitch Parent) { _parent = Parent; _hp = _maxHp; _collisionPoints[0] = new Point(-(int)(_width / 2.0), -(int)(_height / 2.0)); _collisionPoints[1] = new Point(-_collisionPoints[0].X, _collisionPoints[0].Y); _collisionPoints[2] = new Point(-_collisionPoints[0].X, -_collisionPoints[0].Y); _collisionPoints[3] = new Point(_collisionPoints[0].X, -_collisionPoints[0].Y); }
public override void Init(PitchPitch parent, Size viewSize) { base.Init(parent, viewSize); _rowNum = _needRowNum; _holeY = _rowNum / 2.0; _holeRad = _holeRadMax; _chips = new List <uint[]>(); _lastColumnIndex = 0; }
public override void Init(PitchPitch parent) { if (_prevSurface != null) { _prevSurface.Dispose(); } _prevSurface = null; _selectedIdx = 0; base.Init(parent); }
public override void Init(PitchPitch parent) { base.Init(parent); _audioInput = parent.AudioInput; _audioInput.DeviceInfoUpdated += (s, e) => { _needUpdate = true; }; updateDevices(); _isCalStarted = false; _calSelectedIdx = IDX_MAXPITCH; _state = SelectionState.Device; }
public virtual void Init(PitchPitch parent, Size viewSize) { _parent = parent; _chipWidth = _chipData.ChipWidth; _chipHeight = _chipData.ChipHeight; _chipWidthInv = 1 / (double)_chipData.ChipWidth; _chipHeightInv = 1 / (double)_chipData.ChipHeight; _needRowNum = (int)Math.Ceiling(viewSize.Height / (double)_chipData.ChipHeight) + 1; _needColumnNum = (int)Math.Ceiling(viewSize.Width / (double)_chipData.ChipWidth) + 1; }
public override void Init(PitchPitch parent, System.Drawing.Size viewSize) { base.Init(parent, viewSize); _chips = new List <uint[]>(); for (int i = 0; i < _needColumnNum; i++) { uint[] row = new uint[_needRowNum]; for (int j = 0; j < row.Length; j++) { row[j] = 0; } _chips.Add(row); } }
public override void Init(PitchPitch parent, System.Drawing.Size viewSize) { base.Init(parent, viewSize); _chips = new List<uint[]>(); for (int i = 0; i < _needColumnNum; i++) { uint[] row = new uint[_needRowNum]; for (int j = 0; j < row.Length; j++) { row[j] = 0; } _chips.Add(row); } }
/// <summary> /// 初期化処理 /// </summary> /// <param name="parent">ゲームクラス</param> public virtual void Init(PitchPitch parent) { _parent = parent; _prevPressedKey = Key.Print; _prevPressTick = Environment.TickCount; _prevTransitionTick = Environment.TickCount; _prevContTick = Environment.TickCount; _transitionStart = false; if (_transitionBeforeSurface != null) { _transitionBeforeSurface.Dispose(); _transitionBeforeSurface = null; } SetAlert(false, null); }
public override void Init(PitchPitch parent, Size viewSize) { base.Init(parent, viewSize); _rowNum = _needRowNum; double holeY = (int)(_needRowNum / 2.0); double holeRad = _holeRadMax; Random _rand = new Random(); for (int i = 0; i < _columnNum; i++) { // 穴の中心 holeY += _holeGap * (_rand.NextDouble() - 0.5); if (holeY - holeRad < 0) { holeY = holeRad; } if (holeY + holeRad > _needRowNum) { holeY = _needRowNum - holeRad; } // 穴の大きさ holeRad += _holeRadGap * (_rand.NextDouble() - 0.5); if (holeRad > _holeRadMax) { holeRad = _holeRadMax; } if (holeRad < _holeRadMin) { holeRad = _holeRadMin; } uint[] tmp = new uint[_needRowNum]; for (int j = 0; j < _needRowNum; j++) { tmp[j] = (j <holeY - holeRad || j> holeY + holeRad) ? (uint)1 : (uint)0; } _chips.Add(tmp); } }
public override void Init(PitchPitch parent) { base.Init(parent); // カーソル位置のリセット(タイトル画面に戻った時のみ) if (_escFocus) { _mapFocus = true; _mapSelectedIdx = 0; _escFocus = false; } _octaveSelecting = false; _octave = 0; _octaveSelectedDel = null; _loadTransition = false; // マップ情報の更新(マップ情報が無い場合のみ) if (_mapInfos.Count == 0) { updateMapInfos(); } }
/// <summary> /// 初期化処理 /// </summary> /// <param name="parent">ゲームクラス</param> public override void Init(PitchPitch parent) { base.Init(parent); parent.Player.Init(parent); // 各種フラグのリセット IsPaused = false; _isCleared = false; _isOver = false; _pauseSelectedIdx = 0; _clearSelectedIdx = 0; #region 色 initColor(_map.MapInfo.ForegroundColor, _map.MapInfo.BackgroundColor, _map.MapInfo.StrongColor); #endregion #region View/Map/Player _mapMargin = (int)(_viewRect.Width * 3 / 4.0) * _map.MapInfo.PlayerVx; Console.WriteLine(_mapMargin); _view.Width = _viewRect.Width; _view.Height = _viewRect.Height; _map.Init(parent, new Size(_view.Width, _view.Height)); _view.X = -_mapMargin; _view.Y = (long)(_map.Height / 2.0 - _view.Height / 2.0); _map.SetView(_view); _parent.Player.X = _playerXRatio * _view.Width - _mapMargin; _parent.Player.Y = _map.Height / 2.0; _parent.Player.Vx = _map.MapInfo.PlayerVx; _prevX = _parent.Player.X; _view.X = -_mapMargin; // BGM if (_map.Bgm != null) { SdlDotNet.Audio.MusicPlayer.Load(_map.Bgm); int ivol = (int)(128 * _map.BgmVolume / 100.0); ivol = ivol < 0 ? 0 : (ivol > 128 ? 128 : ivol); SdlDotNet.Audio.MusicPlayer.Volume = ivol; } #endregion #region メニュー作成 if (_map.HasEnd) { _pauseMenuItems = new MenuItem[] { new MenuItem(Key.Escape, Properties.Resources.MenuItem_ResumeGame), new MenuItem(Key.R, Properties.Resources.MenuItem_RetryStage), new MenuItem(Key.M, Properties.Resources.MenuItem_MapSelect), new MenuItem(Key.T, Properties.Resources.MenuItem_ReturnTitle) }; } else { _pauseMenuItems = new MenuItem[] { new MenuItem(Key.Escape, Properties.Resources.MenuItem_ResumeGame), new MenuItem(Key.M, Properties.Resources.MenuItem_MapSelect), new MenuItem(Key.T, Properties.Resources.MenuItem_ReturnTitle) }; } _pauseMenuSurfaces = new SurfaceCollection(); _pauseMenuRects = new Rectangle[_pauseMenuItems.Length]; ImageUtil.CreateStrMenu(_pauseMenuItems, _backColor, ref _pauseMenuSurfaces, ref _pauseMenuRects); _clearMenuSurfaces = new SurfaceCollection(); _clearMenuRects = new Rectangle[_clearMenuItems.Length]; ImageUtil.CreateStrMenu(_clearMenuItems, _foreColor, ref _clearMenuSurfaces, ref _clearMenuRects); #endregion #region ピッチ設定 if (_map.MapInfo.PitchType == map.PitchType.Fixed) { _isFixedPitchMap = true; _maxFreq = _map.MapInfo.MaxPitch; _minFreq = _map.MapInfo.MinPitch; if (_map.MapInfo.OctaveLevel != 0) { _maxFreq *= Math.Pow(2, _map.MapInfo.OctaveLevel); _minFreq *= Math.Pow(2, _map.MapInfo.OctaveLevel); } } else { _isFixedPitchMap = false; _minFreq = Config.Instance.MinFreq; _maxFreq = Config.Instance.MaxFreq; } _maxFreqLog = Math.Log(_maxFreq); _minFreqLog = Math.Log(_minFreq); #endregion createKeyRects(); _prevProcTime = Environment.TickCount; }
public override void Init(PitchPitch parent) { base.Init(parent); _selectedIdx = 0; }
public override void Init(PitchPitch parent) { base.Init(parent); release(); }
public override void Init(PitchPitch parent) { base.Init(parent); // カーソル位置のリセット(タイトル画面に戻った時のみ) if (_escFocus) { _mapFocus = true; _mapSelectedIdx = 0; _escFocus = false; } _octaveSelecting = false; _octave = 0; _octaveSelectedDel = null; _loadTransition = false; // マップ情報の更新(マップ情報が無い場合のみ) if (_mapInfos.Count == 0) updateMapInfos(); }