Commit 4aec9032 by william

Merge branch 'flirt-william' into 'master'

feat: init Game.js See merge request !1
parents 5496d095 a456cd7e
......@@ -10,5 +10,4 @@ local/*
build/
*.d.ts
temp/
*.meta
*.fnt
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "0857d5e1-e5b1-48e2-80d6-5059f694276a",
"isGroup": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "55d110b9-bab6-4d9d-9416-03e46904fa35",
"downloadMode": 0,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.0",
"uuid": "50ab4eb6-59df-41ec-9f69-d2b092ec76cc",
"asyncLoadAssets": false,
"autoReleaseAssets": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "d6ff10bc-4d58-4d63-8af4-19151a90da2c",
"isGroup": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.0",
"uuid": "74666af9-3b83-4c79-bb74-e64662a7a91c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"subMetas": {
"classroom": {
"ver": "1.0.3",
"uuid": "1b29ad23-8777-436b-a7aa-5c7869ce1389",
"rawTextureUuid": "74666af9-3b83-4c79-bb74-e64662a7a91c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 750,
"height": 1052,
"rawWidth": 750,
"rawHeight": 1052,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.0.0",
"uuid": "077d7019-5b69-47fb-b32c-cdef03159619",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"subMetas": {
"failed": {
"ver": "1.0.3",
"uuid": "e46cef27-8d95-479a-a21f-2c6d3563302a",
"rawTextureUuid": "077d7019-5b69-47fb-b32c-cdef03159619",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -1,
"trimX": 0,
"trimY": 3,
"width": 750,
"height": 462,
"rawWidth": 750,
"rawHeight": 466,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.0.0",
"uuid": "52da3d02-b26d-4a5d-889c-401201634da8",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"subMetas": {
"hand": {
"ver": "1.0.3",
"uuid": "b5b26273-de9d-42a1-94c5-7b4839b6e1cf",
"rawTextureUuid": "52da3d02-b26d-4a5d-889c-401201634da8",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 2,
"offsetY": 0,
"trimX": 4,
"trimY": 0,
"width": 302,
"height": 378,
"rawWidth": 306,
"rawHeight": 378,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.0.0",
"uuid": "d3b617e9-e315-42a7-aaa4-7f1b67e9df35",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"subMetas": {
"logo": {
"ver": "1.0.3",
"uuid": "26869b11-f810-4bbe-994e-793228a11892",
"rawTextureUuid": "d3b617e9-e315-42a7-aaa4-7f1b67e9df35",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 332,
"height": 110,
"rawWidth": 332,
"rawHeight": 110,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.0.0",
"uuid": "d6d5a5b2-191a-4c6e-8468-91b458db29ab",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"subMetas": {
"pic": {
"ver": "1.0.3",
"uuid": "14ce6955-7406-477d-b8bb-f98b662fd140",
"rawTextureUuid": "d6d5a5b2-191a-4c6e-8468-91b458db29ab",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 600,
"height": 400,
"rawWidth": 600,
"rawHeight": 400,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.0.0",
"uuid": "80c7b1e7-1df7-4fc7-94e5-c530738420ed",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"subMetas": {
"star": {
"ver": "1.0.3",
"uuid": "8f8ba54f-70f6-4ca1-86d9-dddbd85e769d",
"rawTextureUuid": "80c7b1e7-1df7-4fc7-94e5-c530738420ed",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -1.5,
"trimX": 0,
"trimY": 4,
"width": 60,
"height": 66,
"rawWidth": 60,
"rawHeight": 71,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.0.0",
"uuid": "ac77b207-d6ae-4829-acdc-352b6e8a2153",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"subMetas": {
"start_btn": {
"ver": "1.0.3",
"uuid": "39ffe8bc-c233-4562-94b9-3c2f2c82b452",
"rawTextureUuid": "ac77b207-d6ae-4829-acdc-352b6e8a2153",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -1,
"offsetY": -1,
"trimX": 8,
"trimY": 8,
"width": 180,
"height": 184,
"rawWidth": 198,
"rawHeight": 198,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.1.0",
"uuid": "977cfe9b-21c7-498e-b060-541800511a8b",
"textureUuid": "f3779477-7dbf-4751-902f-985973720152",
"fontSize": 36,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.0",
"uuid": "f3779477-7dbf-4751-902f-985973720152",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"subMetas": {
"mikado_outline_shadow": {
"ver": "1.0.3",
"uuid": "492c193b-97a4-42f3-b7a9-6a6e4cecc0e9",
"rawTextureUuid": "f3779477-7dbf-4751-902f-985973720152",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -4.5,
"offsetY": 9,
"trimX": 3,
"trimY": 3,
"width": 497,
"height": 232,
"rawWidth": 512,
"rawHeight": 256,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "e7120552-906b-445a-9762-931fc50bf736",
"subMetas": {}
}
\ No newline at end of file
// Learn cc.Class:
// - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/class.html
// - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/class.html
// Learn Attribute:
// - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
// - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
// - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/life-cycle-callbacks.html
cc.Class({
extends: cc.Component,
/** 游戏的全局变量 */
properties: {
// foo: {
// // ATTRIBUTES:
// default: null, // The default value will be used only when the component attaching
// // to a node for the first time
// type: cc.SpriteFrame, // optional, default is typeof default
// serializable: true, // optional, default is true
// },
// bar: {
// get () {
// return this._bar;
// },
// set (value) {
// this._bar = value;
// }
// },
/** 游戏节点的注册 */
// logo节点
logo: {
default: null,
type: cc.Node,
},
// LIFE-CYCLE CALLBACKS:
// subtitle节点
subtitle: {
default: null,
type: cc.Node,
},
// onLoad () {},
// btn_start节点
start_btn: {
default: null,
type: cc.Node,
},
start () {
// classroom节点
classroom: {
default: null,
type: cc.Node,
},
// hand节点
hand: {
default: null,
type: cc.Node,
},
},
// update (dt) {},
onLoad: function () {
// 初始化游戏数据
this.score = 0; // 分数
this.timer = 60; // 每一盘游戏的总时间
this.leftLife = 3; // 剩余的命条数
this.gameState = "waitting"; // 游戏的状态 waiting(待开始) action(游戏中) stop(被抓) over(分数总结)
this.swivelAnimationTime = 0.5; //转头动画时间 (单向)
this.flirtAnimationTime = 0.5; //摸的动画时间(单向)
// 奖Game组件的实例传入开始按钮
var startBtn = this.node.getChildByName("start_btn");
startBtn.getComponent('Start').game = this;
},
// 添加分数
gainScore: function() {
this.score += 1;
},
// 游戏帧循环
update: function(dt) {
},
// 游戏开始
startGame: function() {
},
// 游戏暂停
stopGame: function() {
},
// 游戏结束
gameOver: function() {
},
});
{
"ver": "1.0.5",
"uuid": "e4c9bd35-58a4-43b5-86d5-5f611dd4d7e5",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
cc.Class({
extends: cc.Component,
properties: {
isOpenGame: false
},
setTouchBtnListener: function () {
var self = this;
self.node.on(cc.Node.EventType.MOUSE_DOWN, function (event) {
self.game.classroom.active = true
})
},
onLoad: function () {
// 初始化跳跃动作
this.setTouchBtnListener()
},
});
{
"ver": "1.0.5",
"uuid": "729ab74e-3772-455e-aa4a-05c84e3987d7",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ 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 to comment