赞 | 5 |
VIP | 0 |
好人卡 | 2 |
积分 | 32 |
经验 | 24079 |
最后登录 | 2024-5-17 |
在线时间 | 1865 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 3226
- 在线时间
- 1865 小时
- 注册时间
- 2010-6-19
- 帖子
- 1207
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
我想设置一个效果,战斗的时候角色战斗坐标会移动几步,然后在定位在一个坐标上,然后在进入正常战斗。
战斗显示用活动块在这里
class Sprite_Battler < RPG::Sprite
最后几行
# 设置活动块的坐标
self.x = @battler.screen_x
self.y = @battler.screen_y
self.z = @battler.screen_z
这里我知道这里是显示进入战斗时的坐标,然后
我的思路大概是这样:
# 设置活动块的坐标
然后先定义1个坐标
self.x = @battler.screen_x
self.y = @battler.screen_y
接着等待1秒 【等待1秒是想达到看起来连贯移动的效果....】
@wait_count = 40 【XP好像是40帧为1秒吧?】
修改坐标【在原坐标上减去数值,达到移动效果】
self.x = @battler.screen_x - 10
self.y = @battler.screen_y - 10
刷新画面
Graphics.update 【好像这样刷新是错误的,直接卡顿......】
然后开始重复几次,达到看起来有移动战斗图的效果
结果就是这样
# 设置活动块的坐标
self.x = @battler.screen_x
self.y = @battler.screen_y
self.z = @battler.screen_z
@wait_count = 40
self.x = @battler.screen_x - 10
self.y = @battler.screen_y - 10
Graphics.update
@wait_count = 40
self.x = @battler.screen_x - 10
self.y = @battler.screen_y - 10
Graphics.update
@wait_count = 40
self.x = @battler.screen_x - 10
self.y = @battler.screen_y - 10
Graphics.update
@wait_count = 40
self.x = @battler.screen_x - 10
self.y = @battler.screen_y - 10
Graphics.update
@wait_count = 40
self.x = @battler.screen_x - 10
self.y = @battler.screen_y - 10
Graphics.update
问题出现了,画面最后会一直刷新,而且一直卡顿,坐标移动的效果好像是出来了,难道不应该是这样吗??? |
|