| 
 
| 赞 | 0 |  
| VIP | 0 |  
| 好人卡 | 0 |  
| 积分 | 1 |  
| 经验 | 1851 |  
| 最后登录 | 2014-6-28 |  
| 在线时间 | 75 小时 |  
 Lv1.梦旅人 
	梦石0 星屑50 在线时间75 小时注册时间2013-8-1帖子26 | 
5楼
 
 
 楼主|
发表于 2013-8-12 00:16:22
|
只看该作者 
| #-------------------------------------------------------------------------- # ● 径向移动
 #     d       : 方向(2,4,6,8)
 #     turn_ok : 是否可以改变方向
 #--------------------------------------------------------------------------
 def move_straight(d, turn_ok = true)
 @move_succeed = passable?(@x, @y, d)
 if @move_succeed
 set_direction(d)
 @x = $game_map.round_x_with_direction(@x, d)
 @y = $game_map.round_y_with_direction(@y, d)
 @real_x = $game_map.x_with_direction(@x, reverse_dir(d))
 @real_y = $game_map.y_with_direction(@y, reverse_dir(d))
 increase_steps
 elsif turn_ok
 set_direction(d)
 check_event_trigger_touch_front
 end
 end
 已经找到类了,但是不知道用哪个变量代表目前的方向。。就差一步了,求指点
 | 
 |