AlsSDK初版

(function (root) {
// const config = require(‘./als_config’)// 1.h5 2.小程序 3.cocos 4.nodejs 5.头条游戏
var Als = {}
const isObject = targe => Object.prototype.toString.call(targe) === ‘[object Object]’
const isNumber = targe => Object.prototype.toString.call(targe) === ‘[object Number]’
const isString = targe => Object.prototype.toString.call(targe) === ‘[object String]’
const isUndefined = targe => Object.prototype.toString.call(targe) === ‘[object Undefined]’
const isBoolean = targe => Object.prototype.toString.call(targe) === ‘[object Boolean]’
const isArray = targe => Object.prototype.toString.call(targe) === ‘[object Array]’
const isFunction = targe => Object.prototype.toString.call(targe) === ‘[object Function]’
const API = ‘https://sjh5.88youxi.cn/v2/’
const Uniacid = 66,Uid = 1021;
Continue reading

This entry was posted in 编程 by .

小程序常用函数封装

function e(e, n) {
if (!(e instanceof n)) throw new TypeError(“Cannot call a class as a function”);
}

Object.defineProperty(exports, “__esModule”, {
value: !0
});

var n = function() {
function e(e, n) {
for (var t = 0; t < n.length; t++) { var o = n[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o); } } return function(n, t, o) { return t && e(n.prototype, t), o && e(n, o), n; }; }(), t = getApp(), o = function() { Continue reading

优化bmob小程序SDK

//代码重构
const default_info=require(‘als_config.js’);
const pageConfig =default_info.config;
const token_key = default_info.token_key;
const TextStyle =’#ffffff’;//导航字体颜色
Bmob.initialize(default_info.bmob_key, default_info.bmob_secret);
var start_arr = default_info.start_arr, is_debug = default_info.is_debug;
const route_num = 1, limit_add= 20, load_time = 900, order_desc = “updatedAt”, is_index = ‘index’;

const _URL = {
version:’1.0.6′,
limit_num:10,
_bmobFunc: function (tablename,method = ”, param = ”, attr = ”, include=”){ Continue reading

This entry was posted in 编程 by .

斗兽棋游戏思路

斗兽棋的游戏设计大致思路
1.4×4的棋盘,有16个棋子。
2.棋子有三个状态:盖着HIDE,翻起ACTIVE,和死亡DEAD。
3.所有棋子在一开始的状态都为盖着。
4.单击盖着的棋子时,将棋子状态改为翻起。
5.单击翻起的棋子,并且点击四周的棋子,如果第二次点中的棋子也是翻起状态,并且不是己方的棋子,则进入对决流程。
6.棋子属于红方或蓝方。
7.棋子有动物属性,鼠,猫,狗,狼,豹,虎,狮,象。等级依次递增,除了老鼠可以吃大象。
8.对决失败的棋子状态为死亡。
9.使用相同的随机种子初始化同步双方棋盘。可以用房间的创建时间作为随机种子。