赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 5512 |
最后登录 | 2016-6-20 |
在线时间 | 163 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 163 小时
- 注册时间
- 2012-1-15
- 帖子
- 67
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
18-21行出错大神们帮看下是怎么回事呀
class Scene_密码
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
def main
# 获取角色
$subiao = 1
# 战斗测试的情况下
if $BTEST
battle_test
return
end
#=========
file1 = File.open("zhuce/Save.rxdata", "rb")
$data_system = Marshal.load(file1)
file1.close
kuai_guan21= $data_system.switches[21]
kuai_guan22= $data_system.switches[22]
kuai_guan23= $data_system.switches[23]
kuai_guan24= $data_system.switches[24]
#=========
# 载入数据库
$data_actors = load_data("Data/Actors.rxdata")
$data_classes = load_data("Data/Classes.rxdata")
$data_skills = load_data("Data/Skills.rxdata")
$data_items = load_data("Data/Items.rxdata")
$data_weapons = load_data("Data/Weapons.rxdata")
$data_armors = load_data("Data/Armors.rxdata")
$data_enemies = load_data("Data/Enemies.rxdata")
$data_troops = load_data("Data/Troops.rxdata")
$data_states = load_data("Data/States.rxdata")
$data_animations = load_data("Data/Animations.rxdata")
$data_tilesets = load_data("Data/Tilesets.rxdata")
$data_common_events = load_data("Data/CommonEvents.rxdata")
$data_system = load_data("Data/System.rxdata")
Graphics.frame_count = 0
# 生成各种游戏对像
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
$game_物品拦 =Game_物品拦.new
# 设置初期同伴位置
$game_party.setup_starting_members
# 设置初期位置的地图
$game_map.setup($data_system.start_map_id)
# 主角向初期位置移动
$game_player.moveto($data_system.start_x, $data_system.start_y)
# 刷新主角
$game_player.refresh
# 执行地图设置的 BGM 与 BGS 的自动切换
#$game_map.autoplay
# 刷新地图 (执行并行事件)
#Audio.se_play("Audio/BGM/长安")
Audio.bgm_stop
Audio.bgm_play("Audio/BGM/xy3登陆")
$data_system.switches[21]=kuai_guan21
$data_system.switches[22]=kuai_guan22
$data_system.switches[23]= kuai_guan23
$data_system.switches[24]=kuai_guan24
#Audio.se_stop
$game_map.update
# 切换地图画面
#--------------------------------------------------------------------------
# 添加LOGO
# unless $DEBUG #不想测试的时候都显示把前面的*号去掉
# 演奏标题 SE
if $logo_list
$logo_list = false
Audio.se_play("Audio/SE/se071.wav")
@sprite2 = Sprite.new
@sprite2.bitmap = RPG::Cache.title("LOGO")
@sprite2.x = (640 - @sprite2.bitmap.width) / 2
@sprite2.y = (480 - @sprite2.bitmap.height) / 2
@sprite2.opacity = 255
Graphics.transition(40)
for i in 0..80
@sprite2.opacity =240 - (i - 40) * 6 if i >= 40
Graphics.update
end
@sprite2.dispose
Graphics.freeze
# LOGO结束
#--------------------------------------------------------------------------
# 开头动画
@spritex = Sprite.new
@spritex.bitmap = RPG::Cache.title("开始图片")
@spritex.x = 640 - @spritex.bitmap.width
Graphics.transition(20)
for i in 0..160
@spritex.x = 640 - @spritex.bitmap.width + i * 4 if i <= 160
Graphics.update
end
#----------------------------
for i in 0..52
Audio.se_play("Audio/SE/SE034.wav") if i == 16
@spritex.bitmap = RPG::Cache.title("开始图片1") if i == 0
#s1 = Time.now
#while (Time.now - s1) <= 0.2
#Graphics.update
#end
@spritex.bitmap = RPG::Cache.title("开始图片2") if i == 8
@spritex.bitmap = RPG::Cache.title("开始图片3") if i == 16
@spritex.bitmap = RPG::Cache.title("开始图片4") if i == 24
@spritex.bitmap = RPG::Cache.title("开始图片5") if i == 32
@spritex.bitmap = RPG::Cache.title("开始图片6") if i == 40
Graphics.transition(20, "Graphics/Transitions/1") #改这里
Graphics.freeze
#Graphics.update
end
@spritex.dispose
# 过渡
Graphics.transition(20, "Graphics/Transitions/1")
Graphics.freeze
end
# end #不想测试的时候都显示把前面的*号去掉-密码登陆
#=========
@sp=Sprite.new
@sp.bitmap=Bitmap.new("Graphics/Pictures/密码登陆")
#---------------------------------
# 输入法测试
@v2 = Viewport.new(260,159,320,20)
@v2.color.set(0,0,0,0)
@tf2 = Type_Field.new(@v2,"",16)
# 输入法测试
@v3 = Viewport.new(260,193,320,20)
@v3.color.set(0,0,0,0)
@tf3 = Type_Field.new(@v3,"",16)
#-------------------------
#-------------------------
@message_12 = 0 #xinxi窗口控制
# 生成信息窗口
@message_window =W_xinxi.new
@message_window.x=245
@message_window.y=310
@message_window.width=150
@message_window.height=60
@message_window.back_opacity = 160
#-------------------------
# 执行过渡
Graphics.transition(40, "Graphics/Transitions/圆圈")
# 主循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新输入信息
Input.update
# 刷新画面
update
# 如果画面切换的话就中断循环
if $scene != self
break
end
end
# 准备过渡
Graphics.freeze
# 释放窗口
# 释放信息窗口
@message_window.dispose
#------------------
@sp.dispose
#------------------
# 输入法测试
@v3.dispose
@tf3.dispose
# 输入法测试
@v2.dispose
@tf2.dispose
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
if @message_window.visible == true
@message_12 +=1
if @message_12 == 20
@message_window.visible = false
@message_window.contents.clear
@message_12 = 0
end
end
if @shufa_up == nil
# 输入法测试
@tf2.update
# 输入法活动中返回
# @tf2.active = false
# 按下 C 键的情况下
if Input.trigger?(Input::F5)
if $shufa.length >12
@message_window.visible = true
@message_window.contents.draw_text(0, -6,120, 40, "你输入的字符太长")
b = 1
$shufa=""
@tf2.qingkong
@tf2.fuwei_biao
return
end
#------------------------------
for i in 0...$shufa_zu.length + 1
if $shufa_zu == " " or $shufa == ""
@message_window.visible = true
@message_window.contents.draw_text(0, -6,120, 40, "你输入了非法字符")
b = 1
break
end
end
# 输入法测试
if b != 1
@shufa_up = 0
@shufa_1 = $shufa
@tf2.qingkong_biao
$shufa = ""
end
end
if @tf2.active
return
end
end
if @shufa_up == 0
@tf3.update
# 按下 C 键的情况下
if Input.trigger?(Input::F5)
if $shufa.length >12
@message_window.visible = true
@message_window.contents.draw_text(0, -6,120, 40, "你输入的字符太长")
a = 1
$shufa=""
@tf3.qingkong
@tf3.fuwei_biao
return
end
#------------------------------
for i in 0...$shufa_zu.length + 1
if $shufa_zu == " " or $shufa == "" or $shufa_zu == "x"
@message_window.visible = true
@message_window.contents.draw_text(0, -6,120, 40, "你输入了非法字符")
a = 1
break
end
end
# 输入法测试
if a != 1
@shufa_2 = $shufa
@shufa_up = 1
@tf3.qingkong_biao
end
end
# 输入法活动中返回
if @tf3.active
return
end
end
if @shufa_up == 1
denglu
end
# 循环
# 刷新窗口
# 按下 B 键的情况下
#if Input.trigger?(Input::B)
# 演奏取消 SE
#$game_system.se_play($data_system.cancel_se)
# 切换到菜单画面
#$scene = Scene_Menu.new
# return
#end
end
#--------------------------------------------------------------------------
# ● 选择命令 登陆游戏时的处理
#------------------------------
#--------------------------------------------------
def denglu
#----------------------------------------------
#--------------------------------------------------
if @shufa_1==$data_system.switches[10] and @shufa_2== $data_system.switches[12]
$scene =Scene_Load.new
z = true
$zairu=@shufa_1
$congwu = $zairu
end
#--------------------------------------------------
if z == nil
@message_window.visible = true
@message_window.contents.draw_text(0, -6,120, 40, "用户密码错误")
@tf2.qingkong
@tf2.fuwei_biao
@tf3.qingkong
@tf3.fuwei_biao
@shufa_up = nil
$shufa = ""
end
#$shufa = nil
return
end
#--------------------------------------------------
end
|
|