1、清理仓库

This commit is contained in:
贝密游戏
2017-12-21 23:04:13 +08:00
parent eeb1c9e07b
commit b52d442381
1317 changed files with 138642 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
var beiMiCommon = require("BeiMiCommon");
cc.Class({
extends: beiMiCommon,
properties: {
// foo: {
// default: null, // The default value will be used only when the component attaching
// to a node for the first time
// url: cc.Texture2D, // optional, default is typeof default
// serializable: true, // optional, default is true
// visible: true, // optional, default is true
// displayName: 'Foo', // optional
// readonly: false, // optional, default is false
// },
// ...
},
// use this for initialization
onLoad: function () {
},
onBackClick:function(){
this.scene(cc.beimi.gametype , this);
}
// called every frame, uncomment this function to activate update callback
// update: function (dt) {
// },
});

View File

@@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "ce2c10a4-5961-41b0-ae26-770defe7f9f6",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@@ -0,0 +1,96 @@
cc.Class({
extends: cc.Component,
properties: {
// foo: {
// default: null, // The default value will be used only when the component attaching
// to a node for the first time
// url: cc.Texture2D, // optional, default is typeof default
// serializable: true, // optional, default is true
// visible: true, // optional, default is true
// displayName: 'Foo', // optional
// readonly: false, // optional, default is false
// },
// ...
username:{
default:null ,
type:cc.Label
},
goldcoins:{
default:null ,
type:cc.Label
},
selected:{
default:null ,
type : cc.Node
},
creator:{
default:null ,
type : cc.Node
},
selectcards:{
default:null ,
type : cc.Node
},
selectcolor:{
default:null ,
type : cc.Node
}
},
// use this for initialization
onLoad: function () {
this.selected.active = false ;
this.creator.active = false ;
},
init:function(playerdata , inx , tablepos){
this.data = playerdata ; //存放玩家数据
this.tablepos = tablepos ;
if(inx == 0){
this.selectcards.parent.x = this.selectcards.parent.x * -1 ;
}else if(inx == 1){
this.selectcards.parent.x = this.selectcards.parent.x * -1 ;
}
this.username.string = playerdata.username ;
this.goldcoins.string = playerdata.goldcoins ;
},
banker:function(){
this.creator.active = true ;
},
selecting:function(){
if(this.data.id != cc.beimi.user.id){
this.selectcards.active = true ;
let ani = this.selectcolor.getComponent(cc.Animation);
this.animState = ani.play("majiang_select") ;
// 设置循环模式为 Loop
this.animState.wrapMode = cc.WrapMode.Loop;
this.animState.repeatCount = 20; //最大不超过 20次
}
},
selectresult:function(data){
for(var i = 0 ; i < this.selected.children.length ; i++){
this.selected.children[i].active = false ;
if(this.selected.children[i].name == data.color){
this.selected.children[i].active = true;
}
}
this.selected.active = true ;
if(this.data.id != cc.beimi.user.id) {
if (this.animState != null) {
this.animState.stop("majiang_select");
}
}
},
clean:function(){
this.creator.active = false ;
for(var i = 0 ; i < this.selected.children.length ; i++){
this.selected.children[i].active = false ;
}
}
// called every frame, uncomment this function to activate update callback
// update: function (dt) {
// },
});

View File

