- 注册时间
- 2005-9-7
- 最后登录
- 2006-12-20
⑥精研
- 积分
- 1285
|
发表于 2005-10-31 07:05:08
|
显示全部楼层
- #==============================================================================
- # ■ chaochao的玩家移动音效(051031)
- # 修改了Game_Player
- # 功能:
- # 玩家移动时根据地形ID播放不同的音效
- #------------------------------------------------------------------------------
- # 作者:chaochao
- # [url]http://zhuchao.go1.icpcn.com[/url]
- #==============================================================================
- class Game_Player < Game_Character
- def chaochao_seplay(seid)
- #seid对应地形ID播放SE
- case seid
- when 0
- Audio.se_play("Audio/SE/001-System01.ogg", 100, 100)
- when 1
- Audio.se_play("Audio/SE/002-System02.ogg", 100, 100)
- when 2
- Audio.se_play("Audio/SE/003-System03.ogg", 100, 100)
- when 3
- Audio.se_play("Audio/SE/004-System04.ogg", 100, 100)
- when 4
- Audio.se_play("Audio/SE/005-System05.ogg", 100, 100)
- when 5
- Audio.se_play("Audio/SE/006-System06.ogg", 100, 100)
- when 6
- Audio.se_play("Audio/SE/007-System07.ogg", 100, 100)
- when 7
- Audio.se_play("Audio/SE/008-System08.ogg", 100, 100)
- end
- end
- def update
- last_moving = moving?
- unless moving? or $game_system.map_interpreter.running? or
- @move_route_forcing or $game_temp.message_window_showing
- case Input.dir4
- when 2
- move_down
- chaochao_seplay($game_player.terrain_tag)
- when 4
- move_left
- chaochao_seplay($game_player.terrain_tag)
- when 6
- move_right
- chaochao_seplay($game_player.terrain_tag)
- when 8
- move_up
- chaochao_seplay($game_player.terrain_tag)
- end
- end
- last_real_x = @real_x
- last_real_y = @real_y
- super
- if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
- $game_map.scroll_down(@real_y - last_real_y)
- end
- if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
- $game_map.scroll_left(last_real_x - @real_x)
- end
- if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
- $game_map.scroll_right(@real_x - last_real_x)
- end
- if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
- $game_map.scroll_up(last_real_y - @real_y)
- end
- unless moving?
- if last_moving
- result = check_event_trigger_here([1,2])
- if result == false
- unless $DEBUG and Input.press?(Input::CTRL)
- if @encounter_count > 0
- @encounter_count -= 1
- end
- end
- end
- end
- if Input.trigger?(Input::C)
- check_event_trigger_here([0])
- check_event_trigger_there([0,1,2])
- end
- end
- end
- end
复制代码 |
|