(function() {"use strict";var __module = CC_EDITOR ? module : {exports:{}};var __filename = 'preview-scripts/assets/script/bgControl.js';var __require = CC_EDITOR ? function (request) {return cc.require(request, require);} : function (request) {return cc.require(request, __filename);};function __define (exports, require, module) {"use strict";
cc._RF.push(module, '81bd6dLF6NEWIUQNeDwTTQ/', 'bgControl', __filename);
// script/bgControl.ts
// Learn TypeScript:
// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/typescript.html
// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html
// Learn Attribute:
// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html
Object.defineProperty(exports, "__esModule", { value: true });
var birdControl_1 = require("./birdControl");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var bgControl = /** @class */ (function (_super) {
__extends(bgControl, _super);
function bgControl() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.speed = 4;
_this.width = 4;
_this.bird = null;
return _this;
}
// LIFE-CYCLE CALLBACKS:
// onLoad () {}
bgControl.prototype.start = function () {
var _this = this;
for (var _i = 0, _a = this.node.children; _i < _a.length; _i++) {
var key = _a[_i];
key.on(cc.Node.EventType.MOUSE_DOWN, function () {
_this.bird.fly();
});
}
};
bgControl.prototype.update = function (dt) {
for (var _i = 0, _a = this.node.children; _i < _a.length; _i++) {
var key = _a[_i];
key.x -= this.speed * dt;
if (key.x < -this.width / 2) {
key.x = this.width / 2 * 3;
}
}
};
__decorate([
property
], bgControl.prototype, "speed", void 0);
__decorate([
property
], bgControl.prototype, "width", void 0);
__decorate([
property(birdControl_1.default)
], bgControl.prototype, "bird", void 0);
bgControl = __decorate([
ccclass
], bgControl);
return bgControl;
}(cc.Component));
exports.default = bgControl;
cc._RF.pop();
}
if (CC_EDITOR) {
__define(__module.exports, __require, __module);
}
else {
cc.registerModuleFunc(__filename, function () {
__define(__module.exports, __require, __module);
});
}
})();
//# sourceMappingURL=bgControl.js.map
没有合适的资源?快使用搜索试试~ 我知道了~
cocos2d flybird
共177个文件
json:95个
png:33个
meta:15个
需积分: 0 0 下载量 71 浏览量
2024-08-05
10:12:02
上传
评论
收藏 2.02MB RAR 举报
温馨提示
cocos2d 小鸟 残缺故障板
资源推荐
资源详情
资源评论
收起资源包目录
cocos2d flybird (177个子文件)
bird.anim 899B
bird.anim 899B
game.fire 30KB
game.fire 30KB
.gitignore 1KB
.gitignore 184B
NewProject.iml 344B
l2.jpg 129KB
95d3d914-ab98-4fad-9f48-fd8bc875b861.jpg 129KB
l3.jpg 61KB
9fb1106c-b54e-44dc-ac37-7235a28d8456.jpg 61KB
bgControl.js 3KB
birdControl.js 3KB
PipeContro.js 2KB
81bd674b-17a3-4458-8510-35e0f04d343f.js 2KB
d137a727-65a9-4d0a-9d1e-f3e5b6cef972.js 2KB
9b591165-d371-4de2-b1ef-63a64ddfea0e.js 2KB
fd66e99d-d41b-485d-85f3-119f492af9ec.json 30KB
d1b8be49-b0a0-435c-83b7-552bed4bbe35.json 20KB
bf0a434c-84dd-4a8e-a08a-7a36f180cc75.json 20KB
ca8401fe-ad6e-41a8-bd46-8e3e4e9945be.json 15KB
32044bd2-481f-4cf1-a656-e2b2fb1594eb.json 12KB
uuid-to-mtime.json 9KB
61aeb05b-3b32-452b-8eed-2b76deeed554.json 8KB
972b9a4d-47ee-4c74-b5c3-61d8a69bc29f.json 7KB
0004d1cf-a0ad-47d8-ab17-34d3db9d35a3.json 7KB
0d784963-d024-4ea6-a7db-03be0ad63010.json 6KB
5965ffac-69da-4b55-bcde-9225d0613c28.json 4KB
cd33edea-55f5-46c2-958d-357a01384a36.json 3KB
785a442c-3ceb-45be-a46e-7317f625f3b9.json 3KB
layout.windows.json 2KB
1f55e3be-b89b-4b79-88de-47fd31018044.json 2KB
96083d03-c332-4a3f-9386-d03e2d19e8ee.json 2KB
232d2782-c4bd-4bb4-9e01-909f03d6d3b9.json 2KB
8c5001fd-07ee-4a4b-a8a0-63e15195e94d.json 2KB
0e42ba95-1fa1-46aa-b2cf-143cd1bcee2c.json 2KB
4a37dd57-78cd-4cec-aad4-f11a73d12b63.json 2KB
27756ebb-3d33-44b0-9b96-e858fadd4dd4.json 2KB
2c937608-2562-40ea-b264-7395df6f0cea.json 2KB
7de03a80-4457-438d-95a7-3e7cdffd6086.json 1KB
329e7042-ba0d-496c-a360-89cf638825eb.json 899B
project.json 655B
5fe5dcaa-b513-4dc5-a166-573627b3a159.json 379B
5c3bb932-6c3c-468f-88a9-c8c61d458641.json 376B
29158224-f8dd-4661-a796-1ffab537140e.json 372B
e7aba14b-f956-4480-b254-8d57832e273f.json 372B
88e79fd5-96b4-4a77-a1f4-312467171014.json 372B
90004ad6-2f6d-40e1-93ef-b714375c6f06.json 372B
1a32fc76-f0bd-4f66-980f-56929c0ca0b3.json 371B
7168db62-0edc-42e5-be5d-682cf6c4a165.json 371B
e9ec654c-97a2-4787-9325-e6a10375219a.json 371B
7d4ffd94-42d6-4045-9db7-a744229adfc4.json 370B
f0048c10-f03e-4c97-b9d3-3506e1d58952.json 370B
c9fa51ff-3f01-4601-8f80-325d1b11dab7.json 370B
ff0e91c7-55c6-4086-a39f-cb6e457b8c3b.json 370B
6827ca32-0107-4552-bab2-dfb31799bb44.json 369B
67e68bc9-dad5-4ad9-a2d8-7e03d458e32f.json 369B
31d8962d-babb-4ec7-be19-8e9f54a4ea99.json 367B
a23235d1-15db-4b95-8439-a2e005bfff91.json 365B
8cdb44ac-a3f6-449f-b354-7cd48cf84061.json 362B
cbac2493-2975-4137-888a-99e65e9f1771.json 362B
9bbda31e-ad49-43c9-aaf2-f7d9896bac69.json 361B
1a18d232-d008-4101-969d-571a9746e99e.json 359B
ae78e2bb-1a32-4029-9803-8ea96502c5b6.json 359B
48a08998-2acd-44aa-88e3-dae430bb1f28.json 359B
e0a3fbf8-fb2d-45d6-9f3d-25edb09dbec3.json 358B
91cae6a0-5a54-4c8a-825a-ef2df5786439.json 357B
c93caa8c-ccac-48b9-8448-86c7b76f5566.json 354B
b100d15e-7a8b-4211-9f90-919ba2410698.json 354B
bb42ed8e-0867-4584-ad63-b6f84f83bba8.json 352B
472df5d3-35e7-4184-9e6c-7f41bee65ee3.json 352B
jsconfig.json 280B
node-tree-state.json 268B
b2687ac4-099e-403c-a192-ff477686f4f5.json 175B
b8223619-7e38-47c4-841f-9160c232495a.json 175B
2be36297-9abb-4fee-8049-9ed5e271da8a.json 95B
console.json 80B
services.json 80B
1fdbe318-0226-498a-bbf3-ede7685a22ab.json 74B
567dcd80-8bf4-4535-8a5a-313f1caf078a.json 74B
dfe08dd9-d0ff-434c-bc23-6186d3a8f283.json 74B
9d60001f-b5f4-4726-a629-2659e3ded0b8.json 74B
c25b9d50-c8fc-4d27-beeb-6e7c1f2e5c0f.json 74B
617323dd-11f4-4dd3-8eec-0caf6b3b45b9.json 74B
e851e89b-faa2-4484-bea6-5c01dd9f06e2.json 74B
71561142-4c83-4933-afca-cb7a17f67053.json 74B
cfef78f1-c8df-49b7-8ed0-4c953ace2621.json 74B
9fb1106c-b54e-44dc-ac37-7235a28d8456.json 74B
d81ec8ad-247c-4e62-aa3c-d35c4193c7af.json 74B
99170b0b-d210-46f1-b213-7d9e3f23098a.json 74B
95d3d914-ab98-4fad-9f48-fd8bc875b861.json 74B
d0a82d39-bede-46c4-b698-c81ff0dedfff.json 74B
962dcc62-d1c9-4673-baf2-ef6041c74d5a.json 74B
8a96b965-2dc0-4e03-aa90-3b79cb93b5b4.json 74B
edd215b9-2796-4a05-aaf5-81f96c9281ce.json 74B
4bab67cb-18e6-4099-b840-355f0473f890.json 74B
939f1da3-303d-4bde-be0e-46ea0001d5a1.json 74B
6e056173-d285-473c-b206-40a7fff5386e.json 74B
b181c1e4-0a72-4a91-bfb0-ae6f36ca60bd.json 74B
b43ff3c2-02bb-4874-81f7-f2dea6970f18.json 74B
共 177 条
- 1
- 2
资源评论
watson_pillow
- 粉丝: 13
- 资源: 18
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功