@@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "e9538de1-8e41-48d0-b853-8b1a9e319439",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@@ -0,0 +1,92 @@
cc.Class({
extends: cc.Component,
properties: {
// foo: {
// default: null, // The default value will be used only when the component attaching
// to a node for the first time
// url: cc.Texture2D, // optional, default is typeof default
// serializable: true, // optional, default is true
// visible: true, // optional, default is true
// displayName: 'Foo', // optional
// readonly: false, // optional, default is false
// },
// ...
workitem:{
default: null,
type: cc.Node
},
myscore:{ //底牌
default: null,
type: cc.Label
},
myflag:{
default: null,
type: cc.Node
},
player_1:{
default: null,
type: cc.Node
},
player_1_flag:{
default: null,
type: cc.Node
},
player_1_name:{
default: null,
type: cc.Label
},
player_1_score:{
default: null,
type: cc.Label
},
player_2:{
default: null,
type: cc.Node
},
player_2_flag:{
default: null,
type: cc.Node
},
player_2_name:{
default: null,
type: cc.Label
},
player_2_score:{
default: null,
type: cc.Label
},
},
// use this for initialization
onLoad: function () {
let self = this ;
/**
* SummaryClick发射的事件方便统一处理 / 开始
*/
this.workitem.on("begin",function(event){
if(self.context !=null){
self.context.summarypage.destroy();
self.context.restart();
}
event.stopPropagation();
});
/**
* SummaryClick发射的事件方便统一处理 / 开始
*/
this.workitem.on("close",function(event){
if(self.context !=null){
self.context.summarypage.destroy();
}
event.stopPropagation();
});
},
create:function(context , data){
this.context = context ;
var index = 0 ;
for(var inx = 0 ; inx < data.players.length ; inx++){
var player = data.players[inx] ;
}
}
});

View File

@@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "1d5bec6d-3bec-40aa-908c-394a3126041b",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "d95a894a-b49a-493f-8d8f-0e9fa8608253",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@@ -0,0 +1,35 @@
var beiMiCommon = require("BeiMiCommon");
cc.Class({
extends: beiMiCommon,
properties: {
// foo: {
// default: null, // The default value will be used only when the component attaching
// to a node for the first time
// url: cc.Texture2D, // optional, default is typeof default
// serializable: true, // optional, default is true
// visible: true, // optional, default is true
// displayName: 'Foo', // optional
// readonly: false, // optional, default is false
// },
// ...
target:{
default:null ,
type : cc.Node
}
},
// use this for initialization
onLoad: function () {
},
onClick:function(event){
let majiang = this.target.getComponent("MajiangDataBind");
majiang.startgame();
}
// called every frame, uncomment this function to activate update callback
// update: function (dt) {
// },
});

View File

@@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "752c7ebd-e862-44d5-b9cb-001d99008106",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@@ -0,0 +1,5 @@
{
"ver": "1.0.1",
"uuid": "130c6394-44b5-468d-b252-c3705e9c7d3f",
"subMetas": {}
}

View File

@@ -0,0 +1,58 @@
cc.Class({
extends: cc.Component,
properties: {
// foo: {
// default: null, // The default value will be used only when the component attaching
// to a node for the first time
// url: cc.Texture2D, // optional, default is typeof default
// serializable: true, // optional, default is true
// visible: true, // optional, default is true
// displayName: 'Foo', // optional
// readonly: false, // optional, default is false
// },
// ...
atlas: {
default: null,
type: cc.SpriteAtlas
},
beimi0: {
default: null,
type: cc.SpriteAtlas
},
cardvalue:{
default: null,
type: cc.Node
},
target:{
default: null,
type: cc.Node
},
},
init:function(cvalue){
this.value = cvalue ;
let cardframe ;
let cardcolors = parseInt(this.value/4 ) ;
let cardtype = parseInt(cardcolors / 9);
let deskcard ;
if(cardcolors < 0){
deskcard = "wind"+(cardcolors + 8) ; //东南西北风 中发白
}else{
if(cardtype == 0){ //万
deskcard = "wan"+ (parseInt((this.value%36)/4)+1) ;
}else if(cardtype == 1){ //筒
deskcard = "tong"+ (parseInt((this.value%36)/4)+1) ;
}else if(cardtype == 2){ //条
deskcard = "suo"+ (parseInt((this.value%36)/4)+1) ;
}
}
cardframe = this.atlas.getSpriteFrame('牌面-'+deskcard);
this.cardvalue.getComponent(cc.Sprite).spriteFrame = cardframe;
},
// called every frame, uncomment this function to activate update callback
// update: function (dt) {
// },
});

View File

