赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 865 |
最后登录 | 2015-12-15 |
在线时间 | 3 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 3 小时
- 注册时间
- 2015-12-11
- 帖子
- 6
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 RyanBern 于 2015-12-27 09:51 编辑
我要建个数组,数组中每个单元,依次和系统变量进行运算,结果判定是否进入下个循环。现在循环停不上来。对不起,新人还是不能理解。我想要的是,数组与变量11的差值,要显示出来的,另外,差值小于等于0时,lv+1
这样的效果,大神门例子写完后,用菜单test1测试一下结果。谢谢。
请教育各位大神帮忙看看。{:2_280:}
#============================================================================== # ■ Window_Check #------------------------------------------------------------------------------ # 显示评分画面窗口。 #============================================================================== class Window_Check < Window_Base #-------------------------------------------------------------------------- # ● 初始化对像 # actor : 角色 #-------------------------------------------------------------------------- def initialize(actor) super(0, 0, 620, 480) self.contents = Bitmap.new(width - 18, height - 18) @actor = actor self.contents.font.size = 20 $v = 0 refresh end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh self.contents.clear #——定义 $lastexp = [10,20,30,40,50,60,70,80,90,100] $lvexp = $lastexp[$v].to_i - $game_variables[11] if $lvexp <= 0 $game_variables[15]+=1 $v+=1 end #——lv self.contents.font.color = system_color self.contents.draw_text(120, 50, 128, 28, "lv") self.contents.font.color = normal_color self.contents.draw_text(200, 50, 80, 28, $game_variables[15] .to_s, 2) #——lvexp self.contents.font.color = system_color self.contents.draw_text(120, 85, 128, 28, "lvexp") self.contents.font.color = normal_color self.contents.draw_text(200, 85, 70, 28, $lvexp .to_s,2) #——描绘lastexp self.contents.font.color = system_color self.contents.draw_text(120, 15, 128, 28,"nowexp") self.contents.font.color = normal_color self.contents.draw_text(190, 15, 100, 28, $game_variables[11] .to_s, 2) #——挑战关卡次数 def totalcs @totalcs = $game_variables[255]+$game_variables[265]+$game_variables[285] end self.contents.font.color = system_color self.contents.draw_text(330,15,128,28,"挑战关卡次数") self.contents.font.color = normal_color self.contents.draw_text(380,15,120,28, totalcs.to_s, 2) self.contents.draw_text(520,15,100,28, "次") #——成功关卡次数 def totalvs @totalvs = $game_variables[256]+$game_variables[266]+$game_variables[286] end self.contents.font.color = system_color self.contents.draw_text(330,50,128,28,"成功关卡次数") self.contents.font.color = normal_color self.contents.draw_text(380,50,120,28, totalvs.to_s, 2) self.contents.draw_text(520,50,100,28, "次") end #def refresh end #class
#==============================================================================
# ■ Window_Check
#------------------------------------------------------------------------------
# 显示评分画面窗口。
#==============================================================================
class Window_Check < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 0, 620, 480)
self.contents = Bitmap.new(width - 18, height - 18)
@actor = actor
self.contents.font.size = 20
$v = 0
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
#——定义
$lastexp = [10,20,30,40,50,60,70,80,90,100]
$lvexp = $lastexp[$v].to_i - $game_variables[11]
if $lvexp <= 0
$game_variables[15]+=1
$v+=1
end
#——lv
self.contents.font.color = system_color
self.contents.draw_text(120, 50, 128, 28, "lv")
self.contents.font.color = normal_color
self.contents.draw_text(200, 50, 80, 28, $game_variables[15] .to_s, 2)
#——lvexp
self.contents.font.color = system_color
self.contents.draw_text(120, 85, 128, 28, "lvexp")
self.contents.font.color = normal_color
self.contents.draw_text(200, 85, 70, 28, $lvexp .to_s,2)
#——描绘lastexp
self.contents.font.color = system_color
self.contents.draw_text(120, 15, 128, 28,"nowexp")
self.contents.font.color = normal_color
self.contents.draw_text(190, 15, 100, 28, $game_variables[11] .to_s, 2)
#——挑战关卡次数
def totalcs
@totalcs = $game_variables[255]+$game_variables[265]+$game_variables[285]
end
self.contents.font.color = system_color
self.contents.draw_text(330,15,128,28,"挑战关卡次数")
self.contents.font.color = normal_color
self.contents.draw_text(380,15,120,28, totalcs.to_s, 2)
self.contents.draw_text(520,15,100,28, "次")
#——成功关卡次数
def totalvs
@totalvs = $game_variables[256]+$game_variables[266]+$game_variables[286]
end
self.contents.font.color = system_color
self.contents.draw_text(330,50,128,28,"成功关卡次数")
self.contents.font.color = normal_color
self.contents.draw_text(380,50,120,28, totalvs.to_s, 2)
self.contents.draw_text(520,50,100,28, "次")
end #def refresh
end #class
|
|