let Utils = require("Utils");
let ShareSdk = require("ShareSdk");
let RankList = require("RankList");
cc.Class({
extends: cc.Component,
properties: {
m_n_gamenode: cc.Node,
m_n_bg_panel: cc.Node,
m_pre_blockbg: cc.Prefab,
m_pre_light: cc.Prefab,
m_pre_boomeffect: cc.Prefab,
m_pre_boom: cc.Prefab,
m_l_boomnum: cc.Label,
m_l_score: cc.Label,
m_sp_monster: cc.Sprite,
m_l_level: cc.Label,
m_n_result_panel: cc.Node,
m_btn_tool2: cc.Node,
m_n_guidemask: cc.Node,
m_n_tooluse: cc.Node,
m_n_showtime: {
type: cc.Node,
default: []
},
m_spf_gold: cc.SpriteFrame,
m_n_askpanel: cc.Node,
m_n_boss: cc.Node,
m_spriteAtlas: cc.SpriteAtlas,
m_n_bglist: cc.Node,
m_l_gold: cc.Label,
m_pre_rock: cc.Prefab,
m_n_kuai: {
type: cc.Node,
default: []
},
m_n_displaycheck: cc.Node,
m_n_displayrank: cc.Node,
m_n_stepview: cc.Node,
m_n_reliveview: cc.Node,
m_n_video: cc.Node,
m_n_lookvideo: cc.Node,
m_n_luckyvideo: cc.Node,
m_n_doublevideo: cc.Node,
m_n_doublescore: cc.Node,
m_n_sharegift: cc.Node,
m_n_skinpanel: cc.Node,
m_n_guidenode: cc.Node,
m_l_asktype: cc.Label,
m_n_guidefiger: cc.Node,
},
// LIFE-CYCLE CALLBACKS:
onLoad() {
window.GAME_CONTROL = this;
Utils.setDesignResolution();
},
onDestroy() {
this.m_block_pool.clear();
this.m_light_pool.clear();
window.GAME_CONTROL = null;
if (this.m_bannerad) {
this.m_bannerad.destroy();
this.m_bannerad = null;
}
EVENT_LISTENER.off(window.GAME_UPDATE_DATA, this);
EVENT_LISTENER.off(window.GAME_SAVE_HANDLER, this);
},
start() {
if (window.firstGame)
window.firstGame = false;
this.createMap();
this.initData();
this.initMonster(this.m_cur_level);
this.showAdBanner(false);
this.node.on(cc.Node.EventType.TOUCH_END, this.touchEnd, this);
EVENT_LISTENER.on(window.GAME_UPDATE_DATA, this.updateGold, this);
EVENT_LISTENER.on(window.GAME_SAVE_HANDLER, this.updateSkin, this);
},
initData() {
this.m_n_skinpanel.getComponent("SkinPanel").initData();
this.m_n_displaycheck.active = true;
this.m_n_displayrank.active = false;
this.m_n_lookvideo.active = false;
this.m_n_doublescore.active = false;
this.m_gamestate = 0;
this.m_cur_score = 0;
this.m_cur_level = window.INIT_GAME_SAVE_DATA.top_level + 1;
this.m_normal_talktime = 4; //怪物说话间隔
this.m_normal_curtime = -1;
this.m_target_block = [];
this.m_mapblink = false;
this.m_touch_boom = false;
this._relivenum = 0;
this._videonum = 0;
this._killnum = 0;
this.m_l_score.string = this.m_cur_score;
this.m_doublescore = 1;
// this.m_l_solidernum.string = "X" + this.m_solidernum;
this.m_l_level.string = "LV." + this.m_cur_level;
this.m_l_gold.string = window.INIT_GAME_SAVE_DATA.gold_num;
this._isdeleting = false //判断是否正在消除的依据
this._isbless = false; //是否已经恩赐过
this.m_block_pool = new cc.NodePool();
this.m_light_pool = new cc.NodePool();
this.updateToolsNum();
this.schedule(function () {
this.m_btn_tool2.runAction(cc.sequence(cc.repeat(cc.sequence(cc.rotateTo(0.1, -10), cc.rotateTo(0.1, 10)), 3), cc.rotateTo(0.1, 0)));
this.m_n_video.runAction(cc.sequence(cc.delayTime(1.0), cc.repeat(cc.sequence(cc.rotateTo(0.1, -10), cc.rotateTo(0.1, 10)), 3), cc.rotateTo(0.1, 0)));
this.m_n_doublevideo.runAction(cc.sequence(cc.delayTime(2.0), cc.repeat(cc.sequence(cc.rotateTo(0.1, -10), cc.rotateTo(0.1, 10)), 3), cc.rotateTo(0.1, 0)))
}, 5);
this._configlist = this.m_n_kuai[0].getComponent("ShapeItem").getTheConfig();
RankList.checkWillSurpass(this.m_cur_score);
let rand = Utils.random(0, 1000);
this.m_n_luckyvideo.active = rand <= 500 && this.m_cur_level > 1;
if (this.m_n_luckyvideo.active) {//第一关不出现
this.m_n_luckyvideo.scale = 0;
this.m_n_luckyvideo.runAction(cc.sequence(cc.scaleTo(0.2, 1.2, 1.2).easing(cc.easeIn(3.0)), cc.scaleTo(0.1, 1, 1)));
if (window.SKIN_SHARE) {
let node = cc.find("btn_cancel", this.m_n_luckyvideo);
node.y = -570;
this.scheduleOnce(() => {
node.y = -514;
if (this.m_n_luckyvideo.active && !this.showAdb)
this.showAdBanner(true);
}, 1.8)
}
}
},
hideGuide() {
if (this.m_cur_level == 1) {
this.m_n_guidenode.active = false;
this.m_n_guidefiger.stopAllActions();
this.m_n_guidefiger.active = false;
window.GUIDE_LEVEL = 1;
cc.sys.localStorage.setItem('guideinfo', '1');
}
},
showGuide() {
if (!this._tempguide) {
this._tempguide = true;
} else { return; }
let typeindex = 0;
let indexlist = window.INIT_GAME_SAVE_DATA.skin;
for (let i = 0; i < indexlist.length; i++) {
if (indexlist[i] >= 2) {
typeindex = i;
break;
}
}
let data = window.SKIN_CONFIG[typeindex];
this.m_n_guidenode.active = true;
this.m_n_guidefiger.active = true;
this.m_n_guidefiger.position = this.m_n_kuai[1].position;
this.m_n_guidefiger.runAction(cc.repeatForever(cc.sequence(cc.callFunc(() => {
this.m_n_guidefiger.position = this.m_n_kuai[1].position;
}), cc.moveTo(1.0, this.m_n_kuai[1].x, this.m_n_kuai[1].y + 350))));
let index = this.m_n_kuai[0].getComponent("ShapeItem").getCurColorIndex();
let blockindex = [];
blockindex[46] = 1;
blockindex[52] = 1;
blockindex[53] = 1;
blockindex[58] = 1;
for (let i = 43; i < 61; i++) {
if (blockindex[i]) {
// this.m_maparray[i].getComponent("BlockBGItem").setBrightVisible(true, '#000000');
} else {
let node = new cc.Node("colorSpr");
node.colorIndex = index;
node.colorName = data.name;
let sprite = node.addComponent(cc.Sprite);
console.log(data.name, index);
sprite.spriteFrame = this.m_spriteAtlas.getSpriteFrame(data.name + index);
node.position = cc.Vec2.ZERO;
node.parent = this.m_maparray[i];
this.m_maparray[i].isHaveFK = true;
}
}
},
onKeepGoing() {
this.m_n_luckyvideo.active = false;
this.showAdBanner(false);
},
touchEnd(event) {
if (this.m_gamestate == 0 && this.m_touch_boom) {
this.m_gamestate = 2;
let vec = event.touch.getLocation();
vec = this.m_n_gamenode.convertToNodeSpace(vec);
let index = this.backIndexofList(vec);
if (index >= 0) {
if (!this.m_maparray[index].isHaveFK) {
this.m_maparray[index].isHaveFK = true;
let node = cc.instantiate(this.m_pre_boom);
node.parent = this.m_maparray[index];
window.INIT_GAME_SAVE_DATA.tool[0] -= 1;
this.updateToolsNum();
this.doBoomAction(this.m_maparray[index].position, index);
}
}
this.m_n_guidemask.active = !this.m_mapblink;
this.m_touch_boom = !this.m_map
没有合适的资源?快使用搜索试试~ 我知道了~
消灭怪兽-creator源码.zip源码cocos creator项目源码下载
共381个文件
meta:195个
png:54个
js:34个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 2 下载量 145 浏览量
2022-03-18
10:59:05
上传
评论 1
收藏 3.72MB ZIP 举报
温馨提示
消灭怪兽-creator源码.zip源码cocos creator项目源码下载消灭怪兽-creator源码.zip源码cocos creator项目源码下载 1.上线产品适合个人学习技术做项目参考 2.开发脚本为javsScropt或者typeScript 3.上线产品适合小公司开发游戏项目参考
资源推荐
资源详情
资源评论
收起资源包目录
消灭怪兽-creator源码.zip源码cocos creator项目源码下载 (381个子文件)
loveaction.anim 10KB
effect_star.anim 9KB
bombeffect.anim 4KB
monster1move.anim 2KB
monster0move.anim 2KB
monster3move.anim 2KB
monster2move.anim 2KB
behit_effect.anim 2KB
shareicon.anim 2KB
rqcodeicon.anim 2KB
boomeffect.anim 1KB
monster3stand.anim 1KB
monster2stand.anim 1KB
monster1stand.anim 1KB
monster0stand.anim 1KB
block_scaleanimloop.anim 1KB
bubbleanim.anim 1KB
block_scaleanim.anim 1012B
anim_show.anim 904B
playstep.anim 814B
circle_anim.anim 796B
monster0hit.anim 761B
monster1hit.anim 761B
gift.anim 760B
awardAction.anim 754B
monster2hit.anim 725B
monster3hit.anim 725B
light_action.anim 385B
.DS_Store 10KB
.DS_Store 6KB
.DS_Store 6KB
GameMain.fire 309KB
GameMenu.fire 152KB
GameStep.fire 33KB
GameLoad.fire 10KB
scorenumber1.fnt 2KB
scorenum2.fnt 2KB
bg2.jpg 43KB
menubg1.jpg 42KB
bg1.jpg 38KB
star4.jpg 11KB
star3.jpg 9KB
star0.jpg 9KB
star1.jpg 8KB
star2.jpg 8KB
icon.jpg 5KB
GameMain.js 44KB
Config.js 18KB
Utils.js 16KB
ShapeItem.js 14KB
GameMenu.js 9KB
GameLoad.js 9KB
MonsterItem.js 7KB
ShareSdk.js 7KB
GuideManager.js 5KB
NewBieGift.js 5KB
launch.js 5KB
ReliveViewCtrl.js 5KB
EffectCommon.js 4KB
UseToolItem.js 4KB
PlatformCom.js 3KB
Data.js 3KB
Wave_VH.js 3KB
BlockItem.js 2KB
RankList.js 2KB
GameResult.js 2KB
event_listener.js 2KB
BombEffectItem.js 1KB
Wxlife.js 1KB
GameEndRank.js 1005B
use_v2.0.x_cc.Toggle_event.js 971B
ccShader_wave.js 950B
use_reversed_rotateBy.js 765B
BgSetting.js 422B
BgItem.js 390B
BlockBGItem.js 376B
ccShader_Wave_VH_Frag.js 370B
ccShader_Default_Vert_noMVP.js 285B
RockItem.js 269B
ccShader_Default_Vert.js 260B
package-lock.json 13KB
package.json 13KB
services.json 6KB
level_config2.json 4KB
project.json 1KB
builder.json 1KB
jsconfig.json 280B
builder.panel.json 177B
project.json 145B
block.plist.meta 17KB
stepiconlist.plist.meta 15KB
monster3.plist.meta 8KB
monster0.plist.meta 8KB
monster1.plist.meta 7KB
monster2.plist.meta 7KB
menu_ui.plist.meta 6KB
tangkuang.plist.meta 5KB
ui.plist.meta 5KB
behiteffect.plist.meta 4KB
stepview.plist.meta 3KB
共 381 条
- 1
- 2
- 3
- 4
资源评论
- zx15957807102022-11-04非常有用的资源,有一定的参考价值,受益匪浅,值得下载。
- 凄凉山谷的风OL2022-07-12这个资源对我启发很大,受益匪浅,学到了很多,谢谢分享~
yxkfw
- 粉丝: 76
- 资源: 2万+
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于Matlab人脸肤色定理的教师人数统计+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于Matlab霍夫曼变换的表盘读数识别+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于Matlab火灾烟雾检测源码带GUI界面+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于Matlab的恶劣天气交通标志识别系统+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于MATLAB的霍夫曼变换的表盘示数识别+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于Matlab的车道线识别系统 +源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于MATLAB的教室人数统计系统带Gui界面+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于MATLAB的教室人数统计系统带Gui界面+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于MATLAB 的霍夫曼变换答题卡识别源码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于Matlab+bp神经网络的神经网络汉字识别系统+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功