@@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "b8da79b5-a3a9-4e9e-965b-01135cbaab7f",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@@ -0,0 +1,111 @@
cc.Class({
extends: cc.Component,
properties: {
// foo: {
// default: null, // The default value will be used only when the component attaching
// to a node for the first time
// url: cc.Texture2D, // optional, default is typeof default
// serializable: true, // optional, default is true
// visible: true, // optional, default is true
// displayName: 'Foo', // optional
// readonly: false, // optional, default is false
// },
// ...
atlas: {
default: null,
type: cc.SpriteAtlas
},
beimi0: {
default: null,
type: cc.SpriteAtlas
},
cardvalue:{
default: null,
type: cc.Node
},
target:{
default: null,
type: cc.Node
},
},
// use this for initialization
onLoad: function () {
this.lastonecard = false ;
this.take = false ;
this.node.on('mousedown', function ( event ) {
console.log('Hello!');
});
this.node.on('mousemove', function ( event ) {
console.log('Hello Mover!');
});
},
init:function(cvalue){
this.value = cvalue ;
let cardframe ;
let cardcolors = parseInt(this.value/4 ) ;
let cardtype = parseInt(cardcolors / 9);
this.mjtype = cardtype ;
this.mjvalue = parseInt((this.value%36)/4 ) ;
let deskcard ;
this.lastonecard = false;
if(cardcolors < 0){
deskcard = "wind"+(cardcolors + 8) ; //东南西北风 中发白
}else{
if(cardtype == 0){ //万
deskcard = "wan"+ (parseInt((this.value%36)/4)+1) ;
}else if(cardtype == 1){ //筒
deskcard = "tong"+ (parseInt((this.value%36)/4)+1) ;
}else if(cardtype == 2){ //条
deskcard = "suo"+ (parseInt((this.value%36)/4)+1) ;
}
}
if(deskcard == "suo2"){
cardframe = this.beimi0.getSpriteFrame('牌面-'+deskcard);
}else{
cardframe = this.atlas.getSpriteFrame('牌面-'+deskcard);
}
this.cardvalue.getComponent(cc.Sprite).spriteFrame = cardframe;
var anim = this.getComponent(cc.Animation);
anim.play("majiang_current");
},
lastone:function(){
if(this.lastonecard == false){
this.lastonecard = true;
this.target.width = this.target.width + 30 ;
}
},
selected:function(){
this.target.opacity = 168 ;
this.selectcolor = true ;
},
relastone:function(){
if(this.lastonecard == true){
this.lastonecard = false;
this.target.width = this.target.width - 30 ;
}
},
reinit:function(){
this.relastone();
this.lastonecard = false;
this.selectcolor = false ;
this.target.opacity = 255 ;
if(this.take){
this.target.y = this.target.y - 30 ;
this.take = false ;
}
}
// called every frame, uncomment this function to activate update callback
// update: function (dt) {
// },
});

View File

@@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "ea828edc-e749-4c29-bfc0-7dbff2518151",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@@ -0,0 +1,51 @@
cc.Class({
extends: cc.Component,
properties: {
// foo: {
// default: null, // The default value will be used only when the component attaching
// to a node for the first time
// url: cc.Texture2D, // optional, default is typeof default
// serializable: true, // optional, default is true
// visible: true, // optional, default is true
// displayName: 'Foo', // optional
// readonly: false, // optional, default is false
// },
// ...
},
// use this for initialization
onLoad: function () {
},
/**
* 记录牌的 特殊属性, 是否刚抓起来的牌,已经玩家位置 右、上、左
* @param spec
* @param inx
*/
init:function(spec , inx){
this.spec = spec ;
this.inx = inx ;
if(this.spec == true){
if(this.inx == 0 || this.inx == 2){
this.node.height = this.node.height + 50;
}else{
this.node.width = this.node.width + 30 ;
}
}
},
reinit:function(){
if(this.spec == true){
if(this.inx == 0 || this.inx == 2){
this.node.height = this.node.height - 50;
}else{
this.node.width = this.node.width - 30 ;
}
}
this.spec = false ;
}
// called every frame, uncomment this function to activate update callback
// update: function (dt) {
// },
});

View File

