赞 | 2 |
VIP | 33 |
好人卡 | 33 |
积分 | 14 |
经验 | 54000 |
最后登录 | 2024-9-21 |
在线时间 | 1295 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 1358
- 在线时间
- 1295 小时
- 注册时间
- 2012-8-4
- 帖子
- 749
|
- #==============================================================================
- # ■ Game_Screen
- #------------------------------------------------------------------------------
- # 更改色调以及画面闪烁、保存画面全体关系处理数据的类。本类的实例请参考
- # $game_screen。
- # $game_screen.start_vibration(power, speed, duration)强度,速度,时间
- #==============================================================================
- class Game_Screen
- attr_reader :vibration #震动
- #--------------------------------------------------------------------------
- # ● 初试化对像
- #--------------------------------------------------------------------------
- alias initialize16910 initialize
- def initialize
- initialize16910
- @vibration_power = 0
- @vibration_speed = 0
- @vibration_duration = 0
- @vibration_direction = 1
- @vibration = 0
- end
- #--------------------------------------------------------------------------
- # ● 开始震动
- # power : 强度
- # speed : 速度
- # duration : 时间
- #--------------------------------------------------------------------------
- def start_vibration(power, speed, duration)
- @vibration_power = power
- @vibration_speed = speed
- @vibration_duration = duration
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- alias update16910 update
- def update
- update16910
- if @vibration_duration >= 1 or @vibration != 0
- delta = (@vibration_power * @vibration_speed * @vibration_direction) / 10.0
- if @vibration_duration <= 1 and @vibration * (@vibration + delta) < 0
- @vibration = 0
- else
- @vibration += delta
- end
- if @vibration > @vibration_power * 2
- @vibration_direction = -1
- end
- if @vibration < - @vibration_power * 2
- @vibration_direction = 1
- end
- if @vibration_duration >= 1
- @vibration_duration -= 1
- end
- end
- end
- end
- #==============================================================================
- # ■ Spriteset_Map
- #------------------------------------------------------------------------------
- # 处理地图画面活动块和元件的类。本类在
- # Scene_Map 类的内部使用。
- #==============================================================================
- class Spriteset_Map
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- alias update16910 update
- def update
- update16910
- @viewport1.oy = $game_screen.vibration
- end
- end
复制代码 |
评分
-
查看全部评分
|