CoRサンプル集: サウンドテスト

入力と音楽のテストです。
※音量注意※

音量設定ができないのでPCのスピーカーで調整してください。
一時停止(||)がうまくいかなくなったら停止(■)を何回か押してください。
何曲も再生するとそのうち激重になると思うので
その時はページ再読み込みなどで最初からやり直せばいけるはず。
不具合などありましたらコメント欄かブログにお願いします。

おんがく:mochi3kan
こうかおん:効果音ラボ

ソースコード付き
プレー:29 (人数:22) クリア:5 評価: 20 (2回)
CoR[?]
scene 'choice' do #シーンstart #背景画像 bg_image = nil #効果音 se = nil title = nil undo = nil msc1 = nil ; msc2 = nil ; msc3 = nil ; msc4 = nil ; msc5 = nil msc6 = nil ; msc7 = nil ; msc8 = nil ; msc9 = nil ; msc10 = nil #テキストスプライト座標 cx1 = 60 ; cx2 = 360 cy1 = 120 ; cy2 = 180 ; cy3 = 240 ; cy4 = 300 ; cy5 = 360 #a = getVariable("ジャンル") #b = getVariable("曲名") #c = getVariable("表示名") setVariable("位置", 0) #どの位置をクリックしたか preload do #素材読込み image '背景', id: 325422 sound 'click', id: 325434 end create do #シーン初期化 bg_image = put_sprite 'bg' do position 0, 0 end se = add_music('click') title = put_text 'title' do position 400, 60 text '好きな音楽を選んでね' end undo = put_text 'undo' do position 620, 360 text 'もどる' end msc1 = put_text 'msc' do position cx1, cy1 text "#{getVariable("曲名")[0]}" end msc2 = put_text 'msc' do position cx1, cy2 text "#{getVariable("曲名")[1]}" end msc3 = put_text 'msc' do position cx1, cy3 text "#{getVariable("曲名")[2]}" end msc4 = put_text 'msc' do position cx1, cy4 text "#{getVariable("曲名")[3]}" end msc5 = put_text 'msc' do position cx1, cy5 text "#{getVariable("曲名")[4]}" end msc6 = put_text 'msc' do position cx2, cy1 text "#{getVariable("曲名")[5]}" end msc7 = put_text 'msc' do position cx2, cy2 text "#{getVariable("曲名")[6]}" end msc8 = put_text 'msc' do position cx2, cy3 text "#{getVariable("曲名")[7]}" end msc9 = put_text 'msc' do position cx2, cy4 text "#{getVariable("曲名")[8]}" end msc10 = put_text 'msc' do position cx2, cy5 text "#{getVariable("曲名")[9]}" end end update do #どの位置をクリックしたか、先程選んだジャンルと合わせてシーンを選ぶ if pointer.down? debug_log "Mouse: #{pointer.x}, #{pointer.y}" x = pointer.x ; y = pointer.y if x >= cx1 && y >= cy1 && x <= cx1 + 260 && y <= cy1 + 40 #1列目1行目 setVariable("表示名", getVariable("曲名")[0]) setVariable("位置", 1) se. play ; wait_time(50) ; se.stop case getVariable("ジャンル") when 1 change_scene 'music1-1' when 2 change_scene 'music2' when 3 change_scene 'music3-1' else debug_log 'にゃあ1' end elsif x >= cx1 && y >= cy2 && x <= cx1 + 260 && y <= cy2 + 40 #1-2 setVariable("表示名", getVariable("曲名")[1]) setVariable("位置", 2) se. play ; wait_time(50) ; se.stop case getVariable("ジャンル") when 1 change_scene 'music1-1' when 2 change_scene 'music2' when 3 change_scene 'music3-1' else debug_log 'にゃあ2' end elsif x >= cx1 && y >= cy3 && x <= cx1 + 260 && y <= cy3 + 40 #1-3 setVariable("表示名", getVariable("曲名")[2]) setVariable("位置", 3) se. play ; wait_time(50) ; se.stop case getVariable("ジャンル") when 1 change_scene 'music1-1' when 2 change_scene 'music2' when 3 change_scene 'music3-1' else debug_log 'にゃあ3' end elsif x >= cx1 && y >= cy4 && x <= cx1 + 260 && y <= cy4 + 40 #1-4 setVariable("表示名", getVariable("曲名")[3]) setVariable("位置", 4) se. play ; wait_time(50) ; se.stop case getVariable("ジャンル") when 1 change_scene 'music1-1' when 2 change_scene 'music2' when 3 change_scene 'music3-1' else debug_log 'にゃあ4' end elsif x >= cx1 && y >= cy5 && x <= cx1 + 260 && y <= cy5 + 40 #1-5 setVariable("表示名", getVariable("曲名")[4]) setVariable("位置", 5) se. play ; wait_time(50) ; se.stop case getVariable("ジャンル") when 1 change_scene 'music1-1' when 2 change_scene 'music2' when 3 change_scene 'music3-1' else debug_log 'にゃあ5' end elsif x >= cx2 && y >= cy1 && x <= cx2 + 260 && y <= cy1 + 40 #2-1 setVariable("表示名", getVariable("曲名")[5]) setVariable("位置", 6) if getVariable("ジャンル") == 1 #a==1では認識されないっぽい se. play ; wait_time(50) ; se.stop change_scene 'music1-2' debug_log "#{getVariable("ジャンル")}" elsif getVariable("ジャンル") == 3 se. play ; wait_time(50) ; se.stop change_scene 'music3-2' else debug_log "#{getVariable("ジャンル")}" #ダンジョンをえらんだときは何も起きない end elsif x >= cx2 && y >= cy2 && x <= cx2 + 260 && y <= cy2 + 40 #2-2 setVariable("表示名", getVariable("曲名")[6]) setVariable("位置", 7) if getVariable("ジャンル") == 1 se. play ; wait_time(50) ; se.stop change_scene 'music1-2' debug_log "#{getVariable("ジャンル")}" elsif getVariable("ジャンル") == 3 se. play ; wait_time(50) ; se.stop change_scene 'music3-2' else debug_log "#{getVariable("ジャンル")}" end elsif x >= cx2 && y >= cy3 && x <= cx2 + 260 && y <= cy3 + 40 #2-3 setVariable("表示名", getVariable("曲名")[7]) setVariable("位置", 8) if getVariable("ジャンル") == 1 se. play ; wait_time(50) ; se.stop change_scene 'music1-2' debug_log "#{getVariable("ジャンル")}" elsif getVariable("ジャンル") == 3 se. play ; wait_time(50) ; se.stop change_scene 'music3-2' else debug_log "#{getVariable("ジャンル")}" end elsif x >= cx2 && y >= cy4 && x <= cx2 + 260 && y <= cy4 + 40 #2-4 setVariable("表示名", getVariable("曲名")[8]) setVariable("位置", 9) if getVariable("ジャンル") == 1 se. play ; wait_time(50) ; se.stop change_scene 'music1-2' debug_log "#{getVariable("ジャンル")}" elsif getVariable("ジャンル") == 3 se. play ; wait_time(50) ; se.stop change_scene 'music3-2' else debug_log "#{getVariable("ジャンル")}" end elsif x >= cx2 && y >= cy5 && x <= cx2 + 260 && y <= cy5 + 40 #2-5 setVariable("表示名", getVariable("曲名")[9]) setVariable("位置", 10) if getVariable("ジャンル") == 1 se. play ; wait_time(50) ; se.stop change_scene 'music1-2' debug_log "#{getVariable("ジャンル")}" elsif getVariable("ジャンル") == 3 se. play ; wait_time(50) ; se.stop change_scene 'music3-2' else debug_log "#{getVariable("ジャンル")}" end elsif x >= 620 && y >= 360 && x <= 764 && y <= 416 #620,360 - 764,416 se. play ; wait_time(50) ; se.stop change_scene 'genre' else debug_log "そこはちがうってば" end end end render do #描画 end end #シーンスタート start_scene "choice" sprite 'bg' do image '背景' origin :left_top end text 'title' do origin :center font_size 48 color '#000000' end text 'msc' do origin :left_top font_size 32 color '#000000' end text 'undo' do origin :left_top font_size 48 color '#000000' end
投稿者:Material 303531 2 mini mochi3kan 対象Lv1 公開日:2021年02月04日 17:05:29
プレー内容を公開する

違反を通報する

コメントする

コメントするには、ログインする必要があります。

コメント一覧

コメントはありません。

プレー履歴

プレー履歴はありません。

全てのプレー履歴を見る

新着レビュー

レビューはまだ投稿されていません。 作品の感想を作者に伝えるためにレビューを投稿してみませんか?

全てのレビュー

フォロー/シェア

ブログ/Wiki/掲示板で共有する

Rmake内(ブログ/Wiki/掲示板)に貼り付ける場合は以下のタグを利用してください。

リンク

プレイヤー

外部ホームページに貼り付ける

外部ホームページに貼り付ける場合は以下のタグを利用してください。