@@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "92a2d51d-2450-4329-bf09-4d684cc8666e",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@@ -0,0 +1,49 @@
cc.Class({
extends: cc.Component,
properties: {
// foo: {
// default: null, // The default value will be used only when the component attaching
// to a node for the first time
// url: cc.Texture2D, // optional, default is typeof default
// serializable: true, // optional, default is true
// visible: true, // optional, default is true
// displayName: 'Foo', // optional
// readonly: false, // optional, default is false
// },
// ...
target:{
default:null ,
type : cc.Node
}
},
// use this for initialization
onLoad: function () {
this.clickstate = false ;
},
onClick:function(){
let handCards = this.target.getComponent("HandCards")
let self = this ;
if(this.clickstate == true){
//出牌
this.node.dispatchEvent( new cc.Event.EventCustom('takecard', true) );
}else{
if(handCards.take == true){
handCards.take = false ;
this.target.y = this.target.y - 30 ;
}else{
handCards.take = true;
this.target.y = this.target.y + 30 ;
}
this.clickstate = true ;
setTimeout(function(){ //双击算法
self.clickstate = false ;
} , 500) ;
}
}
// called every frame, uncomment this function to activate update callback
// update: function (dt) {
// },
});

View File

@@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "09db6a98-d71f-48ac-876f-57754501873c",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@@ -0,0 +1,5 @@
{
"ver": "1.0.1",
"uuid": "5b755497-d1a4-4bcf-b747-240914de35ed",
"subMetas": {}
}

View File

@@ -0,0 +1,30 @@
var beiMiCommon = require("BeiMiCommon");
cc.Class({
extends: beiMiCommon,
properties: {
// foo: {
// default: null, // The default value will be used only when the component attaching
// to a node for the first time
// url: cc.Texture2D, // optional, default is typeof default
// serializable: true, // optional, default is true
// visible: true, // optional, default is true
// displayName: 'Foo', // optional
// readonly: false, // optional, default is false
// },
// ...
},
// use this for initialization
onLoad: function () {
},
onClick:function(event , data){
this.node.dispatchEvent( new cc.Event.EventCustom(data, true) );
}
// called every frame, uncomment this function to activate update callback
// update: function (dt) {
// },
});

View File

@@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "6cec8d44-eb1a-4985-af64-2c6b218dd93c",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@@ -0,0 +1,25 @@
cc.Class({
extends: cc.Component,
properties: {
// foo: {
// default: null, // The default value will be used only when the component attaching
// to a node for the first time
// url: cc.Texture2D, // optional, default is typeof default
// serializable: true, // optional, default is true
// visible: true, // optional, default is true
// displayName: 'Foo', // optional
// readonly: false, // optional, default is false
// },
// ...
},
// use this for initialization
onLoad: function () {
},
onAnimCompleted: function () {
this.node.destroy();
}
});

View File

@@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "ed85c3ba-c050-4ed6-86b8-56b0df8b783b",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@@ -0,0 +1,26 @@
cc.Class({
extends: cc.Component,
properties: {
// foo: {
// default: null, // The default value will be used only when the component attaching
// to a node for the first time
// url: cc.Texture2D, // optional, default is typeof default
// serializable: true, // optional, default is true
// visible: true, // optional, default is true
// displayName: 'Foo', // optional
// readonly: false, // optional, default is false
// },
// ...
},
// use this for initialization
onLoad: function () {
},
// called every frame, uncomment this function to activate update callback
// update: function (dt) {
// },
});

View File

@@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "43eb63d3-e657-4268-a25a-7899fbcd5c78",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@@ -0,0 +1,26 @@
cc.Class({
extends: cc.Component,
properties: {
// foo: {
// default: null, // The default value will be used only when the component attaching
// to a node for the first time
// url: cc.Texture2D, // optional, default is typeof default
// serializable: true, // optional, default is true
// visible: true, // optional, default is true
// displayName: 'Foo', // optional
// readonly: false, // optional, default is false
// },
// ...
},
// use this for initialization
onLoad: function () {
},
// called every frame, uncomment this function to activate update callback
// update: function (dt) {
// },
});

View File

@@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "f88a1787-87db-42b2-a7cf-6398157fefc0",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@@ -0,0 +1,5 @@
{
"ver": "1.0.1",
"uuid": "0e135109-2877-44c9-a867-efc40957cb86",
"subMetas": {}
}

View File

