「ぷちくいず」基本スクリプト
投稿者: aoihikawa 投稿日:2011/07/23 15:52
ぷちくいず - 【ノベルゲーム】
シーン素材はこちら
以下スクリプト(ご自由にご利用ください)
------------------------------
ツイート
シーン素材はこちら
以下スクリプト(ご自由にご利用ください)
------------------------------
setMenuItemVisible(getMenuBackLog(), false) setMenuItemVisible(getMenuSave(), false) setMenuItemVisible(getMenuLoad(), false) setHelpVisible(false) setCanvasVisible(false) deleteAllSprite() drawCanvas() mondai = createArray() kotae1 = createArray() kotae2 = createArray() kotae3 = createArray() kotae4 = createArray() #_/_/_/_/_/_/_/_/_/_/_/_/ 設定ここから _/_/_/_/_/_/_/_/_/_/_/_/ #-----立ち絵の設定----- img_char_no = 00000 #立ち絵素材番号(イラストサイズ 縦 555px / 横 300px) #-----BGM・サウンドの設定----- bgm_main = 00000 #ゲーム中BGM bgm_gameend = 00000 #結果表示BGM bgm_Volume = 0.7 #音量 0~1 se_gamestart = 00000 #ゲームスタートSE se_syutudai = 00000 #出題SE se_seikai = 00000 #正解SE se_miss = 00000 #ミスSE #se_gameend = 00000 #結果表示SE se_Volume = 1 #音量 0~1 #-----出題データの設定----- mondai_su = 20 #出題数 #問001 mondai[0] = "1" #問題 kotae1[0] = "A" #正解の回答 kotae2[0] = "B" kotae3[0] = "C" kotae4[0] = "D" #問002 mondai[1] = "2" #問題 kotae1[1] = "A" #正解の回答 kotae2[1] = "B" kotae3[1] = "C" kotae4[1] = "D" #問003 mondai[2] = "3" #問題 kotae1[2] = "A" #正解の回答 kotae2[2] = "B" kotae3[2] = "C" kotae4[2] = "D" #問004 mondai[3] = "4" #問題 kotae1[3] = "A" #正解の回答 kotae2[3] = "B" kotae3[3] = "C" kotae4[3] = "D" #問005 mondai[4] = "5" #問題 kotae1[4] = "A" #正解の回答 kotae2[4] = "B" kotae3[4] = "C" kotae4[4] = "D" #問006 mondai[5] = "6" #問題 kotae1[5] = "A" #正解の回答 kotae2[5] = "B" kotae3[5] = "C" kotae4[5] = "D" #問007 mondai[6] = "7" #問題 kotae1[6] = "A" #正解の回答 kotae2[6] = "B" kotae3[6] = "C" kotae4[6] = "D" #問008 mondai[7] = "8" #問題 kotae1[7] = "A" #正解の回答 kotae2[7] = "B" kotae3[7] = "C" kotae4[7] = "D" #問009 mondai[8] = "9" #問題 kotae1[8] = "A" #正解の回答 kotae2[8] = "B" kotae3[8] = "C" kotae4[8] = "D" #問010 mondai[9] = "10" #問題 kotae1[9] = "A" #正解の回答 kotae2[9] = "B" kotae3[9] = "C" kotae4[9] = "D" #問011 mondai[10] = "11" #問題 kotae1[10] = "A" #正解の回答 kotae2[10] = "B" kotae3[10] = "C" kotae4[10] = "D" #問012 mondai[11] = "12" #問題 kotae1[11] = "A" #正解の回答 kotae2[11] = "B" kotae3[11] = "C" kotae4[11] = "D" #問013 mondai[12] = "13" #問題 kotae1[12] = "A" #正解の回答 kotae2[12] = "B" kotae3[12] = "C" kotae4[12] = "D" #問014 mondai[13] = "14" #問題 kotae1[13] = "A" #正解の回答 kotae2[13] = "B" kotae3[13] = "C" kotae4[13] = "D" #問015 mondai[14] = "15" #問題 kotae1[14] = "A" #正解の回答 kotae2[14] = "B" kotae3[14] = "C" kotae4[14] = "D" #問016 mondai[15] = "16" #問題 kotae1[15] = "A" #正解の回答 kotae2[15] = "B" kotae3[15] = "C" kotae4[15] = "D" #問017 mondai[16] = "17" #問題 kotae1[16] = "A" #正解の回答 kotae2[16] = "B" kotae3[16] = "C" kotae4[16] = "D" #問018 mondai[17] = "18" #問題 kotae1[17] = "A" #正解の回答 kotae2[17] = "B" kotae3[17] = "C" kotae4[17] = "D" #問019 mondai[18] = "19" #問題 kotae1[18] = "A" #正解の回答 kotae2[18] = "B" kotae3[18] = "C" kotae4[18] = "D" #問020 mondai[19] = "20" #問題 kotae1[19] = "A" #正解の回答 kotae2[19] = "B" kotae3[19] = "C" kotae4[19] = "D" #問021 mondai[20] = "21" #問題 kotae1[20] = "A" #正解の回答 kotae2[20] = "B" kotae3[20] = "C" kotae4[20] = "D" #問022 mondai[21] = "22" #問題 kotae1[21] = "A" #正解の回答 kotae2[21] = "B" kotae3[21] = "C" kotae4[21] = "D" #問023 mondai[22] = "23" #問題 kotae1[22] = "A" #正解の回答 kotae2[22] = "B" kotae3[22] = "C" kotae4[22] = "D" #問024 mondai[23] = "24" #問題 kotae1[23] = "A" #正解の回答 kotae2[23] = "B" kotae3[23] = "C" kotae4[23] = "D" #問025 mondai[24] = "25" #問題 kotae1[24] = "A" #正解の回答 kotae2[24] = "B" kotae3[24] = "C" kotae4[24] = "D" #問026 mondai[25] = "26" #問題 kotae1[25] = "A" #正解の回答 kotae2[25] = "B" kotae3[25] = "C" kotae4[25] = "D" #問027 mondai[26] = "27" #問題 kotae1[26] = "A" #正解の回答 kotae2[26] = "B" kotae3[26] = "C" kotae4[26] = "D" #問028 mondai[27] = "28" #問題 kotae1[27] = "A" #正解の回答 kotae2[27] = "B" kotae3[27] = "C" kotae4[27] = "D" #問029 mondai[28] = "29" #問題 kotae1[28] = "A" #正解の回答 kotae2[28] = "B" kotae3[28] = "C" kotae4[28] = "D" #問030 mondai[29] = "30" #問題 kotae1[29] = "A" #正解の回答 kotae2[29] = "B" kotae3[29] = "C" kotae4[29] = "D" #問031 mondai[30] = "31" #問題 kotae1[30] = "A" #正解の回答 kotae2[30] = "B" kotae3[30] = "C" kotae4[30] = "D" #問032 mondai[31] = "32" #問題 kotae1[31] = "A" #正解の回答 kotae2[31] = "B" kotae3[31] = "C" kotae4[31] = "D" #問033 mondai[32] = "33" #問題 kotae1[32] = "A" #正解の回答 kotae2[32] = "B" kotae3[32] = "C" kotae4[32] = "D" #問034 mondai[33] = "34" #問題 kotae1[33] = "A" #正解の回答 kotae2[33] = "B" kotae3[33] = "C" kotae4[33] = "D" #問035 mondai[34] = "35" #問題 kotae1[34] = "A" #正解の回答 kotae2[34] = "B" kotae3[34] = "C" kotae4[34] = "D" #問036 mondai[35] = "36" #問題 kotae1[35] = "A" #正解の回答 kotae2[35] = "B" kotae3[35] = "C" kotae4[35] = "D" #問037 mondai[36] = "37" #問題 kotae1[36] = "A" #正解の回答 kotae2[36] = "B" kotae3[36] = "C" kotae4[36] = "D" #問038 mondai[37] = "38" #問題 kotae1[37] = "A" #正解の回答 kotae2[37] = "B" kotae3[37] = "C" kotae4[37] = "D" #問039 mondai[38] = "39" #問題 kotae1[38] = "A" #正解の回答 kotae2[38] = "B" kotae3[38] = "C" kotae4[38] = "D" #問040 mondai[39] = "40" #問題 kotae1[39] = "A" #正解の回答 kotae2[39] = "B" kotae3[39] = "C" kotae4[39] = "D" #問041 mondai[40] = "41" #問題 kotae1[40] = "A" #正解の回答 kotae2[40] = "B" kotae3[40] = "C" kotae4[40] = "D" #問042 mondai[41] = "42" #問題 kotae1[41] = "A" #正解の回答 kotae2[41] = "B" kotae3[41] = "C" kotae4[41] = "D" #問043 mondai[42] = "43" #問題 kotae1[42] = "A" #正解の回答 kotae2[42] = "B" kotae3[42] = "C" kotae4[42] = "D" #問044 mondai[43] = "44" #問題 kotae1[43] = "A" #正解の回答 kotae2[43] = "B" kotae3[43] = "C" kotae4[43] = "D" #問045 mondai[44] = "45" #問題 kotae1[44] = "A" #正解の回答 kotae2[44] = "B" kotae3[44] = "C" kotae4[44] = "D" #問046 mondai[45] = "46" #問題 kotae1[45] = "A" #正解の回答 kotae2[45] = "B" kotae3[45] = "C" kotae4[45] = "D" #問047 mondai[46] = "47" #問題 kotae1[46] = "A" #正解の回答 kotae2[46] = "B" kotae3[46] = "C" kotae4[46] = "D" #問048 mondai[47] = "48" #問題 kotae1[47] = "A" #正解の回答 kotae2[47] = "B" kotae3[47] = "C" kotae4[47] = "D" #問049 mondai[48] = "49" #問題 kotae1[48] = "A" #正解の回答 kotae2[48] = "B" kotae3[48] = "C" kotae4[48] = "D" #問050 mondai[49] = "50" #問題 kotae1[49] = "A" #正解の回答 kotae2[49] = "B" kotae3[49] = "C" kotae4[49] = "D" #問051 mondai[50] = "51" #問題 kotae1[50] = "A" #正解の回答 kotae2[50] = "B" kotae3[50] = "C" kotae4[50] = "D" #問052 mondai[51] = "52" #問題 kotae1[51] = "A" #正解の回答 kotae2[51] = "B" kotae3[51] = "C" kotae4[51] = "D" #問053 mondai[52] = "53" #問題 kotae1[52] = "A" #正解の回答 kotae2[52] = "B" kotae3[52] = "C" kotae4[52] = "D" #問054 mondai[53] = "54" #問題 kotae1[53] = "A" #正解の回答 kotae2[53] = "B" kotae3[53] = "C" kotae4[53] = "D" #問055 mondai[54] = "55" #問題 kotae1[54] = "A" #正解の回答 kotae2[54] = "B" kotae3[54] = "C" kotae4[54] = "D" #問056 mondai[55] = "56" #問題 kotae1[55] = "A" #正解の回答 kotae2[55] = "B" kotae3[55] = "C" kotae4[55] = "D" #問057 mondai[56] = "57" #問題 kotae1[56] = "A" #正解の回答 kotae2[56] = "B" kotae3[56] = "C" kotae4[56] = "D" #問058 mondai[57] = "58" #問題 kotae1[57] = "A" #正解の回答 kotae2[57] = "B" kotae3[57] = "C" kotae4[57] = "D" #問059 mondai[58] = "59" #問題 kotae1[58] = "A" #正解の回答 kotae2[58] = "B" kotae3[58] = "C" kotae4[58] = "D" #問060 mondai[59] = "60" #問題 kotae1[59] = "A" #正解の回答 kotae2[59] = "B" kotae3[59] = "C" kotae4[59] = "D" #問061 mondai[60] = "61" #問題 kotae1[60] = "A" #正解の回答 kotae2[60] = "B" kotae3[60] = "C" kotae4[60] = "D" #問062 mondai[61] = "62" #問題 kotae1[61] = "A" #正解の回答 kotae2[61] = "B" kotae3[61] = "C" kotae4[61] = "D" #問063 mondai[62] = "63" #問題 kotae1[62] = "A" #正解の回答 kotae2[62] = "B" kotae3[62] = "C" kotae4[62] = "D" #問064 mondai[63] = "64" #問題 kotae1[63] = "A" #正解の回答 kotae2[63] = "B" kotae3[63] = "C" kotae4[63] = "D" #問065 mondai[64] = "65" #問題 kotae1[64] = "A" #正解の回答 kotae2[64] = "B" kotae3[64] = "C" kotae4[64] = "D" #問066 mondai[65] = "66" #問題 kotae1[65] = "A" #正解の回答 kotae2[65] = "B" kotae3[65] = "C" kotae4[65] = "D" #問067 mondai[66] = "67" #問題 kotae1[66] = "A" #正解の回答 kotae2[66] = "B" kotae3[66] = "C" kotae4[66] = "D" #問068 mondai[67] = "68" #問題 kotae1[67] = "A" #正解の回答 kotae2[67] = "B" kotae3[67] = "C" kotae4[67] = "D" #問069 mondai[68] = "69" #問題 kotae1[68] = "A" #正解の回答 kotae2[68] = "B" kotae3[68] = "C" kotae4[68] = "D" #問070 mondai[69] = "70" #問題 kotae1[69] = "A" #正解の回答 kotae2[69] = "B" kotae3[69] = "C" kotae4[69] = "D" #問071 mondai[70] = "71" #問題 kotae1[70] = "A" #正解の回答 kotae2[70] = "B" kotae3[70] = "C" kotae4[70] = "D" #問072 mondai[71] = "72" #問題 kotae1[71] = "A" #正解の回答 kotae2[71] = "B" kotae3[71] = "C" kotae4[71] = "D" #問073 mondai[72] = "73" #問題 kotae1[72] = "A" #正解の回答 kotae2[72] = "B" kotae3[72] = "C" kotae4[72] = "D" #問074 mondai[73] = "74" #問題 kotae1[73] = "A" #正解の回答 kotae2[73] = "B" kotae3[73] = "C" kotae4[73] = "D" #問075 mondai[74] = "75" #問題 kotae1[74] = "A" #正解の回答 kotae2[74] = "B" kotae3[74] = "C" kotae4[74] = "D" #問076 mondai[75] = "76" #問題 kotae1[75] = "A" #正解の回答 kotae2[75] = "B" kotae3[75] = "C" kotae4[75] = "D" #問077 mondai[76] = "77" #問題 kotae1[76] = "A" #正解の回答 kotae2[76] = "B" kotae3[76] = "C" kotae4[76] = "D" #問078 mondai[77] = "78" #問題 kotae1[77] = "A" #正解の回答 kotae2[77] = "B" kotae3[77] = "C" kotae4[77] = "D" #問079 mondai[78] = "79" #問題 kotae1[78] = "A" #正解の回答 kotae2[78] = "B" kotae3[78] = "C" kotae4[78] = "D" #問080 mondai[79] = "80" #問題 kotae1[79] = "A" #正解の回答 kotae2[79] = "B" kotae3[79] = "C" kotae4[79] = "D" #問081 mondai[80] = "81" #問題 kotae1[80] = "A" #正解の回答 kotae2[80] = "B" kotae3[80] = "C" kotae4[80] = "D" #問082 mondai[81] = "82" #問題 kotae1[81] = "A" #正解の回答 kotae2[81] = "B" kotae3[81] = "C" kotae4[81] = "D" #問083 mondai[82] = "83" #問題 kotae1[82] = "A" #正解の回答 kotae2[82] = "B" kotae3[82] = "C" kotae4[82] = "D" #問084 mondai[83] = "84" #問題 kotae1[83] = "A" #正解の回答 kotae2[83] = "B" kotae3[83] = "C" kotae4[83] = "D" #問085 mondai[84] = "85" #問題 kotae1[84] = "A" #正解の回答 kotae2[84] = "B" kotae3[84] = "C" kotae4[84] = "D" #問086 mondai[85] = "86" #問題 kotae1[85] = "A" #正解の回答 kotae2[85] = "B" kotae3[85] = "C" kotae4[85] = "D" #問087 mondai[86] = "87" #問題 kotae1[86] = "A" #正解の回答 kotae2[86] = "B" kotae3[86] = "C" kotae4[86] = "D" #問088 mondai[87] = "88" #問題 kotae1[87] = "A" #正解の回答 kotae2[87] = "B" kotae3[87] = "C" kotae4[87] = "D" #問089 mondai[88] = "89" #問題 kotae1[88] = "A" #正解の回答 kotae2[88] = "B" kotae3[88] = "C" kotae4[88] = "D" #問090 mondai[89] = "90" #問題 kotae1[89] = "A" #正解の回答 kotae2[89] = "B" kotae3[89] = "C" kotae4[89] = "D" #問091 mondai[90] = "91" #問題 kotae1[90] = "A" #正解の回答 kotae2[90] = "B" kotae3[90] = "C" kotae4[90] = "D" #問092 mondai[91] = "92" #問題 kotae1[91] = "A" #正解の回答 kotae2[91] = "B" kotae3[91] = "C" kotae4[91] = "D" #問093 mondai[92] = "93" #問題 kotae1[92] = "A" #正解の回答 kotae2[92] = "B" kotae3[92] = "C" kotae4[92] = "D" #問094 mondai[93] = "94" #問題 kotae1[93] = "A" #正解の回答 kotae2[93] = "B" kotae3[93] = "C" kotae4[93] = "D" #問095 mondai[94] = "95" #問題 kotae1[94] = "A" #正解の回答 kotae2[94] = "B" kotae3[94] = "C" kotae4[94] = "D" #問096 mondai[95] = "96" #問題 kotae1[95] = "A" #正解の回答 kotae2[95] = "B" kotae3[95] = "C" kotae4[95] = "D" #問097 mondai[96] = "97" #問題 kotae1[96] = "A" #正解の回答 kotae2[96] = "B" kotae3[96] = "C" kotae4[96] = "D" #問098 mondai[97] = "98" #問題 kotae1[97] = "A" #正解の回答 kotae2[97] = "B" kotae3[97] = "C" kotae4[97] = "D" #問099 mondai[98] = "99" #問題 kotae1[98] = "A" #正解の回答 kotae2[98] = "B" kotae3[98] = "C" kotae4[98] = "D" #問100 mondai[99] = "100"#問題 kotae1[99] = "A" #正解の回答 kotae2[99] = "B" kotae3[99] = "C" kotae4[99] = "D" #-----ランクメッセージの設定----- RankMsg01 = "ちょっと、難しかったかな。\nまた挑戦してね。" RankMsg02 = "まだまだ、勉強不足かな。\nまた挑戦してね。" RankMsg03 = "この程度で満足しちゃダメよ。\nまた挑戦してね。" RankMsg04 = "なかなか、知識がありますね。\n更なる高みへ挑戦してね。" RankMsg05 = "惜しい、あともう一息。\n更なる高みへ挑戦してね。" RankMsg06 = "お見事です!\nあなたこそ、ぷちくいずマスター!" #_/_/_/_/_/_/_/_/_/_/_/_/ 設定ここまで _/_/_/_/_/_/_/_/_/_/_/_/ #-----画像ファイルの設定----- #背景 img_bg = createSprite(74075) x = 0 y = 0 w = 800 h = 600 z = 1 setSpritePosition(img_bg, x, y) setSpriteZOrder(img_bg, z) setSpriteRect(img_bg, 0, 0, w, h, 0, 0, w, h) #背景2 img_bg2 = createSprite(74103) x = 0 y = 610 w = 800 h = 600 z = 3 setSpritePosition(img_bg2, x, y) setSpriteZOrder(img_bg2, z) setSpriteRect(img_bg2, 0, 0, w, h, 0, 0, w, h) #キャラクターイラスト img_char = createSprite(img_char_no) x = 5 y = 40 w = 300 h = 555 z = 2 setSpritePosition(img_char, x, y) setSpriteZOrder(img_char, z) setSpriteRect(img_char, 0, 0, w, h, 0, 0, w, h) #ボタン背景 img_button = createSprite(74030) x = 296 y = 610 w = 471 h = 37 z = 2 setSpritePosition(img_button, x, y) setSpriteZOrder(img_button, z) setSpriteRect(img_button, 0, 0, w, h, 0, 0, w, h) #タイマーゲージ img_timer_s = createSprite(74021) x = 328 y = 610 w = 4 h = 25 z = 2 setSpritePosition(img_timer_s, x, y) setSpriteZOrder(img_timer_s, z) setSpriteRect(img_timer_s, 0, 0, w, h, 0, 0, w, h) img_timer_l = createSprite(74000) x = 328 y = 15 setSpritePosition(img_timer_l, x, y) setSpriteZOrder(img_timer_l, z) setSpriteRect(img_timer_l, 0, 0, w, h, 0, 0, w, h) img_timer_m = createArray() i = 0 ilen = 107 x = 332 while i < ilen img_timer_m[i] = createSprite(74007) setSpritePosition(img_timer_m[i], x, y) setSpriteZOrder(img_timer_m[i], z) setSpriteRect(img_timer_m[i], 0, 0, w, h, 0, 0, w, h) x = x + 4 i = i + 1 end x = x - 2 img_timer_m[i] = createSprite(74007) setSpritePosition(img_timer_m[i], x, y) setSpriteZOrder(img_timer_m[i], z) setSpriteRect(img_timer_m[i], 0, 0, w, h, 0, 0, w, h) img_timer_r = createSprite(74014) x = 762 setSpritePosition(img_timer_r, x, y) setSpriteZOrder(img_timer_r, z) setSpriteRect(img_timer_r, 0, 0, w, h, 0, 0, w, h) drawCanvas() setCanvasVisible(true) #-----タイマーの設定----- maxtime = 109 #-----テキストボックスの設定----- setTextFontColor(30,30,30) setTextFontSize(18) setTextViewMode(0) #出題ウインドウ x = 317 y = 75 w = 429 h = 275 textbox01 = createText(x, y, w, h) #回答ボタンA x = 304 y = 391 w = 467 h = 25 textboxA = createText(x, y, w, h) #回答ボタンB y = 436 textboxB = createText(x, y, w, h) #回答ボタンC y = 481 textboxC = createText(x, y, w, h) #回答ボタンD y = 526 textboxD = createText(x, y, w, h) #READYウインドウ setTextFontColor(120,120,120) setTextFontSize(32) x = 461 y = 196 w = 250 h = 350 textbox03 = createText(x, y, w, h) setTextFontColor(251,86,152) x = 460 y = 195 w = 250 h = 350 textbox02 = createText(x, y, w, h) #スコアウインドウ setTextFontColor(30,30,30) setTextFontSize(25) x = 55 y = 235 w = 196 h = 27 textboxPoint = createText(x, y, w, h) #正解数ウインドウ x = 55 y = 352 w = 196 h = 27 textboxSeikai = createText(x, y, w, h) #ランクウインドウ01 setTextFontColor(251,215,49) x = 327 y = 178 w = 401 h = 27 textboxRank01 = createText(x, y, w, h) #ランクウインドウ02 setTextFontColor(30,30,30) x = 327 y = 218 w = 401 h = 224 textboxRank02 = createText(x, y, w, h) #-----クイズ開始処理----- loop = true mondai_max = getArrayLength(mondai) mondai_rireki = createArray() point = 0 seikai = 0 starttime = 4 mondaicount = mondai_su setBaseTime() timer = getTime() timer = floor(timer / 1000) oldtimer = 1000 se_gamestart_id = playSound(se_gamestart) setSoundVolume(se_gamestart_id, se_Volume) str = " よーい" setText(textbox03, str) setText(textbox02, str) while loop timer = getTime() timer = floor(timer / 1000) if oldtimer != timer time_sa = starttime - timer if time_sa > 1 elsif time_sa > 0 str = "スタート!" setText(textbox03, str) setText(textbox02, str) else loop = false end oldtimer = timer end waitTime(30) end str = " " setText(textbox03, str) setText(textbox02, str) playBGM(bgm_main) setMusicVolume(bgm_Volume) #-----クイズメイン処理----- while mondaicount > 0 loop = true select = 0 #タイマーゲージのリセット x = 328 y = 610 setSpritePosition(img_timer_s, x, y) x = 328 y = 15 setSpritePosition(img_timer_l, x, y) i = 0 ilen = 107 x = 332 while i < ilen setSpritePosition(img_timer_m[i], x, y) x = x + 4 i = i + 1 end x = x - 2 setSpritePosition(img_timer_m[i], x, y) x = 762 setSpritePosition(img_timer_r, x, y) drawCanvas() #---------- #問題文のセット select_ques = rand(mondai_max) #select_ques = 0 if mondaicount == mondai_su mondai_rireki[0] = select_ques else chkloop = true while chkloop chkloop = false i = 0 ilen = getArrayLength(mondai_rireki) ilen = ilen + 1 while i < ilen if mondai_rireki[i] == select_ques select_ques = rand(mondai_max) chkloop = true end i = i + 1 end end pushArray(mondai_rireki, select_ques) end ques = " 問題\n" ques = ques + mondai[select_ques] setText(textbox01, ques) select_ansA = rand(4) select_ansB = rand(4) if select_ansB == select_ansA select_ansB = select_ansB + 1 if select_ansB > 3 select_ansB = 0 end end select_ansC = rand(2) if select_ansA == 0 if select_ansB == 1 if select_ansC == 0 select_ansC = 2 select_ansD = 3 else select_ansC = 3 select_ansD = 2 end elsif select_ansB == 2 if select_ansC == 0 select_ansC = 1 select_ansD = 3 else select_ansC = 3 select_ansD = 1 end else if select_ansC == 0 select_ansC = 1 select_ansD = 2 else select_ansC = 2 select_ansD = 1 end end elsif select_ansA == 1 if select_ansB == 0 if select_ansC == 0 select_ansC = 2 select_ansD = 3 else select_ansC = 3 select_ansD = 2 end elsif select_ansB == 2 if select_ansC == 0 select_ansC = 0 select_ansD = 3 else select_ansC = 3 select_ansD = 0 end else if select_ansC == 0 select_ansC = 0 select_ansD = 2 else select_ansC = 2 select_ansD = 0 end end elsif select_ansA == 2 if select_ansB == 0 if select_ansC == 0 select_ansC = 1 select_ansD = 3 else select_ansC = 3 select_ansD = 1 end elsif select_ansB == 1 if select_ansC == 0 select_ansC = 0 select_ansD = 3 else select_ansC = 3 select_ansD = 0 end else if select_ansC == 0 select_ansC = 0 select_ansD = 1 else select_ansC = 1 select_ansD = 0 end end else if select_ansB == 0 if select_ansC == 0 select_ansC = 1 select_ansD = 2 else select_ansC = 2 select_ansD = 1 end elsif select_ansB == 1 if select_ansC == 0 select_ansC = 0 select_ansD = 2 else select_ansC = 2 select_ansD = 0 end else if select_ansC == 0 select_ansC = 0 select_ansD = 1 else select_ansC = 1 select_ansD = 0 end end end ansA = " A " ansB = " B " ansC = " C " ansD = " D " if select_ansA == 0 ansA = ansA + kotae1[select_ques] elsif select_ansA == 1 ansB = ansB + kotae1[select_ques] elsif select_ansA == 2 ansC = ansC + kotae1[select_ques] else ansD = ansD + kotae1[select_ques] end if select_ansB == 0 ansA = ansA + kotae2[select_ques] elsif select_ansB == 1 ansB = ansB + kotae2[select_ques] elsif select_ansB == 2 ansC = ansC + kotae2[select_ques] else ansD = ansD + kotae2[select_ques] end if select_ansC == 0 ansA = ansA + kotae3[select_ques] elsif select_ansC == 1 ansB = ansB + kotae3[select_ques] elsif select_ansC == 2 ansC = ansC + kotae3[select_ques] else ansD = ansD + kotae3[select_ques] end if select_ansD == 0 ansA = ansA + kotae4[select_ques] elsif select_ansD == 1 ansB = ansB + kotae4[select_ques] elsif select_ansD == 2 ansC = ansC + kotae4[select_ques] else ansD = ansD + kotae4[select_ques] end setText(textboxA, ansA) setText(textboxB, ansB) setText(textboxC, ansC) setText(textboxD, ansD) #---------- setBaseTime() timer = getTime() timer = floor(timer / 100) oldtimer = 1000 oldj = 106 #---------- se_syutudai_id = playSound(se_syutudai) setSoundVolume(se_syutudai_id, se_Volume) #入力の取得を始めます startInput() while loop #タイマーのカウント表示 timer = getTime() timer = floor(timer / 100) if oldtimer != timer time_sa = maxtime - timer if time_sa > 108 elsif time_sa > 2 j = oldj jlen = time_sa - 3 while j > jlen i = j x = 332 + (i * 4) y = 610 setSpritePosition(img_timer_m[i], x, y) oldj = j j = j - 1 end i = 107 x = x - 2 y = 15 setSpritePosition(img_timer_m[i], x, y) x = x + 4 setSpritePosition(img_timer_r, x, y) elsif time_sa > 1 i = time_sa - 2 x = 332 + (i * 4) y = 610 setSpritePosition(img_timer_m[i], x, y) i = 107 x = x - 2 y = 610 setSpritePosition(img_timer_m[i], x, y) x = x + 4 setSpritePosition(img_timer_r, x, y) elsif time_sa > 0 x = 1 y = 610 setSpritePosition(img_timer_l, x, y) setSpritePosition(img_timer_r, x, y) x = 328 y = 15 setSpritePosition(img_timer_s, x, y) else #TimeUp x = 1 y = 610 setSpritePosition(img_timer_s, x, y) select = 9 loop = false end drawCanvas() oldtimer = timer end #入力が入っているかどうか調べます。 while hasInput() #内部にたまっている入力を処理対象とします。 takeInput() x = 296 if isMouseMove() #マウスの位置を取得 pos = getMousePosition() mouse_x = pos[0] mouse_y = pos[1] if mouse_x > 296 && mouse_y > 385 && mouse_x < 766 && mouse_y < 421 y = 385 setSpritePosition(img_button, x, y) elsif mouse_x > 296 && mouse_y > 430 && mouse_x < 766 && mouse_y < 466 y = 430 setSpritePosition(img_button, x, y) elsif mouse_x > 296 && mouse_y > 475 && mouse_x < 766 && mouse_y < 511 y = 475 setSpritePosition(img_button, x, y) elsif mouse_x > 296 && mouse_y > 520 && mouse_x < 766 && mouse_y < 556 y = 520 setSpritePosition(img_button, x, y) else y = 610 setSpritePosition(img_button, x, y) end drawCanvas() elsif isMouseDown() #マウスの位置を取得 pos = getMousePosition() mouse_x = pos[0] mouse_y = pos[1] if mouse_x > 296 && mouse_y > 385 && mouse_x < 766 && mouse_y < 421 y = 385 setSpritePosition(img_button, x, y) select = 1 loop = false elsif mouse_x > 296 && mouse_y > 430 && mouse_x < 766 && mouse_y < 466 y = 430 setSpritePosition(img_button, x, y) select = 2 loop = false elsif mouse_x > 296 && mouse_y > 475 && mouse_x < 766 && mouse_y < 511 y = 475 setSpritePosition(img_button, x, y) select = 3 loop = false elsif mouse_x > 296 && mouse_y > 520 && mouse_x < 766 && mouse_y < 556 y = 520 setSpritePosition(img_button, x, y) select = 4 loop = false else y = 610 setSpritePosition(img_button, x, y) end drawCanvas() end end waitTime(30) end #入力の取得を終了 endInput() #回答の判定 if select == (select_ansA + 1) str = " 正解" setText(textbox03, str) setText(textbox02, str) se_seikai_id = playSound(se_seikai) setSoundVolume(se_seikai_id, se_Volume) #得点の加算 point = point + (time_sa * 5) seikai = seikai + 1 elsif select == 9 str = " 時間切れ" setText(textbox03, str) setText(textbox02, str) se_miss_id = playSound(se_miss) setSoundVolume(se_miss_id, se_Volume) else str = " 残念" setText(textbox03, str) setText(textbox02, str) se_miss_id = playSound(se_miss) setSoundVolume(se_miss_id, se_Volume) end hanteitime = 15 setBaseTime() timer = getTime() timer = floor(timer / 100) oldtimer = 1000 while hanteitime > 0 timer = getTime() timer = floor(timer / 100) if oldtimer != timer time_sa = hanteitime - timer if time_sa < 0 hanteitime = 0 end end waitTime(30) end str = " " setText(textbox03, str) setText(textbox02, str) #次の問題へ mondaicount = mondaicount - 1 end #-----クイズ終了処理----- fadeOutMusicStop(1000) str = " " setText(textbox01, str) setText(textboxA, str) setText(textboxB, str) setText(textboxC, str) setText(textboxD, str) x = 0 y = 0 setSpritePosition(img_bg2, x, y) drawCanvas() str = "\n\n\n\n\n\n\n クリック:次へ" setText(textbox03, str) setText(textbox02, str) point = point * 10 str = " " str = str + point setText(textboxPoint, str) str = " " str = str + seikai str = str + " / " str = str + mondai_su setText(textboxSeikai, str) rankmax = mondai_su * 5500 rankmin = floor(rankmax / 6) str = " " #str = str + "ランク " str2 = " " if point < (rankmin * 1) str = str + "☆☆☆☆☆" str2 = RankMsg01 elsif point < (rankmin * 2) str = str + "★☆☆☆☆" str2 = RankMsg02 elsif point < (rankmin * 3) str = str + "★★☆☆☆" str2 = RankMsg03 elsif point < (rankmin * 4) str = str + "★★★☆☆" str2 = RankMsg04 elsif point < (rankmin * 5) str = str + "★★★★☆" str2 = RankMsg05 else str = str + "★★★★★" str2 = RankMsg06 end setText(textboxRank01, str) setText(textboxRank02, str2) playBGM(bgm_gameend) setMusicVolume(bgm_Volume) #se_gameend_id = playSound(se_gameend) #setSoundVolume(se_gameend_id, se_Volume) loop = true #入力の取得を始めます startInput() while loop #入力が入っているかどうか調べます。 while hasInput() #内部にたまっている入力を処理対象とします。 takeInput() if isMouseDown() loop = false end end waitTime(30) end #入力の取得を終了 endInput() feedstr = "ランク" feedstr = feedstr + str feedstr = feedstr + " スコア " feedstr = feedstr + point feedstr = feedstr + " でクリアしました" openActivityFeedWindow(feedstr) goEnding()
コメントする
コメントするには、ログインする必要があります。
コメント一覧
コメントはありません。