リビジョン 5ec4ad9d app/webroot/js/pictcode/sprite_data.js
| app/webroot/js/pictcode/sprite_data.js | ||
|---|---|---|
| 3 | 3 |
//----------------Sprite画像----------------// |
| 4 | 4 |
|
| 5 | 5 |
var spriteImageInfos = [ |
| 6 |
{imageNames:["car01.png", "car02.png"], category:"vehicle", imageKey:0},
|
|
| 6 |
|
|
| 7 |
//Vehicle |
|
| 8 |
{imageNames:["001_char_img_car_010.png", "001_char_img_car_020.png"], category:"car", imageKey:0},
|
|
| 9 |
{imageNames:["001_char_img_car_030.png", "001_char_img_car_040.png"], category:"car", imageKey:1},
|
|
| 10 |
{imageNames:["001_char_img_car_050.png", "001_char_img_car_060.png"], category:"car", imageKey:2},
|
|
| 11 |
{imageNames:["001_char_img_car_070.png", "001_char_img_car_080.png"], category:"car", imageKey:3},
|
|
| 12 |
{imageNames:["001_char_img_bus_010.png", "001_char_img_bus_020.png"], category:"car", imageKey:4},
|
|
| 13 |
{imageNames:["001_char_img_bus_030.png", "001_char_img_bus_040.png"], category:"car", imageKey:5},
|
|
| 7 | 14 |
{imageNames:["car03.png"], category:"vehicle", imageKey:1},
|
| 8 |
{imageNames:["mogura01.png"], category:"animal", imageKey:2},
|
|
| 9 |
{imageNames:["dolphin01.png", "dolphin02.png"], category:"animal", imageKey:3},
|
|
| 10 |
{imageNames:["whale01.png", "whale02.png"], category:"animal", imageKey:4},
|
|
| 11 |
{imageNames:["dog01.png", "dog02.png"], category:"animal", imageKey:5},
|
|
| 12 |
{imageNames:["nohara.png"], category:"background", imageKey:6},
|
|
| 13 |
{imageNames:["dokan.png"], category:"artifact", imageKey:7},
|
|
| 15 |
|
|
| 16 |
//Animal |
|
| 17 |
{imageNames:["001_char_img_dolphin_010.png", "001_char_img_dolphin_020.png"], category:"animal", imageKey:100},
|
|
| 18 |
{imageNames:["001_char_img_whale_010.png", "001_char_img_whale_020.png"], category:"animal", imageKey:101},
|
|
| 19 |
{imageNames:["001_char_img_dog_010.png"], category:"animal", imageKey:102},
|
|
| 20 |
{imageNames:["001_char_img_dog_020.png", "001_char_img_dog_030.png"], category:"animal", imageKey:103},
|
|
| 21 |
{imageNames:["001_char_img_dog_040.png"], category:"animal", imageKey:104},
|
|
| 22 |
{imageNames:["001_char_img_dog_050.png", "001_char_img_dog_060.png"], category:"animal", imageKey:105},
|
|
| 23 |
{imageNames:["001_char_img_cat_010.png"], category:"animal", imageKey:106},
|
|
| 24 |
{imageNames:["001_char_img_cat_020.png", "001_char_img_cat_030.png"], category:"animal", imageKey:107},
|
|
| 25 |
{imageNames:["001_char_img_mouse_010.png"], category:"animal", imageKey:108},
|
|
| 26 |
{imageNames:["001_char_img_mouse_020.png", "001_char_img_mouse_030.png"], category:"animal", imageKey:109},
|
|
| 27 |
{imageNames:["001_char_img_mole_010.png"], category:"animal", imageKey:110},
|
|
| 28 |
{imageNames:["001_char_img_mole_020.png"], category:"animal", imageKey:111},
|
|
| 29 |
{imageNames:["001_char_img_mole_030.png"], category:"animal", imageKey:112},
|
|
| 30 |
|
|
| 31 |
//Background |
|
| 32 |
{imageNames:["001_char_bg_bg_010.png"], category:"background", imageKey:200},
|
|
| 33 |
{imageNames:["001_char_bg_bg_020.png"], category:"background", imageKey:201},
|
|
| 34 |
{imageNames:["001_char_bg_bg_030.png"], category:"background", imageKey:202},
|
|
| 35 |
{imageNames:["001_char_bg_bg_040.png"], category:"background", imageKey:203},
|
|
| 36 |
|
|
| 37 |
//Artifact |
|
| 38 |
{imageNames:["001_char_img_pipe_010.png"], category:"artifact", imageKey:300},
|
|
| 39 |
|
|
| 40 |
//Airplane |
|
| 41 |
{imageNames:["001_char_img_airplane_010.png"], category:"airplane", imageKey:400},
|
|
| 42 |
{imageNames:["001_char_img_airplane_020.png"], category:"airplane", imageKey:401},
|
|
| 43 |
{imageNames:["001_char_img_airplane_030.png"], category:"airplane", imageKey:402},
|
|
| 44 |
{imageNames:["001_char_img_airplane_040.png"], category:"airplane", imageKey:403},
|
|
| 45 |
{imageNames:["001_char_img_bomb_010.png", "001_char_img_bomb_020.png"], category:"airplane", imageKey:404},
|
|
| 46 |
{imageNames:["001_char_img_bomb_030.png", "001_char_img_bomb_040.png"], category:"airplane", imageKey:405},
|
|
| 47 |
|
|
| 48 |
//Board |
|
| 49 |
{imageNames:["001_char_img_display_010.png"], category:"board", imageKey:500},
|
|
| 50 |
{imageNames:["001_char_img_display_020.png"], category:"board", imageKey:501},
|
|
| 51 |
{imageNames:["001_char_img_display_030.png"], category:"board", imageKey:502},
|
|
| 52 |
{imageNames:["game_clear.png"], category:"board", imageKey:503},
|
|
| 53 |
{imageNames:["game_over.png"], category:"board", imageKey:504},
|
|
| 54 |
{imageNames:["arrow1.png"], category:"board", imageKey:505},
|
|
| 55 |
{imageNames:["transparent_board.png"], category:"board", imageKey:506},
|
|
| 56 |
|
|
| 57 |
//Fish |
|
| 58 |
{imageNames:["001_char_img_fish_010.png", "001_char_img_fish_020.png"], category:"fish", imageKey:600},
|
|
| 59 |
{imageNames:["001_char_img_fish_030.png", "001_char_img_fish_040.png"], category:"fish", imageKey:601},
|
|
| 60 |
{imageNames:["001_char_img_fish_050.png", "001_char_img_fish_060.png"], category:"fish", imageKey:602},
|
|
| 61 |
{imageNames:["shell.png"], category:"fish", imageKey:603},
|
|
| 62 |
|
|
| 63 |
//Instrument |
|
| 64 |
{imageNames:["001_char_img_inst_010.png", "001_char_img_inst_020.png"], category:"instrument", imageKey:700},
|
|
| 65 |
{imageNames:["001_char_img_inst_030.png", "001_char_img_inst_040.png"], category:"instrument", imageKey:701},
|
|
| 66 |
{imageNames:["001_char_img_inst_050.png", "001_char_img_inst_060.png"], category:"instrument", imageKey:702},
|
|
| 67 |
{imageNames:["music_note.png"], category:"instrument", imageKey:703},
|
|
| 14 | 68 |
]; |
| 15 | 69 |
|
| 16 | 70 |
function loadSpriteImages(sprts, didLoadImages){
|
| ... | ... | |
| 23 | 77 |
return sprite.imageKey == spImgInf.imageKey; |
| 24 | 78 |
}); |
| 25 | 79 |
|
| 26 |
if (!spriteImageInfo || spriteImageInfo.images) {
|
|
| 27 |
continue; |
|
| 28 |
}; |
|
| 80 |
// if (!spriteImageInfo || spriteImageInfo.images) {
|
|
| 81 |
// continue;
|
|
| 82 |
// };
|
|
| 29 | 83 |
isLoading = true; |
| 30 | 84 |
|
| 31 | 85 |
spriteImageInfo.images = []; |
| 32 |
loadingCount++; |
|
| 33 |
var lc = 0; |
|
| 86 |
sprite.images = spriteImageInfo.images; |
|
| 87 |
loadingCount += spriteImageInfo.imageNames.length; |
|
| 88 |
// var lc = 0; |
|
| 34 | 89 |
_.each(spriteImageInfo.imageNames, function(imageName){
|
| 35 |
var path = "image/sprite/" + spriteImageInfo.category + "/" + imageName; |
|
| 90 |
//var path = "image/sprite/" + spriteImageInfo.category + "/" + imageName; |
|
| 91 |
var path = "/img/pictcode/sprite/" + spriteImageInfo.category + "/" + imageName; |
|
| 36 | 92 |
var spImage = new Image(); |
| 37 | 93 |
spImage.src = path; |
| 38 | 94 |
spriteImageInfo.images.push(spImage); |
| 39 | 95 |
spImage.onload = function(){
|
| 40 |
lc++; |
|
| 41 |
if (lc >= spriteImageInfo.imageNames.length) {
|
|
| 42 |
loadingCount--; |
|
| 43 |
}; |
|
| 96 |
// lc++; |
|
| 97 |
// if (lc >= spriteImageInfo.imageNames.length) {
|
|
| 98 |
// loadingCount--; |
|
| 99 |
// }; |
|
| 100 |
loadingCount--; |
|
| 44 | 101 |
if (loadingCount <= 0) {
|
| 45 | 102 |
didLoadImages(); |
| 46 | 103 |
}; |
| ... | ... | |
| 60 | 117 |
if (!spriteImageInfo.images) {
|
| 61 | 118 |
spriteImageInfo.images = []; |
| 62 | 119 |
_.each(spriteImageInfo.imageNames, function(imageName){
|
| 63 |
var path = "image/sprite/" + spriteImageInfo.category + "/" + imageName; |
|
| 120 |
//var path = "image/sprite/" + spriteImageInfo.category + "/" + imageName; |
|
| 121 |
var path = "/img/pictcode/sprite/" + spriteImageInfo.category + "/" + imageName; |
|
| 64 | 122 |
var spImage = new Image(); |
| 65 | 123 |
spImage.src = path; |
| 66 | 124 |
spImage.width = initSize/2; |
| ... | ... | |
| 98 | 156 |
//----------------カテゴリ画像----------------// |
| 99 | 157 |
|
| 100 | 158 |
var categoryInfos =[ |
| 101 |
{name: "vehicle", imageKey: "ctgry_spr_004"},
|
|
| 159 |
{name: "car", imageKey: "ctgry_spr_004"},
|
|
| 160 |
{name: "airplane", imageKey: "ctgry_spr_006"},
|
|
| 102 | 161 |
{name: "animal", imageKey: "ctgry_spr_001"},
|
| 162 |
{name: "fish", imageKey: "ctgry_spr_008"},
|
|
| 103 | 163 |
{name: "background", imageKey: "ctgry_spr_003"},
|
| 164 |
{name: "instrument", imageKey: "ctgry_spr_007"},
|
|
| 104 | 165 |
{name: "artifact", imageKey: "ctgry_spr_002"},
|
| 105 |
{name: "forest", imageKey: "ctgry_spr_005"},
|
|
| 166 |
{name: "board", imageKey: "ctgry_spr_005"},
|
|
| 106 | 167 |
]; |
| 107 | 168 |
|
| 108 | 169 |
return {
|
| ... | ... | |
| 112 | 173 |
findSpriteImageInfoFromImageKey:findSpriteImageInfoFromImageKey, |
| 113 | 174 |
categoryInfos:categoryInfos, |
| 114 | 175 |
}; |
| 115 |
}); |
|
| 176 |
}); |
|
他の形式にエクスポート: Unified diff