@@ -0,0 +1,103 @@
cc.Class({
extends: cc.Component,
properties: {
// foo: {
// default: null, // The default value will be used only when the component attaching
// to a node for the first time
// url: cc.Texture2D, // optional, default is typeof default
// serializable: true, // optional, default is true
// visible: true, // optional, default is true
// displayName: 'Foo', // optional
// readonly: false, // optional, default is false
// },
// ...
atlas: {
default: null,
type: cc.SpriteAtlas
},
beimi0: {
default: null,
type: cc.SpriteAtlas
},
card_one:{
default: null,
type: cc.Node
},
card_two:{
default: null,
type: cc.Node
},
card_three:{
default: null,
type: cc.Node
},
card_four:{
default: null,
type: cc.Node
},
card_last:{
default: null,
type: cc.Node
},
target:{
default: null,
type: cc.Node
},
},
// use this for initialization
onLoad: function () {
},
init:function(cvalue , gang){
this.value = cvalue ;
let cardcolors = parseInt(this.value/4 ) ;
let cardtype = parseInt(cardcolors / 9);
this.mjtype = cardtype ;
this.mjvalue = parseInt((this.value%36)/4 ) ;
let deskcard , cardframe ;
if(cardcolors < 0){
deskcard = "wind"+(cardcolors + 8) ; //东南西北风 中发白
}else{
if(cardtype == 0){ //万
deskcard = "wan"+ (parseInt((this.value%36)/4)+1) ;
}else if(cardtype == 1){ //筒
deskcard = "tong"+ (parseInt((this.value%36)/4)+1) ;
}else if(cardtype == 2){ //条
deskcard = "suo"+ (parseInt((this.value%36)/4)+1) ;
}
}
if(deskcard == "suo2"){
cardframe = this.beimi0.getSpriteFrame('牌面-'+deskcard);
}else{
cardframe = this.atlas.getSpriteFrame('牌面-'+deskcard);
}
this.card_one.getComponent(cc.Sprite).spriteFrame = cardframe;
if(this.card_two){
this.card_two.getComponent(cc.Sprite).spriteFrame = cardframe;
}
if(this.card_three){
this.card_three.getComponent(cc.Sprite).spriteFrame = cardframe;
}
if(this.card_four){
this.card_four.getComponent(cc.Sprite).spriteFrame = cardframe;
}
if(this.card_last){
if(gang == false){
this.card_last.active = false ;
}else{
this.card_last.active = true ;
}
}
}
// called every frame, uncomment this function to activate update callback
// update: function (dt) {
// },
});

View File

@@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "0fe6725e-70ca-4bcf-9186-0ab46da72d03",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@@ -0,0 +1,5 @@
{
"ver": "1.0.1",
"uuid": "107048a1-3452-468b-9766-4f89f70650e0",
"subMetas": {}
}

View File

@@ -0,0 +1,51 @@
cc.Class({
extends: cc.Component,
properties: {
// foo: {
// default: null, // The default value will be used only when the component attaching
// to a node for the first time
// url: cc.Texture2D, // optional, default is typeof default
// serializable: true, // optional, default is true
// visible: true, // optional, default is true
// displayName: 'Foo', // optional
// readonly: false, // optional, default is false
// },
// ...
},
// use this for initialization
onLoad: function () {
},
/**
* 结算页面上的 背景的 点击事件,主要是用于事件拦截,禁用冒泡
* @param event
*/
onBGClick:function(event){
event.stopPropagation();
},
/**
* 结算页面上的关闭按钮 的 点击事件 , 关闭按钮 和 继续按钮 功能是一样的,都是继续游戏
*/
onCloseClick:function(){
/**
* 发射事件到 上一级 处理
*/
this.node.dispatchEvent( new cc.Event.EventCustom("close", true) );
},
/**
* 结算页面上的关闭按钮 的 点击事件 , 关闭按钮 和 继续按钮 功能是一样的,都是继续游戏
*/
onBeginClick:function(){
/**
* 发射事件到 上一级 处理
*/
this.node.dispatchEvent( new cc.Event.EventCustom("begin", true) );
}
// called every frame, uncomment this function to activate update callback
// update: function (dt) {
// },
});

View File

@@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "72e3d27d-f87c-4edf-abfc-e7e046ffae1a",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}