赞 | 0 |
VIP | 13 |
好人卡 | 65 |
积分 | 1 |
经验 | 58644 |
最后登录 | 2017-10-23 |
在线时间 | 1281 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 1281 小时
- 注册时间
- 2006-8-27
- 帖子
- 590
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
我初学脚本 写了3个方便点的显示图片
- #-------------------------------------
- # ● 自定义显示图片
- #-------------------------------------
- def pi(name, x, y)
- @name = name
- @x = x.to_f
- @y = y.to_f
- end
- #-------------------------------------
- # ● 自定义移动图片
- #-------------------------------------
- def mv(y)
- @duration = 2
- @target_x = x
- @target_y = y.to_f
- @target_opacity = 255
- end
- #-------------------------------------
- # ● 自定义消失图片
- #-------------------------------------
- def me
- @duration = 4
- @target_opacity = 0
- end
复制代码
在事件脚本中这样写:
$game_screen.pictures[41].pi($y)
$y -= 10
$game_screen.pictures[41].mv($y)
@wait_count = 2
$y += 12
$game_screen.pictures[41].mv($y)
@wait_count = 20
$game_screen.pictures[41].me
效果是让1幅图片 往上跳出来 在往下降 等一会消失
因为会执行多张这种图,用了等待以后 $y 会被改变
如何才能整和到1个方法中?
def ph
$game_screen.pictures[41].pi(y)
$game_screen.pictures[41].mv(y)
y -= 10
@wait_count = 2
$game_screen.pictures[41].mv(y)
@wait_count = 20
y += 12
$game_screen.pictures[41].me(y)
end
或者可不可以定义方法的时候直接定义出这种效果?
![]()
自己解决了.
- if @new >= 1
- if @new >= 27
- @y -= 3
- elsif @new >= 24
- @y += 3
- elsif @new <= 3
- @opacity -= 96
- end
- @new -= 1
- end
复制代码 |
|