赞 | 0 |
VIP | 2 |
好人卡 | 10 |
积分 | 1 |
经验 | 7625 |
最后登录 | 2014-3-16 |
在线时间 | 122 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 122 小时
- 注册时间
- 2008-7-3
- 帖子
- 724
|
下载了简易CG的那个教程,总觉得四张图片就要弄这么多东西,图片一多何等混乱?然后我下载了一个RM做的麻将游戏,那个游戏每打赢一场就会出一张CG,类似于CG鉴赏的东东……显示图片的脚本是这样的,可是我不懂脚本……这个可不可以做成CG系统呢?- class Scene_Enjoy < Scene_Sel
-
- def initialize(w,sum,m_name,wea)
- @w = (w - 1)
- @w == 0 ? @ma = $var.cg_w.dup[sum] : @ma = $var.cg_m.dup[sum]
- @max = @ma - 1
- @max = 2 if @max > 2
- @max = 0 if @max < 0
- @index = 0
- @sum = sum
- @m_name = m_name
- @wea = wea
- @imgname = [[['jjfz01','jjfz02','jjfz03'],['lgcr01','lgcr02','lgcr03'],
- ['slblm01','slblm02','slblm03'],['yj01','yj02','yj03'],
- ['zdmx01','zdmx02','zdmx03'],['lbl01','lbl02','lbl03']],
- [['ldh01','ldh02','ldh03'],['ymhd01','ymhd02','ymhd03'],
- ['mxle01','mxle02','mxle03'],['dark01','dark02','dark03'],
- ['vitas01','vitas02','vitas03'],['asl01','asl02','asl03']]
- ]
- @img = Sprite.new
- @img.bitmap = RPG::Cache.picture('CG/' + @imgname[@w][@sum][0])
- @viewport_s = Viewport.new(0, 0, 640, 480)
- @viewport_s.z = 9999
- @weather = RPG::Weathernew.new(@viewport_s)
- end
-
- def main
-
- Audio.bgm_play("Audio/BGM/MUSIC/" + @m_name, 100, 100)
- Graphics.transition(40, 'Graphics/Transitions/c01')
- loop do
- Graphics.update
- Input.update
- update
- if $scene != self
- break
- end
- end
- @img.bitmap.dispose
- @img.dispose
- @weather.dispose
- @viewport_s.dispose
-
- end
-
- def update
- @weather.type = @wea[0]
- @weather.max = @wea[1]
- @weather.ox = @wea[2]
- @weather.oy = @wea[3]
- @weather.update
- in_res
- end
-
- def in_res
- if Input.repeat?(Input::LEFT)
- est_sound('change')
- Graphics.freeze
- @index -= 1
- @index = @max if @index < 0
- @img.bitmap = RPG::Cache.picture('CG/' + @imgname[@w][@sum][@index])
- Graphics.transition(40, 'Graphics/Transitions/c02')
- return
- end
- if Input.repeat?(Input::RIGHT)
- est_sound('change')
- Graphics.freeze
- @index += 1
- @index = 0 if @index > @max
- @img.bitmap = RPG::Cache.picture('CG/' + @imgname[@w][@sum][@index])
- Graphics.transition(40, 'Graphics/Transitions/c01')
- return
- end
- if Input.repeat?(Input::B)
- est_sound('change')
- Graphics.freeze
- @w == 0 ? $scene = Scene_Sel_W.new : $scene = Scene_Sel_M.new
- return
- end
- end
-
- end
复制代码 |
|