game.loading do |loader|
loader.add :window, :system => "window"
loader.add :gui_item, :system => "gui_item"
loader.add :bac, 34#選択肢背景
loader.add :menu, 237#メニューバー
loader.add :menu_g, 240#メニュー画面
loader.add :sise_g, 247#施設LV変更画面
loader.add :save_g, 248#セーブロード画面
loader.add :item_g, 249#アイテムメニュー
loader.add :ikosami_g, 250
end
#関数
Variable = {}
def SV(a,b)
Variable[a] = b
end
def GV(a)
Variable[a]
end
def SAVE()
game.load_wait do |loader|
loader.save_data "test", [GV(:Is),GV(:sl),GV(:Ts),GV(:G),GV(:ten),GV(:z),GV(:day),GV(:IsM),GV(:Isd),GV(:sn),GV(:iss),GV(:ites)]
end
end
def SAVE2()
game.load_wait do |loader|
loader.save_data "test2", [GV(:Is),GV(:sl),GV(:Ts),GV(:G),GV(:ten),GV(:z),GV(:day),GV(:IsM),GV(:Isd),GV(:sn),GV(:iss),GV(:ites)]
end
end
def LOAD()
game.loading do |loader|
loader.load_data :game_data, "test"
end
wait_time(500)
date = game.loaded_data[:game_data]
SV(:Is,date[0])
SV(:sl,date[1])
SV(:Ts,date[2])
SV(:G, date[3])
SV(:ten,date[4])
SV(:z, date[5])
SV(:day,date[6])
SV(:IsM,date[7])
SV(:Isd,date[8])
SV(:sn,date[9])
SV(:iss,date[10])
SV(:ites,date[11])
end
def LOAD2()
game.loading do |loader|
loader.load_data :game_data, "test2"
end
wait_time(500)
date = game.loaded_data[:game_data]
SV(:Is,date[0])
SV(:sl,date[1])
SV(:Ts,date[2])
SV(:G, date[3])
SV(:ten,date[4])
SV(:z, date[5])
SV(:day,date[6])
SV(:IsM,date[7])
SV(:Isd,date[8])
SV(:sn,date[9])
SV(:iss,date[10])
SV(:ites,date[11])
end
game.on_init do
set_window_image :window
set_gui_image :gui_item
scene_change :Setting
end
scene :Setting do |scene|
SV(:Is,50) #いこさみの数
SV(:Isd,10) #減ってしまったいこさみの数
SV(:IsM,50) #いこさみの最高数
SV(:Ts,1000) #貯水量
SV(:sl,[1, 1, 1]) #貯水量,増水量,生産(1~99)
SV(:sn,[1000, 1000, 1000]) #施設値段(買うたび増える)
SV(:G,500) #所持金
SV(:ten,5) #天気
SV(:z,10) #時間(10になると1日経過)
SV(:day,0) #日にち(主にクリアタイム計測に使用)
SV(:te,["快晴","晴れ","小雨"," 雨 ","大雨"])#天気名称
SV(:tez,[0, 0, 3, 7, 15])#天気による貯水率
SV(:ite,[0,0,0])#アイテム使用状況
SV(:ites,[1, 1, 1])#アイテム数
SV(:iss,0)
SV(:isk,["いこさみが2倍になりました。\nこの調子でいきましょう!","このゲームは30日に一度オートセーブされます。","海水処理施設は、水の供給が増えますが\n20日で壊れます","人口太陽があれば雨の日でもいこさみが増えます。ただ20日で壊れます","村祭りを行うと、活気が上がります。\n減っているほど上がりやすいです","だいぶ増えましたね。この調子です","かなり増えてきましたね!","アイテムは連続使用可能です","施設が小さいとアイテムも安いです\n安いうちに買いだめしましょう","すごくふえましたね!","いこさみが山のようです","活気が減ったら村祭りしましょう!","クリアに近づいてきました!","あと少しです!!","遂に・・・"])
SV(:Ihs,[100,500,1000,5000,10000,50000,100000,500000,1000000,5000000,10000000,10000000,50000000,100000000,200000000])
scene.add :image, :texture => :bac, :align => :fullscreen#背景の表示
t = scene.text :position => [305, 105]
t.set_text_area_size 158, 32
t.set_font_point_size 28
t.set_color 0, 0, 0, 255
t.set_text "はじめから"
t.event :on_click do |event|
t.delete
speak "このゲームは、とにかく[いこさみ]という生き物を増やすゲームです。"
speak "いこさみは、水と光さえあれば\n生きていける植物の様な生き物です。"
speak "いこさみ達は、人間のような知能を\n持っていて、村をつくって住んでいます。"
speak "このゲームの村には、水を貯める貯水施設水をあつめる集水施設"
speak "物を生産して売り資金を稼ぐ\n生産施設があります。"
speak "それぞれの施設を、資金を使って\nレベルアップすれば、村が発展します。"
speak "いこさみは水がないと生きていけません"
speak "どうしても水の供給が間に合わなければ\nアイテムを使いましょう"
speak "30日に一度、いこさみの数だけ\nボーナスが入りますが"
speak "生産施設のレベルが低すぎると、\nボーナス金が制限されます。"
speak "施設のレベルアップやアイテムの購入\nセーブロードはメニューからできます"
speak "活気は、いこさみが減ると減り\n0になるとゲームオーバーです"
speak "一定以上増えればクリアになります\nそれでは始まります!"
scene_change :main
end
t = scene.text :position => [305, 305]
t.set_text_area_size 158, 32
t.set_font_point_size 28
t.set_color 0, 0, 0, 255
t.set_text "つづきから"
t.event :on_click do |event|
LOAD()
speak "ロードしました"
scene_change :main
end
end
# メイン
scene :main do |scene|
scene.add :image, :texture => :bac, :align => :fullscreen#背景の表示
scene.add :image, :name => :menu, :template => :menu_temp, :center_position => [400, 425]
scene.on_init do
loop = true
t = scene.text :position => [5, 35]
t.set_text_area_size 128, 32
t.set_font_point_size 28
t.set_color 0, 0, 0, 255
t.set_text "水量"
t = scene.text :position => [5, 65]
t.set_text_area_size 700, 32
t.set_font_point_size 28
t.set_color 0, 0, 0, 255
t.set_text "貯水施設 Lv"+GV(:sl)[0].to_s+" 集水施設 Lv"+GV(:sl)[1].to_s+" 生産施設 Lv"+GV(:sl)[2].to_s
zt = scene.text :position => [355, 5]
zt.set_text_area_size 198, 32
zt.set_font_point_size 28
zt.set_color 0, 0, 0, 255
zt.set_text GV(:day).to_s+ "日目 ("+GV(:te)[GV(:ten)].to_s+")"
i = 0
while i < GV(:iss) * GV(:iss) * 2
scene.add :image, :name => :i1, :template => :ikosami, :position => [rand(750)+32, rand(220)+130]
i = i + 1
end
while loop
Is = GV(:Is)
z = GV(:z)+1
SV(:z,z)
Ts = GV(:Ts).to_i
G = GV(:G)
Gh = G.to_i#表示用
if z >= 10#一日の始まり
if (GV(:day) / 30).to_i * 30 == GV(:day)
SAVE()
pg = GV(:Is)
if GV(:sn)[2] * 2 < GV(:Is)
pg = GV(:sn)[2] * 2
end
G = G + pg
end
i = 0
while i < 3
if GV(:ite)[i] > 0
GV(:ite)[i] = GV(:ite)[i] - 1
end
i = i + 1
end
SV(:day,GV(:day)+1)
SV(:z,0)
SV(:ten,rand(5))
if Ts == 0
if rand(100) < 60
SV(:ten,4)
end
end
zt.delete
zt = scene.text :position => [345, 5]
zt.set_text_area_size 308, 32
zt.set_font_point_size 28
zt.set_color 0, 0, 0, 255
zt.set_text GV(:day).to_s+ "日目 ("+GV(:te)[GV(:ten)].to_s+")"
end
h = ""
if GV(:ite)[0] > 0
h = "海水処理装置作動中:" + GV(:ite)[0].to_s
end
if GV(:ite)[1] > 0
h = h + " 人工太陽作動中:" + GV(:ite)[1].to_s
end
kakki = (GV(:IsM)*1.5 - (GV(:Isd) / 1.6)).to_i
if kakki < 1
loop = false
wait_time 100
scene_change :gameover
end
mt = scene.text :position => [5, 95]
mt.set_text_area_size 800, 32
mt.set_font_point_size 28
mt.set_color 0, 0, 0, 255
mt.set_text "活気 " + ((kakki/GV(:IsM)*1000).to_i / 10).to_s + "% " + h
Is2 = Is.to_i
it = scene.text :position => [5, 5]
it.set_text_area_size 305, 32
it.set_font_point_size 28
it.set_color 0, 0, 0, 255
it.set_text "いこさみ " + Is2.to_s
gt = scene.text :position => [555, 5]
gt.set_text_area_size 208, 32
gt.set_font_point_size 28
gt.set_color 0, 0, 0, 255
gt.set_text Gh.to_s+ "G"
tz = (GV(:tez)[GV(:ten)].to_i) * GV(:sl)[1] * GV(:sl)[1] * GV(:sl)[1] * 2
if GV(:ite)[0] > 0
Ts = Ts + (5 * GV(:sl)[1] * GV(:sl)[1] * GV(:sl)[1])
end
if Ts < 1#水不足表示
h = " 水枯渇で、いこさみが減っています!!"
elsif tz > 0
h = " 水が溜まっています"
else
h = " 水が減っています"
end
Ts = Ts + tz - (Is/15)#貯水量変化
if Ts > GV(:sl)[0] * GV(:sl)[0] * GV(:sl)[0] * GV(:sl)[0] * 50
Ts = GV(:sl)[0] * GV(:sl)[0] * GV(:sl)[0] * GV(:sl)[0] * 50
h = "水が満タンです"
end
if Ts < 1#貯水量がなければ減る
Ts = 0
Is = Is / 1.0007
SV(:Isd,GV(:Isd)+(GV(:Is)-Is))
elsif GV(:ten) < 3
Is = Is*1.003
if GV(:ten) < 2#晴なら倍増える
Is = Is*1.003
end
elsif GV(:ite)[1] > 0#人工太陽発動中なら雨でも増える
Is = Is*1.004
end
Ts = Ts.to_i
tt = scene.text :position => [150, 35]
tt.set_text_area_size 600, 32
tt.set_font_point_size 28
tt.set_color 0, 0, 0, 255
tt.set_text Ts.to_s + h
scene.event :menu, :on_click do
loop = false
scene_change :menu
end
if Is > GV(:IsM)
SV(:IsM,Is)
if GV(:IsM) > GV(:Ihs)[GV(:iss)]
it.set_text "いこさみ " + (Is.to_i).to_s
speak "いこさみが、" + GV(:Ihs)[GV(:iss)].to_s + "体を超えました!"
speak GV(:isk)[GV(:iss)].to_s
if GV(:Ihs)[GV(:iss)] >= 200000000
loop = false
scene_change :gameclear
end
SV(:iss,GV(:iss) + 1)
end
end
G = G + (1.5 * (GV(:sn)[2] / 1000))
if G > 999999999
G = 999999999
end
if Is > 999999999
Is = 999999999
end
SV(:Is,Is)
SV(:G,G)
SV(:Ts,Ts)
wait_time 50
it.delete
gt.delete
tt.delete
mt.delete
end
end
end
scene :menu do |scene|
scene.add :image, :texture => :bac, :align => :fullscreen#背景の表示
st1 = scene.add :image, :name => :menu_g1, :template => :menug, :position => [0-400, 0-225]
st1.set_rects [ 0, 0, 400, 225], [255, 255, 255, 255], [0, 0, 400, 225]
st2 = scene.add :image, :name => :menu_g2, :template => :menug, :position => [400-400, 0-225]
st2.set_rects [ 0, 0, 400, 225], [255, 255, 255, 255], [400, 0, 400, 225]
st3 = scene.add :image, :name => :menu_g3, :template => :menug, :position => [0-400, 225-225]
st3.set_rects [ 0, 0, 400, 225], [255, 255, 255, 255], [0, 225, 400, 225]
st4 = scene.add :image, :name => :menu_g4, :template => :menug, :position => [400-400, 225-225]
st4.set_rects [ 0, 0, 400, 225], [255, 255, 255, 255], [400, 225, 400, 225]
scene.on_init do
scene.event :menu_g1, :on_click do
scene_change :sise
end
scene.event :menu_g2, :on_click do
scene_change :item
end
scene.event :menu_g3, :on_click do
scene_change :set
end
scene.event :menu_g4, :on_click do
scene_change :main
end
end
end
#施設レベル変更画面sise_g
scene :sise do |scene|
scene.add :image, :texture => :bac, :align => :fullscreen#背景の表示
st1 = scene.add :image, :name => :si_g1, :template => :siseg, :position => [-400, -225]
st1.set_rects [ 0, 0, 200, 450], [255, 255, 255, 255], [0, 0, 200, 450]
st2 = scene.add :image, :name => :si_g2, :template => :siseg, :position => [-200, -225]
st2.set_rects [ 0, 0, 200, 450], [255, 255, 255, 255], [200, 0, 200, 450]
st3 = scene.add :image, :name => :si_g3, :template => :siseg, :position => [0, -225]
st3.set_rects [ 0, 0, 200, 450], [255, 255, 255, 255], [400, 0, 200, 450]
st4 = scene.add :image, :name => :si_g4, :template => :siseg, :position => [200, -225]
st4.set_rects [ 0, 0, 200, 450], [255, 255, 255, 255], [600, 0, 200, 450]
scene.on_init do
tt = scene.text :position => [30, 55]
tt.set_text_area_size 208, 232
tt.set_font_point_size 28
tt.set_color 0, 0, 0, 255
if GV(:sl)[0] == 99
tt.set_text "Lv MAX"
else
tt.set_text "Lv" + GV(:sl)[0].to_s + "\n費用\n" + (GV(:sn)[0].to_i).to_s + "G"
end
ss = scene.text :position => [235, 55]
ss.set_text_area_size 208, 232
ss.set_font_point_size 28
ss.set_color 0, 0, 0, 255
if GV(:sl)[0] == 99
tt.set_text "Lv MAX"
else
ss.set_text "Lv" + GV(:sl)[1].to_s + "\n費用\n" + (GV(:sn)[1].to_i).to_s + "G"
end
st = scene.text :position => [435, 55]
st.set_text_area_size 208, 232
st.set_font_point_size 28
st.set_color 0, 0, 0, 255
if GV(:sl)[0] == 99
tt.set_text "Lv MAX"
else
st.set_text "Lv" + GV(:sl)[2].to_s + "\n費用\n" + (GV(:sn)[2].to_i).to_s + "G"
end
g = scene.text :position => [635, 1]
g.set_text_area_size 208, 32
g.set_font_point_size 28
g.set_color 0, 0, 0, 255
g.set_text (GV(:G).to_i).to_s + "G"
scene.event :si_g1, :on_click do
if GV(:G) > GV(:sn)[0]
SV(:G,GV(:G) - (GV(:sn)[0]))
GV(:sl)[0] = GV(:sl)[0] + 1
GV(:sn)[0] = GV(:sn)[0] *1.1514
tt.delete
g.delete
tt = scene.text :position => [30, 55]
tt.set_text_area_size 208, 232
tt.set_font_point_size 28
tt.set_color 0, 0, 0, 255
if GV(:sl)[0] == 99
tt.set_text "Lv MAX"
else
tt.set_text "Lv" + GV(:sl)[0].to_s + "\n費用\n" + (GV(:sn)[0].to_i).to_s + "G"
end
g = scene.text :position => [635, 1]
g.set_text_area_size 208, 32
g.set_font_point_size 28
g.set_color 0, 0, 0, 255
g.set_text (GV(:G).to_i).to_s + "G"
else
speak "資金が足りません"
end
end
scene.event :si_g2, :on_click do
if GV(:G) > GV(:sn)[1]
SV(:G,GV(:G) - (GV(:sn)[1]))
GV(:sl)[1] = GV(:sl)[1] + 1
GV(:sn)[1] = GV(:sn)[1] *1.1514
ss.delete
g.delete
ss = scene.text :position => [230, 55]
ss.set_text_area_size 208, 232
ss.set_font_point_size 28
ss.set_color 0, 0, 0, 255
if GV(:sl)[1] == 99
ss.set_text "Lv MAX"
else
ss.set_text "Lv" + GV(:sl)[1].to_s + "\n費用\n" + (GV(:sn)[1].to_i).to_s + "G"
end
g = scene.text :position => [635, 1]
g.set_text_area_size 208, 32
g.set_font_point_size 28
g.set_color 0, 0, 0, 255
g.set_text (GV(:G).to_i).to_s + "G"
else
speak "資金が足りません"
end
end
scene.event :si_g3, :on_click do
if GV(:G) > GV(:sn)[2]
SV(:G,GV(:G) - (GV(:sn)[2]))
GV(:sl)[2] = GV(:sl)[2] + 1
GV(:sn)[2] = GV(:sn)[2] *1.1514
st.delete
g.delete
st = scene.text :position => [430, 55]
st.set_text_area_size 208, 232
st.set_font_point_size 28
st.set_color 0, 0, 0, 255
if GV(:sl)[2] == 99
st.set_text "Lv MAX"
else
st.set_text "Lv" + GV(:sl)[2].to_s + "\n費用\n" + (GV(:sn)[2].to_i).to_s + "G"
end
g = scene.text :position => [635, 1]
g.set_text_area_size 208, 32
g.set_font_point_size 28
g.set_color 0, 0, 0, 255
g.set_text (GV(:G).to_i).to_s + "G"
else
speak "資金が足りません"
end
end
scene.event :si_g4, :on_click do
loop = false
scene_change :main
end
end
end
#アイテム
scene :item do |scene|
scene.add :image, :texture => :bac, :align => :fullscreen#背景の表示
wait_time(100)
st1 = scene.add :image, :name => :g1, :template => :iteg, :position => [-400, -225]
st1.set_rects [ 0, 0, 200, 225], [255, 255, 255, 255], [0, 0, 200, 225]
st2 = scene.add :image, :name => :g2, :template => :iteg, :position => [-200, -225]
st2.set_rects [ 0, 0, 200, 225], [255, 255, 255, 255], [200, 0, 200, 225]
st3 = scene.add :image, :name => :g3, :template => :iteg, :position => [0, -225]
st3.set_rects [ 0, 0, 200, 225], [255, 255, 255, 255], [400, 0, 200, 225]
st4 = scene.add :image, :name => :g4, :template => :saveg, :position => [200, -225]
st4.set_rects [ 0, 0, 200, 450], [255, 255, 255, 255], [600, 0, 200, 450]
st1a = scene.add :image, :name => :ga1, :template => :iteg, :position => [-400, 0]
st1a.set_rects [ 0, 0, 200, 225], [255, 255, 255, 255], [0, 225, 200, 225]
st2a = scene.add :image, :name => :ga2, :template => :iteg, :position => [-200, 0]
st2a.set_rects [ 0, 0, 200, 225], [255, 255, 255, 255], [200, 225, 200, 225]
st3a = scene.add :image, :name => :ga3, :template => :iteg, :position => [0, 0]
st3a.set_rects [ 0, 0, 200, 225], [255, 255, 255, 255], [400, 225, 200, 225]
scene.on_init do
tt = scene.text :position => [30, 55]
tt.set_text_area_size 208, 532
tt.set_font_point_size 28
tt.set_color 0, 0, 0, 255
tt.set_text "購入\n値段(20日分)\n" + ((GV(:sn)[1]/2).to_i).to_s + "G\n\n\n\n" + GV(:ites)[0].to_s+ "装置所持\n使用"
ss = scene.text :position => [235, 55]
ss.set_text_area_size 208, 532
ss.set_font_point_size 28
ss.set_color 0, 0, 0, 255
ss.set_text "購入\n値段(20日分)\n" + ((GV(:sn)[0]/4).to_i).to_s + "G\n\n\n\n" + GV(:ites)[1].to_s + "施設所持\n使用"
st = scene.text :position => [435, 55]
st.set_text_area_size 208, 532
st.set_font_point_size 28
st.set_color 0, 0, 0, 255
st.set_text "購入\n値段(1回分)\n" + ((GV(:sn)[2]/1.2).to_i).to_s + "G\n\n\n\n" + GV(:ites)[2].to_s + "企画所持\n使用"
g = scene.text :position => [635, 1]
g.set_text_area_size 208, 32
g.set_font_point_size 28
g.set_color 0, 0, 0, 255
g.set_text (GV(:G).to_i).to_s + "G"
scene.event :g1, :on_click do
if GV(:G) > (GV(:sn)[1] / 2).to_i
SV(:G,GV(:G) - (GV(:sn)[1] / 2).to_i)
GV(:ites)[0] = GV(:ites)[0] + 1
g.delete
g = scene.text :position => [635, 1]
g.set_text_area_size 208, 32
g.set_font_point_size 28
g.set_color 0, 0, 0, 255
g.set_text (GV(:G).to_i).to_s + "G"
tt.delete
tt = scene.text :position => [30, 55]
tt.set_text_area_size 208, 532
tt.set_font_point_size 28
tt.set_color 0, 0, 0, 255
tt.set_text "購入\n値段(20日分)\n" + ((GV(:sn)[1]/2).to_i).to_s + "G\n\n\n\n" + GV(:ites)[0].to_s+ "装置所持\n使用"
else
speak "資金が足りません"
end
end
scene.event :g2, :on_click do
if GV(:G) > (GV(:sn)[0]/4).to_i
SV(:G,GV(:G) - (GV(:sn)[0]/4)).to_i
GV(:ites)[1] = GV(:ites)[1] + 1
g.delete
g = scene.text :position => [635, 1]
g.set_text_area_size 208, 32
g.set_font_point_size 28
g.set_color 0, 0, 0, 255
g.set_text (GV(:G).to_i).to_s + "G"
ss.delete
ss = scene.text :position => [235, 55]
ss.set_text_area_size 208, 532
ss.set_font_point_size 28
ss.set_color 0, 0, 0, 255
ss.set_text "購入\n値段(20日分)\n" + ((GV(:sn)[0]/4).to_i).to_s + "G\n\n\n\n" + GV(:ites)[1].to_s + "施設所持\n使用"
else
speak "資金が足りません"
end
end
scene.event :g3, :on_click do
if GV(:G) > (GV(:sn)[2]/1.2).to_i
SV(:G,GV(:G) - (GV(:sn)[2]/1.2)).to_s
GV(:ites)[2] = GV(:ites)[2] + 1
g.delete
g = scene.text :position => [635, 1]
g.set_text_area_size 208, 32
g.set_font_point_size 28
g.set_color 0, 0, 0, 255
g.set_text (GV(:G).to_i).to_s + "G"
st.delete
st = scene.text :position => [435, 55]
st.set_text_area_size 208, 532
st.set_font_point_size 28
st.set_color 0, 0, 0, 255
st.set_text "購入\n値段(1回分)\n" + ((GV(:sn)[2]/1.2).to_i).to_s + "G\n\n\n\n" + GV(:ites)[2].to_s + "企画所持\n使用"
else
speak "資金が足りません"
end
end
scene.event :g4, :on_click do
scene_change :main
end
scene.event :ga1, :on_click do
if GV(:ites)[0] > 0
GV(:ites)[0] = GV(:ites)[0] - 1
GV(:ite)[0] = GV(:ite)[0] +20
speak "海水処理装置 効果発動!"
tt.delete
tt = scene.text :position => [30, 55]
tt.set_text_area_size 208, 532
tt.set_font_point_size 28
tt.set_color 0, 0, 0, 255
tt.set_text "購入\n値段(20日分)\n" + ((GV(:sn)[1]/2).to_i).to_s + "G\n\n\n\n" + GV(:ites)[0].to_s+ "施設所持\n使用"
else
speak "アイテムがありません"
end
end
scene.event :ga2, :on_click do
if GV(:ites)[1] > 0
GV(:ites)[1] = GV(:ites)[1] - 1
GV(:ite)[1] = GV(:ite)[1] +20
speak "人工太陽 効果発動!"
ss.delete
ss = scene.text :position => [235, 55]
ss.set_text_area_size 208, 532
ss.set_font_point_size 28
ss.set_color 0, 0, 0, 255
ss.set_text "購入\n値段(20日分)\n" + ((GV(:sn)[0]/4).to_i).to_s + "G\n\n\n\n" + GV(:ites)[1].to_s + "施設所持\n使用"
else
speak "アイテムがありません"
end
end
scene.event :ga3, :on_click do
if GV(:ites)[2] > 0
GV(:ites)[2] = GV(:ites)[2] - 1
SV(:Isd,GV(:Isd) * 0.5)
speak "村祭りの企画 効果発動!"
st.delete
st = scene.text :position => [435, 55]
st.set_text_area_size 208, 532
st.set_font_point_size 28
st.set_color 0, 0, 0, 255
st.set_text "購入\n値段(1回分)\n" + ((GV(:sn)[2]/1.2).to_i).to_s + "G\n\n\n\n" + GV(:ites)[2].to_s + "企画所持\n使用"
else
speak "アイテムがありません"
end
end
end
end
#設定画面 まだ画像が未完成
scene :set do |scene|
scene.add :image, :texture => :bac, :align => :fullscreen#背景の表示
st1 = scene.add :image, :name => :g1, :template => :saveg, :position => [-400, -225]
st1.set_rects [ 0, 0, 200, 450], [255, 255, 255, 255], [0, 0, 200, 450]
st2 = scene.add :image, :name => :g2, :template => :saveg, :position => [-200, -225]
st2.set_rects [ 0, 0, 200, 450], [255, 255, 255, 255], [200, 0, 200, 450]
st3 = scene.add :image, :name => :g3, :template => :saveg, :position => [0, -225]
st3.set_rects [ 0, 0, 200, 450], [255, 255, 255, 255], [400, 0, 200, 450]
st4 = scene.add :image, :name => :g4, :template => :saveg, :position => [200, -225]
st4.set_rects [ 0, 0, 200, 450], [255, 255, 255, 255], [600, 0, 200, 450]
scene.on_init do
g = scene.text :position => [635, 1]
g.set_text_area_size 208, 32
g.set_font_point_size 28
g.set_color 0, 0, 0, 255
g.set_text (GV(:G).to_i).to_s + "G"
scene.event :g1, :on_click do
SAVE2()
speak "セーブしました"
end
scene.event :g2, :on_click do
LOAD()
speak "ロードしました"
end
scene.event :g3, :on_click do
LOAD2()
speak "ロードしました"
end
scene.event :g4, :on_click do
scene_change :main
end
end
end
scene :gameover do |scene|
scene.add :image, :texture => :bac, :align => :fullscreen#背景の表示
scene.on_init do
speak("村が滅んでしまった・・・")
speak("残された いこさみ達は安息に暮らせる\n場所を求めて旅に出るのであった・・")
wait_time 1000
speak("水がないと、いこさみは生きていけません\n水を絶やさないようにしましょう")
speak("最初からはじめるか、セーブデータから/n初めてください")
scene_change :Setting
end
end
scene :gameclear do |scene|
scene.add :image, :texture => :bac, :align => :fullscreen#背景の表示
scene.on_init do
speak("いこさみが、遂に地を覆いました!")
speak("今回の記録は" + GV(:day).to_s + "日でした!")
speak("ゲームクリアおめでとうございます!!")
wait_time(1000)
speak("ゲーム企画:カラガラ\nメインプログラム・画像:ikosami")
wait_time(1000)
game.change_project "start_menu"
end
end
sprite_template :menu_temp do |st|
st.texture :menu
st.src_size 800, 50
st.dest_size 800, 50
st.collision :rect, :position => [0, 0], :width => [800, 50]
end
#メニュー
sprite_template :menug do |st|
st.texture :menu_g
st.src_size 800, 450
st.dest_size 800, 450
st.collision :rect, :position => [400, 225], :width => [400, 225]
end
#セーブ
sprite_template :saveg do |st|
st.texture :save_g
st.src_size 800, 450
st.dest_size 800, 450
st.collision :rect, :position => [400, 225], :width => [400, 450]
end
#施設メニュー
sprite_template :siseg do |st|
st.texture :sise_g
st.src_size 800, 450
st.dest_size 800, 450
st.collision :rect, :position => [400, 225], :width => [200, 450]
end
#アイテムメニュー
sprite_template :iteg do |st|
st.texture :item_g
st.src_size 800, 450
st.dest_size 800, 450
st.collision :rect, :position => [400, 225], :width => [200, 225]
end
#いこさみ
sprite_template :ikosami do |st|
st.texture :ikosami_g
st.src_size 32, 32
st.dest_size 32, 32
st.center_offset 0, 0
#当たり判定
st.collision :rect, :position => [0, 0], :width => [32, 32]
st.motion :default do |commands|
commands.loop false
commands.proc_call do |sprite|
sprite.change_animation :anim
end
end
st.animation :anim do |commands|
commands.loop true
commands.copy_rect :frame => 6, :src => [0, 0]
commands.wait_animation
commands.copy_rect :frame => 6, :src => [1, 0]
commands.wait_animation
commands.copy_rect :frame => 6, :src => [2, 0]
commands.wait_animation
commands.copy_rect :frame => 6, :src => [3, 0]
commands.wait_animation
commands.copy_rect :frame => 6, :src => [2, 0]
commands.wait_animation
commands.copy_rect :frame => 6, :src => [1, 0]
commands.wait_animation
end
end