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

リソース周りを整理 #84

Merged
merged 4 commits into from
Feb 14, 2014
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
2 changes: 1 addition & 1 deletion public/js/src/beam/beam.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ bq.beam.Beam.createParticleBeam = function(beamType, shooterId, tag) {
beamType2Partile[bq.Types.Beams.METEOR] = cc.ParticleMeteor;

var particle = beamType2Partile[beamType];
var myTexture = cc.TextureCache.getInstance().textureForKey(s_beam0);
var myTexture = cc.TextureCache.getInstance().textureForKey(s_Beam0);

particle.setTexture(myTexture);
particle.setPosition(cc.p(0,0));
Expand Down
2 changes: 1 addition & 1 deletion public/js/src/entity/entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ bq.entity.Entity = cc.Sprite.extend({
tt.setPosition(cc.p(msgRect.getBoundingBox().getWidth() / 2, 10));

// 吹き出しのしっぽみたいなやつ
var tail = cc.Sprite.create(s_ChatTail);
var tail = cc.Sprite.create(s_ImgChatTail);
tail.setColor(cc.c3b(0, 0, 0));
tail.setOpacity(200);
tail.setPosition(cc.p(msgRect.getBoundingBox().getWidth() / 2, -3));
Expand Down
47 changes: 25 additions & 22 deletions public/js/src/resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,28 @@
// 設定値とかを入れる。
bq.beams = [];

// Note. 各種接頭辞をつけてね。(ex. 画像ならs_Img)

// img
var s_Player = 'res/img/player.png';
var s_ChatTail = 'res/img/chat_tail.png';
var s_PlayerWalkingImg = 'res/img/walk_anime.png';
var s_beam0 = 'res/img/star.png'; // TODO s_Beam0 にする (iwg)
var s_SimpleBeamImg = 'res/img/simple_beam.png';
var s_smoke0 = 'res/img/smoke.png'; // TODO s_Smoke0 にする (iwg)
var s_ImgPlayer = 'res/img/player.png';
var s_ImgChatTail = 'res/img/chat_tail.png';
var s_ImgPlayerWalking = 'res/img/player/walk.png';
var s_ImgBeam0 = 'res/img/beam/star.png';
var s_ImgSimpleBeam = 'res/img/beam/simple.png';
var s_ImgSmoke0 = 'res/img/beam/smoke.png';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

画像は s_Img を接頭辞にする

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

というコメントがあるとうれしいっす


// tmx
var s_ShinjukuTmx = 'res/map/shinjuku.tmx';
var s_ShinjukuMapSet= 'res/map/shinjuku_mapset.png';
var s_StartVillageTmx = 'res/map/map_village.tmx';
var s_StartVillageMapSet= 'res/map/tile_village.png';
var s_SmallVillageTmx = 'res/map/map_small_village.tmx';
var s_SmallVillageMapSet = 'res/map/tile_small_village.png';
// TODO s_Tmx, s_Tile はじまりにへんこー
var s_ShinjukuTmx = 'res/map/shinjuku.tmx';
var s_ShinjukuMapSet = 'res/map/shinjuku_mapset.png';
var s_StartVillageTmx = 'res/map/map_village.tmx';
var s_StartVillageMapSet = 'res/map/tile_village.png';
var s_SmallVillageTmx = 'res/map/map_small_village.tmx';
var s_SmallVillageMapSet = 'res/map/tile_small_village.png';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s_Tmx にしたかったけどMapSetは画像だからs_Imgのほうがいい?とか色々考えてると頭がフットーしそうだったのでここだけそのまま。インデント揃えただけ。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ガミに聞こう!!!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODOにして逃げた、あとで修正するっす


// plist
var s_PlayerWalkingPlist = 'res/img/walk_anime.plist';
var s_SimpleBeamPlist = 'res/img/simple_beam.plist';
var s_PlistPlayerWalking = 'res/img/player/walk.plist';
var s_PlistSimpleBeam = 'res/img/beam/simple.plist';

// sounds
var s_BgmField = 'res/sounds/Field.m4a';
Expand All @@ -34,19 +37,19 @@ var s_SeNoDamage = 'res/sounds/NoDamage.mp3';

var g_resources = [
//img
{type: 'image', src:s_Player},
{type: 'image', src:s_ImgPlayer},
//{type: 'image', src:s_ShinjukuMapSet},
{type: 'image', src:s_StartVillageMapSet},
{type: 'image', src:s_SmallVillageMapSet},
{type: 'image', src:s_ChatTail},
{type: 'image', src:s_PlayerWalkingImg},
{type: 'image', src:s_beam0},
{type: 'image', src:s_smoke0},
{type: 'image', src:s_SimpleBeamImg},
{type: 'image', src:s_ImgChatTail},
{type: 'image', src:s_ImgPlayerWalking},
{type: 'image', src:s_ImgBeam0},
{type: 'image', src:s_ImgSmoke0},
{type: 'image', src:s_ImgSimpleBeam},

//plist
{type: 'plist', src:s_PlayerWalkingPlist},
{type: 'plist', src:s_SimpleBeamPlist},
{type: 'plist', src:s_PlistPlayerWalking},
{type: 'plist', src:s_PlistSimpleBeam},

//fnt

Expand Down
4 changes: 2 additions & 2 deletions public/js/src/scene/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ bq.scene.LoginLayer = cc.Layer.extend({
// TODO: このクラスでframeCacheにセットするのはハイパー違和感があるので初期設定用のクラスとか作ってやりたい
// init frame cache
var frameCache = cc.SpriteFrameCache.getInstance();
frameCache.addSpriteFrames(s_PlayerWalkingPlist, s_PlayerWalkingImg);
frameCache.addSpriteFrames(s_PlistPlayerWalking, s_ImgPlayerWalking);
// FIXME ハイパー違和感2、誰か直して〜
frameCache.addSpriteFrames(s_SimpleBeamPlist, s_SimpleBeamImg);
frameCache.addSpriteFrames(s_PlistSimpleBeam, s_ImgSimpleBeam);

var player = new bq.entity.Player();
var position = data.player.position;
Expand Down
Binary file removed public/res/img/akeome.png
Binary file not shown.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
Binary file removed public/res/img/iwa.png
Binary file not shown.
File renamed without changes.
File renamed without changes