Commit e5b3decd by 李楚霏

马甲包10.30版本

parent c3091798
#/////////////////////////////////////////////////////////////////////////////
# Fireball Projects
#/////////////////////////////////////////////////////////////////////////////
/library/
/temp/
/local/
/build/
#/////////////////////////////////////////////////////////////////////////////
# npm files
#/////////////////////////////////////////////////////////////////////////////
npm-debug.log
node_modules/
#/////////////////////////////////////////////////////////////////////////////
# Logs and databases
#/////////////////////////////////////////////////////////////////////////////
*.log
*.sql
*.sqlite
#/////////////////////////////////////////////////////////////////////////////
# files for debugger
#/////////////////////////////////////////////////////////////////////////////
*.sln
*.csproj
*.pidb
*.unityproj
*.suo
#/////////////////////////////////////////////////////////////////////////////
# OS generated files
#/////////////////////////////////////////////////////////////////////////////
.DS_Store
ehthumbs.db
Thumbs.db
#/////////////////////////////////////////////////////////////////////////////
# WebStorm files
#/////////////////////////////////////////////////////////////////////////////
.idea/
#//////////////////////////
# VS Code files
#//////////////////////////
.vscode/
{
"ver": "1.0.1",
"uuid": "66a92ee0-4f0a-4246-bd13-cb7654d3fdc3",
"asyncLoadAssets": false,
"autoReleaseAssets": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "dbbcd465-08a7-4879-b6b0-da5a5d166e94",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.2.0",
"uuid": "10535015-8839-4b9f-9562-0cf4dc8b4381",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"subMetas": {
"bg": {
"ver": "1.0.4",
"uuid": "9d7f0bd8-a93c-4d4a-a905-8a0594c65a44",
"rawTextureUuid": "10535015-8839-4b9f-9562-0cf4dc8b4381",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 309,
"height": 480,
"rawWidth": 309,
"rawHeight": 480,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false
},
{
"__type__": "cc.Node",
"_name": "图层0_10",
"_objFlags": 0,
"_parent": null,
"_children": [],
"_active": true,
"_level": 1,
"_components": [
{
"__id__": 2
}
],
"_prefab": {
"__id__": 3
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 60,
"height": 60
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_position": {
"__type__": "cc.Vec3",
"x": 177,
"y": 1032,
"z": 0
},
"_scale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_rotationX": 0,
"_rotationY": 0,
"_quat": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_skewX": 0,
"_skewY": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a168d7ba-9e00-45f1-a813-8fffda1bd6bd"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_state": 0,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "2dedfabe-2a1a-4b49-8219-566b09541233"
},
"fileId": "1cdFO5oRNM946ICVBfspH7",
"sync": false
}
]
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "2dedfabe-2a1a-4b49-8219-566b09541233",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"subMetas": {}
}
\ No newline at end of file
{
{
"ver": "2.2.0",
"uuid": "ddbc6a73-a569-4b05-9af8-21a8d3fd5522",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"subMetas": {
"图层0": {
"ver": "1.0.4",
"uuid": "34cd1c13-1618-4265-a4bf-019f19ef9f20",
"rawTextureUuid": "ddbc6a73-a569-4b05-9af8-21a8d3fd5522",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 348,
"height": 421,
"rawWidth": 348,
"rawHeight": 421,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
{
"ver": "2.2.0",
"uuid": "12615b45-896c-45ed-8fc8-5612d5f913b5",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"subMetas": {
"图层0_10": {
"ver": "1.0.4",
"uuid": "a168d7ba-9e00-45f1-a813-8fffda1bd6bd",
"rawTextureUuid": "12615b45-896c-45ed-8fc8-5612d5f913b5",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 462,
"height": 460,
"rawWidth": 462,
"rawHeight": 460,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "c045a6ef-fdcd-44f1-ba31-aff8ab7b6517",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}
\ No newline at end of file
/*
* @Author: your name
* @Date: 2019-10-30 22:01:59
* @LastEditTime: 2019-10-30 22:51:48
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \_Happydinosaur\assets\script\dinosaurGame.js.js
*/
// Learn cc.Class:
// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/class.html
// - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/class.html
// Learn Attribute:
// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
// - [English] http://docs.cocos2d-x.org/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] https://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html
cc.Class({
extends: cc.Component,
properties: {
player: cc.Node,
spherePreb: cc.Prefab,
clickNode: cc.Node,
startBtn: cc.Button,
mainPanel: cc.Node,
startPanel: cc.Node,
overPanel: cc.Node,
restarBtn: cc.Button,
},
// LIFE-CYCLE CALLBACKS:
onLoad() {
this.player.y = -(cc.winSize.height / 2) + 100;
this.registerEvent();
this.startGame = false;
this.playerisDead = false /*玩家死亡状态 */
this.startPanel.active = true;
this.mainPanel.active = false;
this.overPanel.active = false; /* 结束界面 */
},
/*
**点击开始按钮开始游戏
*/
overGame() {
this.startGame=false;
this.overPanel.active = true;
this.mainPanel.active = false;
this.unschedule(this.addSphere); /* 当游戏结束时停止生成sphere */
},
onStartBtn() {
this.startPanel.active = false;
this.mainPanel.active = true;
this.overPanel.active = false;
this.startGame = true;
this.sphereArr = [];
this.addSphere();
this.schedule(this.addSphere, 0.5);
},
onRestartBtn() {
this.startPanel.active = true;
this.overPanel.active = false;
this.unschedule(this.addSphere);
},
addSphere() {
const sphereNode = cc.instantiate(this.spherePreb);
const widthSize = cc.winSize.width - 200;
const heightSize = cc.winSize.height;
this.sphereArr.push(sphereNode);
this.node.addChild(sphereNode);
let posX = Math.random() * (widthSize - (-widthSize)) + (-widthSize);
sphereNode.scale=Math.random()*((sphereNode.scale-0.5)+2);
sphereNode.setPosition(cc.v2(posX, cc.winSize.height / 2 + 50));
let moveToAction = cc.moveTo(1, cc.v2(posX, -(cc.winSize.height / 2) + 100));
sphereNode.runAction(cc.sequence(moveToAction, cc.callFunc(() => {
this.destroySphere(sphereNode);
})));
},
destroySphere(sphere) {
this.RemoveFromArr(this.sphereArr, sphere);
sphere.destroy();
},
RemoveFromArr(arr, ele) {
if (arr instanceof Array) {
const index = arr.indexOf(ele);
if (index > -1) {
arr.splice(index, 1);
}
}
},
registerEvent() {
this.clickNode.on(cc.Node.EventType.TOUCH_MOVE, this.playerMove, this); /* */
},
playerMove(event) {
const pos = event.getLocation();
const prePos = event.getPreviousLocation();
if (pos.x > prePos.x) {
this.player.scaleX = -1;
} else if (pos.x < prePos.x) {
this.player.scaleX = 1;
}
this.player.x += pos.x - prePos.x;
if (this.player.x > cc.winSize.width / 2 - 90)
this.player.x = cc.winSize.width / 2 - 90;
else if (this.player.x < -(cc.winSize.width / 2) + 90)
this.player.x = -(cc.winSize.width / 20) + 90;
},
distance(sphereNode) {
const dinasourPos = this.player.getPosition();
const lineDistance = sphereNode.getPosition().sub(dinasourPos).mag();
return lineDistance;
},
update(dt) {
// this.time-=dt;
if (this.startGame) {
for (const sphereItem of this.sphereArr) {
if (this.distance(sphereItem) < 50) {
this.destroySphere(sphereItem);
this.playerisDead = true;
if (this.playerisDead === true) {
this.overGame();
}
}
}
}
},
});
\ No newline at end of file
{
"ver": "1.0.5",
"uuid": "95fa79cc-7279-41e3-89b7-1bcb76114798",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "1e330ceb-6c00-4a6b-9e8d-9e93983d3456",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"experimentalDecorators": true
},
"exclude": [
"node_modules",
".vscode",
"library",
"local",
"settings",
"temp"
]
}
\ No newline at end of file
{
"engine": "cocos-creator-js",
"packages": "packages"
}
\ No newline at end of file
{
"start-scene": "current",
"group-list": [
"default"
],
"collision-matrix": [
[
true
]
],
"excluded-modules": [],
"last-module-event-record-time": 0,
"design-resolution-width": 960,
"design-resolution-height": 640,
"fit-width": false,
"fit-height": true,
"use-project-simulator-setting": false,
"simulator-orientation": false,
"use-customize-simulator": false,
"simulator-resolution": {
"width": 960,
"height": 640
},
"assets-sort-type": "name",
"facebook": {
"enable": false,
"appID": "",
"live": {
"enable": false
},
"audience": {
"enable": false
}
}
}
\ No newline at end of file
{
"services": [
{
"service_id": "235",
"service_name": "Cocos Analytics",
"service_icon": "https://account.cocos.com/client/3f8f31ccf66995e183044f167c092395.png",
"service_desc": "提供最核心最基本的数据、标准化界面功能简洁易用、数据准确性最好",
"service_title": "精准了解游戏的新增、活跃、留存、付费等数据",
"service_guide_url": "https://n-analytics.cocos.com/docs/",
"service_sample_url": "https://github.com/cocos-creator/tutorial-dark-slash/tree/analytics",
"service_dev_url": "http://analytics.cocos.com/realtime/jump_to/<app_id>",
"service_type": "3",
"service_type_zh": "公司和个人游戏",
"support_platform": [
"Android",
"iOS",
"HTML5"
],
"package_download_url": "https://download.cocos.com/CocosServices/plugins/service-analytics/1.2.0_2.1.0.zip",
"package_version_desc": "<b>更新日期:</b>2019/6/10<br>\n<br><b>更新说明:</b><br>\n1、优化SDK,修复H5-SDK 与多个小游戏平台适配问题,删除和优化init事件无用接口<br>\n2、如有相关问题咨询或者需求, 可以联系我们技术支持邮箱 <a href=' '>support-cocos@cocos.com</a>",
"service_component_name": "service-analytics",
"package_versions": [
"1.2.1_2.1.0",
"1.2.0_2.1.0",
"1.1.7_2.0.3",
"1.1.6_2.0.1_2.0.2",
"1.1.5_2.0.1",
"1.1.4_2.0.1",
"1.1.3_2.0.1",
"1.1.2_2.0.0",
"1.0.0_1.0.5"
],
"build_platform": [],
"require_verify": 0,
"service_price": "",
"service_protocol": "游戏首次开启该服务时,Cocos会后台通知服务方为游戏开通服务并初始化参数,服务方根据需要可能会获取您的Cocos账户信息,包括账户基本资料、游戏基本资料、账户余额等,点击确认开通按钮即视为您同意该服务访问您的账户信息,详见<a href='http://auth.cocos.com/CocosServiceAgreement.html'>《Cocos用户服务协议》</a>和<a href='http://auth.cocos.com/PrivacyPolicy.html'>《Cocos隐私政策》</a>"
},
{
"service_id": "241",
"service_name": "Matchvs",
"service_icon": "https://account.cocos.com/client/14406719a07eb3d714d36e5edc6e06fa.png",
"service_desc": "通过SDK接入快速实现联网功能、帧同步、国内外多节点、服务器独立部署、gameServer自定义游戏服务端逻辑。",
"service_title": "专业成熟的移动游戏联网与服务端解决方案",
"service_guide_url": "http://doc.matchvs.com/QuickStart/QuickStart-CocosCreator",
"service_sample_url": "http://www.matchvs.com/serviceCourse",
"service_dev_url": "http://www.matchvs.com/cocosLogin",
"service_type": "3",
"service_type_zh": "公司和个人游戏",
"support_platform": [
"Android",
"iOS",
"HTML5"
],
"package_download_url": "https://download.cocos.com/CocosServices/plugins/service-matchvs/1.0.10_3.7.9.10.zip",
"package_version_desc": "<p><strong>更新日期:</strong> 2019/9/12\n<strong>更新内容:</strong>\n1.多语言支持\n2.SDK日常更新</p>",
"service_component_name": "service-matchvs",
"package_versions": [
"1.0.9_3.7.9.9",
"1.0.7_3.7.9.6",
"1.0.6_3.7.9.2",
"1.0.5_3.7.7.3",
"1.0.3_3.7.6.4",
"1.0.10_3.7.9.10"
],
"build_platform": [],
"require_verify": 0,
"service_price": "该服务按使用量计费,<a href='https://www.matchvs.com/price'><font color='#dddddd'>计费规则</font></a>,所产生的费用将由第三方从您的 <a href='https://account.cocos.com/#/finance/finance_list'><font color='#dddddd'>Cocos 账户余额</font></a> 中扣除。",
"service_protocol": "游戏首次开启该服务时,Cocos会后台通知服务方为游戏开通服务并初始化参数,服务方根据需要可能会获取您的Cocos账户信息,包括账户基本资料、游戏基本资料、账户余额等,点击确认开通按钮即视为您同意该服务访问您的账户信息,详见<a href='http://auth.cocos.com/CocosServiceAgreement.html'>《Cocos用户服务协议》</a>和<a href='http://auth.cocos.com/PrivacyPolicy.html'>《Cocos隐私政策》</a>"
},
{
"service_id": "242",
"service_name": "Agora Voice",
"service_icon": "https://account.cocos.com/uploads/client_icon/2019-07-16/273952d155b4cdb72d2b1bc61de91ade.png",
"service_desc": "稳定、低耗、76ms超低延时、全球200+数据中心覆盖;变声器、超高音质、听声辩位等丰富玩法极速接入;全平台支持:Android、iOS、Web。",
"service_title": "游戏内置实时语音",
"service_guide_url": "https://docs.agora.io/cn/Interactive Gaming/game_c?platform=Cocos Creator",
"service_sample_url": "https://github.com/AgoraIO/Voice-Call-for-Mobile-Gaming/tree/master/Basic-Voice-Call-for-Gaming/Hello-CocosCreator-Voice-Agora",
"service_dev_url": "https://sso.agora.io/api/oauth/cocos/login",
"service_type": "3",
"service_type_zh": "公司和个人游戏",
"support_platform": [
"Android",
"iOS",
"HTML5"
],
"package_download_url": "https://download.cocos.com/CocosServices/plugins/service-agora/1.0.2_2.2.3.20_2.5.2.zip",
"package_version_desc": "<b>更新日期:<b>2019/06/27<br>\n<br><b>更新内容:</b><br>\n1、修复部分BUG<br>\n2、代码优化",
"service_component_name": "service-agora",
"package_versions": [
"1.0.2_2.2.3.20_2.5.2",
"1.0.1_2.2.3.20_2.5.2"
],
"build_platform": [],
"require_verify": 1,
"service_price": "该服务按使用量计费,<a href='https://www.agora.io/cn/price/'><font color='#dddddd'>计费规则</font></a>,所产生的费用将由第三方从您的 <a href='https://account.cocos.com/#/finance/finance_list'><font color='#dddddd'>Cocos 账户余额</font></a> 中扣除。",
"service_protocol": "游戏首次开启该服务时,Cocos会后台通知服务方为游戏开通服务并初始化参数,服务方根据需要可能会获取您的Cocos账户信息,包括账户基本资料、游戏基本资料、账户余额等,点击确认开通按钮即视为您同意该服务访问您的账户信息,详见<a href='http://auth.cocos.com/CocosServiceAgreement.html'>《Cocos用户服务协议》</a>和<a href='http://auth.cocos.com/PrivacyPolicy.html'>《Cocos隐私政策》</a>"
}
],
"game": {
"name": "未知游戏",
"appid": "UNKNOW"
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment