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

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

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

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

ソースコード付き
プレー:29 (人数:22) クリア:5 評価: 20 (2回)
CoR[?]
scene 'music3-1' do #背景画像 bg_image = nil #テキストスプライト title = nil undo = nil mplayer = nil #音楽 music16 = nil ; music17 = nil ; music18 = nil ; music19 = nil ; music20 = nil #効果音 se = nil #a = getVariable("ジャンル") #b = getVariable("曲名") #c = getVariable("表示名") #d = getVariable("位置") nowplaying = false music_name = nil preload do image '背景', id: 325422 music 'nostalgy', id: 305017 ; music 'wind', id: 307822 ; music 'farewell', id: 308186 ; music 'disquiet', id: 315356 ; music 'rondo', id: 318380 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 music16 = add_music('nostalgy') ; music17 = add_music('wind') ; music18 = add_music('farewell') ; music19 = add_music('disquiet') ; music20 = add_music('rondo') se = add_music('click') end update do if pointer.down? debug_log "Mouse: #{pointer.x}, #{pointer.y}" x = pointer.x ; y = pointer.y case getVariable("位置") #5曲ずつしか読み込めないのでここでのジャンル判定は不要 when 1 music_name = music16 when 2 music_name = music17 when 3 music_name = music18 when 4 music_name = music19 when 5 music_name = music20 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 "music3-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/掲示板)に貼り付ける場合は以下のタグを利用してください。

リンク

プレイヤー

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

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