- 博客(10)
- 资源 (2)
- 收藏
- 关注
原创 Layabox 屏幕适配
module game { export class Resolution { static __instance = undefined; //左偏移量 static diffWidth: number = 0; //右偏移量 static diffHight: number = 0; co...
2019-02-19 09:49:48
1453
原创 PUREMVC 开源框架一
1、下载代码(这个是typescript版本的)https://github.com/PureMVC/puremvc-typescript-multicore-framework第一步 下载TypeScript 编译器 tsc第二步 下载ant/jdk第三步 重命名build文件夹下的user.properties.sample 改成user.properties之后配置us...
2019-02-18 18:49:42
424
原创 Matter 创建圆环
var width = window.innerWidth, height = window.innerHeight;var Engine = Matter.Engine, World = Matter.World, Render = Matter.Render, Bodies = Matter.Bodies, Body = Matter.Body;var engine = Eng...
2019-02-15 11:28:44
214
原创 Bodies 分析rectangle矩形的各个参数分析
源码/** * Creates a new rigid body model with a rectangle hull. * The options parameter is an object that specifies any properties you wish to override the defaults. * See the propert...
2019-02-14 11:51:12
905
原创 配置Matter的环境
1、首先下载Matterhttps://github.com/liabru/matter-js/releases2、创建一个文件夹,matter,将matter.js放进去index.html内容如下<html> <head> <script src="matter.js" type="text/javascript"&g...
2019-02-14 11:34:34
395
原创 croutine 服务器
function test() switch(operator): case 发牌: 发牌给当前玩家,检查当前玩家是否暗杠, 如果有转到暗杠/回头杠, 检查是否可以听牌,如果有转到听牌,如果没有,转到通知出牌 break; case 暗杠/回头杠: ...
2019-02-14 11:25:23
289
原创 使用croutine处理 客户端的异步回调
function :test()local event_manager = {__eventList = {}} function event_manager:on(event,func)self.__eventList[event] = funcendfunction event_manager:post(event,...)local func = self.__e...
2019-02-14 11:25:13
241
原创 解决微秒级时间不连续的问题
int clock_gettime(int what, struct timespec *ti) { switch(what) { case CLOCK_MONOTONIC: case CLOCK_REALTIME: case CLOCK_THREAD_CPUTIME_ID: { LONGLONG freq = get_cpu_freq(); ...
2019-02-14 11:25:01
179
原创 利用Croutine 等待客户端的异步操作
local Coroutine = {}local co_list = {}function Coroutine:run(func,...) --创建一个携程并执行 local co = coroutine.create(func) local state = coroutine.resume(co,...) assert(state,"coroutine ...
2018-11-08 16:41:18
184
原创 skynet win版本的 sleep问题
unistd.cclock_gettime//ti->tv_nsec = (counter.QuadPart / (freq / MICROSEC)) % MICROSEC;//FYD 改成下面的形式, 因为timer中需要的是纳秒级的数字ti->tv_nsec = (counter.QuadPart / (freq / MICROSEC)) % MICROSEC * 1000...
2018-10-15 18:50:24
471
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人