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

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

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

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

ソースコード付き
プレー:29 (人数:22) クリア:5 評価: 20 (2回)
CoR[?]
scene 'music1-1' do #シーンstart #背景画像 bg_image = nil #音楽変数 #ひとつのCOREシーンに設定できるのは25曲まで、ひとつのシーンで読み込める音楽は5つまで music1 = nil ; music2 = nil ; music3 = nil ; music4 = nil ; music5 = nil #効果音 se = nil #テキストスプライト title = nil undo = nil mplayer = nil #a = getVariable("ジャンル") #b = getVariable("曲名") #c = getVariable("表示名") #d = getVariable("位置") nowplaying = false #今音楽を再生しているかどうか music_name = nil #再生する曲を変数に入れる preload do #素材読込み image '背景', id: 325422 #音楽読み込み music 'field', id: 302547 ; music 'polka', id: 303628 ; music 'castle', id: 303629 ; music 'ship', id: 304427 ; music 'ocean', id: 303677 sound 'click', id: 325434 end create do #シーン初期化 bg_image = put_sprite 'bg' do position 0, 0 end title = put_text 'title' do position 400, 60 text "#{getVariable("表示名")}" end undo = put_text 'undo' do position 620, 360 text 'もどる' end mplayer = put_text 'player' do position 400, 230 text "▶   ||   ■" end #音楽 music1 = add_music('field') ; music2 = add_music('polka') ; music3 = add_music('castle') ; music4 = add_music('ship') ; music5 = add_music('ocean') se = add_music('click') end update do #ジャンル「フィールド~」の、1列目を選択したときの再生画面 if pointer.down? debug_log "Mouse: #{pointer.x}, #{pointer.y}" x = pointer.x ; y = pointer.y case getVariable("位置") #5曲ずつしか読み込めないのでここでのジャンル判定は不要 when 1 #1行目をクリックしたとき music_name = music1 when 2 #2行目、以下同文 music_name = music2 when 3 music_name = music3 when 4 music_name = music4 when 5 music_name = music5 else debug_log 'このメッセージが出るのはおかしいぞい' end if x >= 186 && y >= 198 && x <= 250 && y <= 262 #186,198- 249,262 if !nowplaying debug_log "再生中" music_name .play nowplaying = true elsif nowplaying end elsif x >= 368 && y >= 198 && x <= 432 && y <= 262 #368,198 - 432,262 if nowplaying debug_log "一時停止中" music_name .pause nowplaying = false wait_time(500) elsif !nowplaying music_name .resume nowplaying = true wait_time(500) end elsif x >= 548 && y >= 198 && x <= 612 && y <= 262 #548,198 - 612,262 if nowplaying debug_log "停止" music_name .stop nowplaying = false elsif !nowplaying end elsif x >= 620 && y >= 360 && x <= 764 && y <= 416 #548,198 - 612,262 se. play ; wait_time(50) ; se.stop music_name .stop nowplaying = false change_scene 'choice' else debug_log "そんなとこさわんないでよ" end end end render do #描画 end end #シーンスタート start_scene "music1-1" sprite 'bg' do image '背景' origin :left_top end text 'title' do origin :center font_size 48 color '#000000' end text 'player' do origin :center font_size 48 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/掲示板)に貼り付ける場合は以下のタグを利用してください。

リンク

プレイヤー

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

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