Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ビーム撃ったら音が出た #17

Merged
merged 3 commits into from
Dec 31, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions public/js/src/entity/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ var Player = Entity.extend({
if ( b == null ) {
// TODO どうする??
} else {
cc.AudioEngine.getInstance().playEffect(s_SeBeamA);
b.initDestination(diff);
b.setPosition(0,0);
}
Expand Down
5 changes: 3 additions & 2 deletions public/js/src/resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @fileoverview スタティックファイルなど置く。g_resourcesで定義したものはゲーム開始前に事前にloadされる。
*/

cc.AudioEngine.getInstance().init("aac,mp3,ogg,wav");
// BeamQuest用のグローバル変数。こいつはどのコードからでも読み出し可能。
// 設定値とかを入れる。
var bq = {
Expand All @@ -25,6 +24,7 @@ var s_PlayerWalkingPlist = 'res/img/walk_anime.plist';

// bgm
var s_BgmField = 'res/sounds/Field.m4a';
var s_SeBeamA = 'res/sounds/BeamA.m4a';

var g_resources = [
//img
Expand All @@ -44,7 +44,8 @@ var g_resources = [
{type: 'tmx', src:s_ShinjukuTmx},

//bgm
{type:"bgm",src:s_BgmField}
{type:"bgm",src:s_BgmField},
{type:"bgm",src:s_SeBeamA}

//effect
];
Expand Down
3 changes: 3 additions & 0 deletions public/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ var cocos2dApp = cc.Application.extend({
// set FPS. the default value is 1.0/60 if you don't call this
director.setAnimationInterval(1.0 / this.config['frameRate']);

// initialize audio engine
cc.AudioEngine.getInstance().init("aac,mp3,ogg,wav");

//load resources
cc.LoaderScene.preload(g_resources, function () {
// preload sprite frames
Expand Down
Binary file added public/res/sounds/BeamA.m4a
Binary file not shown.