![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SE-GAME-CODE-IMPACT
batmannolove
这个作者很懒,什么都没留下…
展开
-
错误
如果'replace' of null就是因为有东西entities或者level复制了副本,但是没有使用 index注意 button之类没有资源引入 容易出不来 地形没有指定图片 有声音文件引入和play全部删除 浏览器缓存清除了为毛也没报错换浏览器 少写个.png原创 2015-12-30 19:06:20 · 188 阅读 · 0 评论 -
this.parent() update必须有
this.parent() update必须有原创 2015-12-30 18:08:58 · 311 阅读 · 0 评论 -
unbind死亡效果
unbind死亡效果原创 2015-12-30 18:06:20 · 256 阅读 · 0 评论 -
直接draw(0,0)
所有图片直接在怕死满的320和480环境下试好位置,直接draw(0,0)原创 2015-12-30 18:03:42 · 267 阅读 · 0 评论 -
撞死
update: function() { if (Math.abs(this.vel.x) this.parent(); },原创 2015-12-30 18:01:04 · 322 阅读 · 0 评论 -
timer
可以delete this.timer;ig.game.Timer.pause(); timer可以pause原创 2015-12-30 17:36:25 · 238 阅读 · 0 评论 -
ig.Entity.inject 植入属性
ig.Entity.inject 植入属性原创 2015-12-30 17:58:26 · 293 阅读 · 0 评论 -
draw的this.parent在前面才行
draw的this.parent在前面才行原创 2015-12-30 17:55:49 · 213 阅读 · 0 评论 -
288
横向全屏尺寸 横向动态 288480 320533 横向全屏尺寸 横向静态 288477 530320 竖向全屏尺寸320 533 一般使用40单位 8和13bna 第一层160单位 2乘以3第原创 2015-12-30 17:53:11 · 225 阅读 · 0 评论 -
地图json   jquery
地图json jquery 4 错误如果json还是不对,吧entities的代码去掉就可以画地形了原创 2015-12-30 17:50:33 · 259 阅读 · 0 评论 -
this.standing
this.standing水平走的时候是true,纵向有速度是false,斜面轻微纵向速度也true var accel = this.standing ? this.accelG: this.accelA; if (this.currentAnim === this.anims.run && !this.sounds.walk.looping) { this原创 2015-12-30 17:47:55 · 178 阅读 · 0 评论 -
包裹bug问题但是浏览器能玩
wp白条 .png没写原创 2015-12-30 17:45:16 · 262 阅读 · 0 评论 -
更新游戏后还是那个storage的数据
更新游戏后还是那个storage的数据原创 2015-12-30 17:41:40 · 218 阅读 · 0 评论 -
处理other people游戏代码
找错误会出现mcyNav #当你不知道这句代码什么意思就console他 两条路: 1:撰写逻辑 学的东西要紧紧围绕你在做的东西,稍微偏一点就不要再细究 入索引和你所做的东西的注释中2:其他所有资料收集或摘抄或索引,视频可以替换为文本,然后connect dots形成自己版本方法:代码中注释 和 粗处理到文件夹知道大致讲什么收集代码旁边注释,看懂靠视频笔记直接原创 2015-12-30 18:11:36 · 508 阅读 · 0 评论 -
可以直接取出关卡名字this.currentLevelName
可以直接取出关卡名字this.currentLevelName原创 2015-12-30 18:15:15 · 899 阅读 · 0 评论 -
MULTTOUCH
原创 2015-12-30 19:03:43 · 217 阅读 · 0 评论 -
真实速度
vel: {x: -200, y: 0}, //real: 1s:181px 1s update:62次原创 2015-12-30 19:01:03 · 280 阅读 · 0 评论 -
.alpha debris
this.currentAnim.alpha = this.timer.delta().map( -4, 0, 1, 0);原创 2015-12-30 18:58:25 · 218 阅读 · 0 评论 -
preload image
preload image tile 避免卡原创 2015-12-30 18:55:47 · 579 阅读 · 0 评论 -
防止二维数组出错
原创 2015-12-30 18:53:09 · 243 阅读 · 0 评论 -
if (this.getEntitiesByType('EntityPlayer').length < 1)
if (this.getEntitiesByType('EntityPlayer').length原创 2015-12-30 18:50:31 · 231 阅读 · 0 评论 -
屏幕晃动
this.screen.y +=this.fuhao ; this.screen.x +=this.fuhao ; if(this.shaketimer.delta()>0) { this.fuhao=0-this.fuhao; this.shaketimer.reset() }原创 2015-12-30 18:47:53 · 307 阅读 · 0 评论 -
handleMovementTrace
handleMovementTrace: function(res) { this.parent(res); if (res.collision.x || res.collision.y) { this.timer = this.timer || new ig.Timer(3); } }原创 2015-12-30 18:45:16 · 184 阅读 · 0 评论 -
currentAnim.frame === 3) this.kill();
if (this.currentAnim.frame === 3) this.kill();原创 2015-12-30 18:41:34 · 227 阅读 · 0 评论 -
var player = ig.game.getEntitiesByType( EntityPlayer )[0];
var player = ig.game.getEntitiesByType( EntityPlayer )[0];原创 2015-12-30 18:38:56 · 207 阅读 · 0 评论 -
scrollScreen
// scrollScreen: function() { // if (this.player.pos.x > (ig.game.collisionMap.width * ig.game.collisionMap.tilesize - ig.system.width / 2)) { // this.screen.x = ig.game.collisionMap原创 2015-12-30 18:36:18 · 395 阅读 · 0 评论 -
friction就是走了会停下,必须一直按键才能一直走
friction就是走了会停下,必须一直按键才能一直走原创 2015-12-30 18:33:40 · 294 阅读 · 0 评论 -
ig.input.unbindAll();
ig.input.unbindAll();原创 2015-12-30 17:39:02 · 291 阅读 · 0 评论 -
FLIP和angle没关系不鸟
FLIP和angle没关系不鸟原创 2015-12-30 18:17:52 · 198 阅读 · 0 评论 -
大屏幕自适应
原创 2015-12-30 19:47:53 · 513 阅读 · 0 评论 -
.sortEntities()is called this array is sorted by the entities.zIndex.
.sortEntities() is called this array is sorted by the entities .zIndex.原创 2015-12-30 19:45:15 · 388 阅读 · 0 评论 -
逐渐变暗
原创 2015-12-30 19:41:35 · 274 阅读 · 0 评论 -
||1
原创 2015-12-30 19:38:58 · 352 阅读 · 0 评论 -
distanceto
原创 2015-12-30 19:36:21 · 815 阅读 · 0 评论 -
timer提高效率
碰到才开始timer原创 2015-12-30 19:33:43 · 418 阅读 · 0 评论 -
敌人跟随
原创 2015-12-30 19:31:06 · 282 阅读 · 0 评论 -
临时变量提高效率
原创 2015-12-30 19:28:28 · 380 阅读 · 0 评论 -
getEntitiesByType( EntityPlayer )[0];
update: function() { // Update all entities and BackgroundMaps this.parent(); // screen follows the player var player = this.getEntitiesByType( EntityPlayer )[0]; if( player ) {原创 2015-12-30 20:01:01 · 354 阅读 · 0 评论 -
call
原创 2015-12-30 20:03:39 · 281 阅读 · 0 评论 -
graviy默认y如果不声明
原创 2015-12-30 20:06:16 · 414 阅读 · 0 评论