Project1

标题: 请问如何实现等待位移? [打印本页]

作者: megaman    时间: 2019-1-18 11:52
标题: 请问如何实现等待位移?
  1.   def update
  2.     update_basic
  3.    

  4.     if @command_window.index==(0)
  5.       @menu_pic1.bitmap = Cache.system("item_on")
  6.       @menu_pic1.x += 5 if @menu_pic1.x < 0
  7.     else
  8.       @menu_pic1.bitmap = Cache.system("item")
  9.     end
  10.    
  11.     if @command_window.index==(1)
  12.       @menu_pic2.bitmap = Cache.system("skill_on")
  13.     else
  14.       @menu_pic2.bitmap = Cache.system("skill")
  15.       @menu_pic2.x += 5 if @menu_pic2.x < 0
  16.     end
  17.    
  18.     if @command_window.index==(2)
  19.       @menu_pic3.bitmap = Cache.system("equip_on")
  20.     else
  21.       @menu_pic3.bitmap = Cache.system("equip")
  22.       @menu_pic3.x += 5 if @menu_pic3.x < 0
  23.     end
  24.   end  
复制代码


我想让编号0位移完成了再让编号1的位移,请问怎么做呢?
作者: 张咚咚    时间: 2019-1-18 11:58
加一个变量判断,移动完成后变量为true,其他编号判断为true后在操作




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1