查看: 2158|回复: 2

[已经过期] 脚本出现syntaxError错误

[复制链接]
梦石
0
星屑
50
在线时间
47 小时
注册时间
2016-8-12
回帖
23
发表于 2016-9-5 20:56:49 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
从别人家弄了个脚本结果怎么都是这样的错误 该怎么办


  1. class Scene_Staff

  2. def initialize(return_scene = nil)
  3.     @sprite = Sprite.new
  4.     @sprite.bitmap = Bitmap.new("Graphics/Panoramas/007-Ocean01")
  5.     @sprite.x = 0
  6.     @sprite.y = 0
  7.     if return_scene.nil?
  8.       return_scene = Scene_Title.new
  9.     end
  10.     @return_scene = return_scene
  11.   end
  12.   
  13.   def scene_start
  14.     credit_lines = CREDIT.split(/\n/)
  15.     credit_bitmap = Bitmap.new(640,32 * credit_lines.size)
  16.     credit_lines.each_index do |i|
  17.       line = credit_lines[i]
  18.       credit_bitmap.draw_text(0,i * 32,640,32,line,1)
  19.     end
  20.     @credit_sprite = Sprite.new(Viewport.new(0,50,640,380))
  21.     @credit_sprite.bitmap = credit_bitmap
  22.     @credit_sprite.oy = -430
  23.     @frame_index = 0
  24.     @last_flag = false
  25.   end

  26.   def scene_end
  27.     @credit_sprite.dispose
  28.     @sprite.dispose
  29.   end
  30.   
  31.   def last?
  32.     return (@frame_index >= @credit_sprite.bitmap.height + 480)
  33.   end
  34.   
  35.   def last
  36.     if not @last_flag
  37.       Audio.bgm_fade(10000)
  38.       @last_flag = true
  39.       @last_count = 0
  40.     else
  41.       @last_count += 1
  42.     end
  43.     if @last_count >= 300
  44.       $scene = @return_scene
  45.     end
  46.   end
  47.   
  48.   def update
  49.     @frame_index += 1
  50.     return if cancel?
  51.     last if last?
  52.     @credit_sprite.oy += 1
  53.   end

  54.   def cancel?
  55.     if Input.trigger?(Input::B)
  56.       $scene = @return_scene
  57.       return true
  58.     end
  59.     return false
  60.   end

  61.   def main
  62.     scene_start
  63.     # 过渡
  64.     Graphics.transition
  65.     # 主循环
  66.     loop do
  67.       Graphics.update
  68.       Input.update
  69.       update
  70.       if $scene != self
  71.         break
  72.       end
  73.     end
  74.     # 准备过渡
  75.     Graphics.freeze
  76.     scene_end
  77.   end
  78. end
复制代码
梦石
0
星屑
1788
在线时间
1313 小时
注册时间
2012-8-4
回帖
724
发表于 2016-9-5 23:05:46 | 显示全部楼层
没有分裂的内容
  1. class Scene_Staff
  2. CREDIT=<<_END_
  3.   从前有个人见人爱的小姑娘,
  4.   喜欢戴着外婆送给她的一顶红色天鹅绒的帽子,
  5.   于是大家就叫她小红帽。有一天,
  6.   母亲叫她给住在森林的外婆送食物,
  7.   并嘱咐她不要离开大路,走得太远。
  8.   小红帽在森林中遇见了狼,她从未见过狼,
  9.   也不知道狼性凶残,于是告诉了狼她要去森林里
  10.   看望自己的外婆。狼知道后诱骗小红帽去采野花,
  11.   自己到林中小屋把小红帽的外婆吃了。后来他伪
  12.   装成外婆,等小红帽来找外婆时,狼一口把她吃
  13.   掉了。幸好后来一个勇敢的猎人把小红帽和外婆
  14.   从狼肚里救了出来。
  15. _END_
  16.   
  17.   
  18. def initialize(return_scene = nil)
  19.     @sprite = Sprite.new
  20.     @sprite.bitmap = Bitmap.new("Graphics/Panoramas/007-Ocean01")
  21.     @sprite.x = 0
  22.     @sprite.y = 0
  23.     if return_scene.nil?
  24.       return_scene = Scene_Title.new
  25.     end
  26.     @return_scene = return_scene
  27.   end

  28.   def scene_start
  29.     credit_lines = CREDIT.split(/\n/)
  30.     credit_bitmap = Bitmap.new(640,32 * credit_lines.size)
  31.     credit_lines.each_index do |i|
  32.       line = credit_lines[i]
  33.       credit_bitmap.draw_text(0,i * 32,640,32,line,1)
  34.     end
  35.     @credit_sprite = Sprite.new(Viewport.new(0,50,640,380))
  36.     @credit_sprite.bitmap = credit_bitmap
  37.     @credit_sprite.oy = -430
  38.     @frame_index = 0
  39.     @last_flag = false
  40.   end

  41.   def scene_end
  42.     @credit_sprite.dispose
  43.     @sprite.dispose
  44.   end

  45.   def last?
  46.     return (@frame_index >= @credit_sprite.bitmap.height + 480)
  47.   end

  48.   def last
  49.     if not @last_flag
  50.       Audio.bgm_fade(10000)
  51.       @last_flag = true
  52.       @last_count = 0
  53.     else
  54.       @last_count += 1
  55.     end
  56.     if @last_count >= 300
  57.       $scene = @return_scene
  58.     end
  59.   end

  60.   def update
  61.     @frame_index += 1
  62.     return if cancel?
  63.     last if last?
  64.     @credit_sprite.oy += 1
  65.   end

  66.   def cancel?
  67.     if Input.trigger?(Input::B)
  68.       $scene = @return_scene   
  69.       return true
  70.     end
  71.     return false
  72.   end

  73.   def main
  74.     scene_start
  75.     # 过渡
  76.     Graphics.transition
  77.     # 主循环
  78.     loop do
  79.       Graphics.update
  80.       Input.update
  81.       update
  82.       if $scene != self
  83.         break
  84.       end
  85.     end
  86.     # 准备过渡
  87.     Graphics.freeze
  88.     scene_end
  89.   end
  90. end
复制代码

点评

谢谢  发表于 2016-9-6 20:57
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部