赞 | 5 |
VIP | 620 |
好人卡 | 38 |
积分 | 69 |
经验 | 125468 |
最后登录 | 2015-7-27 |
在线时间 | 1666 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 6855
- 在线时间
- 1666 小时
- 注册时间
- 2008-10-29
- 帖子
- 6710
|
利用地形标志简单的做了一个.
行走脚步声.rar
(207.07 KB, 下载次数: 1321)
Game_Player 的 update
里面的相关内容改成这样
- # 如果方向键被按下、主角就朝那个方向移动
- @step_count = 0 if @step_count.nil?
- if @step_count > 0
- @step_count -= 1
- end
- case Input.dir4
- when 2
- @old_x = self.x
- @old_y = self.y
- move_down
- if @old_x != self.x or @old_y != self.y
- case $game_map.terrain_tag(self.x, self.y)
- when 0
- Audio.se_play("Audio/SE/stonerun3")
- when 1
- Audio.se_play("Audio/SE/step02")
- when 2
- if @step_count == 0
- Audio.se_play("Audio/SE/inwater 2")
- @step_count = 4
- end
- end
- end
- when 4
- @old_x = self.x
- @old_y = self.y
- move_left
- if @old_x != self.x or @old_y != self.y
- case $game_map.terrain_tag(self.x, self.y)
- when 0
- Audio.se_play("Audio/SE/stonerun3")
- when 1
- Audio.se_play("Audio/SE/step02")
- when 2
- if @step_count == 0
- Audio.se_play("Audio/SE/inwater 2")
- @step_count = 4
- end
- end
- end
- when 6
- @old_x = self.x
- @old_y = self.y
- move_right
- if @old_x != self.x or @old_y != self.y
- case $game_map.terrain_tag(self.x, self.y)
- when 0
- Audio.se_play("Audio/SE/stonerun3")
- when 1
- Audio.se_play("Audio/SE/step02")
- when 2
- if @step_count == 0
- Audio.se_play("Audio/SE/inwater 2")
- @step_count = 4
- end
- end
- end
- when 8
- @old_x = self.x
- @old_y = self.y
- move_up
- if @old_x != self.x or @old_y != self.y
- case $game_map.terrain_tag(self.x, self.y)
- when 0
- Audio.se_play("Audio/SE/stonerun3")
- when 1
- Audio.se_play("Audio/SE/step02")
- when 2
- if @step_count == 0
- Audio.se_play("Audio/SE/inwater 2")
- @step_count = 4
- end
- end
- end
- end
- end
复制代码 |
评分
-
查看全部评分
|