| 赞 | 0  | 
 
| VIP | 1 | 
 
| 好人卡 | 0 | 
 
| 积分 | 1 | 
 
| 经验 | 1773 | 
 
| 最后登录 | 2014-4-18 | 
 
| 在线时间 | 8 小时 | 
 
 
 
 
 
Lv1.梦旅人 ℃ake
	- 梦石
 - 0 
 
        - 星屑
 - 50 
 
        - 在线时间
 - 8 小时
 
        - 注册时间
 - 2009-6-6
 
        - 帖子
 - 787
 
 
  
 | 
	
9楼
 
 
 楼主 |
发表于 2009-8-30 19:45:38
|
只看该作者
 
 
 
OK,鼠标看完了,鼠标里的地方和我方的鼠标控制也不过只有刚刚那个变量不同罢了。 
其实,按照我刚才那种方法,上下键切换变量,左右键增减@index,如果细心点,说不定我还是可以搞定的。 
但是,鼠标却有难题。鼠标最不好搞定的还是判定什么情况下用$game_troop.enemies,什么情况下用$game_party.actors。我在想,如果没有一个变量包含这两个变量的值的话,就很难写鼠标的了。- class Arrow_Actor
 
 -  if @self_alias == nil
 
 -    alias self_update update
 
 -    @self_alias = true
 
 -  end
 
 -  def update
 
 -    mouse_x, mouse_y = Mouse.get_mouse_pos
 
 -    idx = 0
 
 -    for i in $game_party.actors do
 
 -      if i.exist?
 
 -        top_x = i.screen_x - self.ox
 
 -        top_y = i.screen_y - self.oy
 
 -        bottom_x = top_x + self.src_rect.width
 
 -        bottom_y = top_y + self.src_rect.height
 
 -        if (mouse_x > top_x - $角色选框扩大) and (mouse_y > top_y - $角色选框扩大) and
 
 -           (mouse_x < bottom_x + $角色选框扩大) and (mouse_y < bottom_y + $角色选框扩大)
 
 -          if @index != idx
 
 -            $game_system.se_play($data_system.cursor_se)
 
 -            @index = idx
 
 -          end
 
 -        end
 
 -      end
 
 -      idx += 1
 
 -    end
 
 -    self_update
 
 -  end
 
 - end
 
  复制代码 |   
 
 
 
 |