你还在观望吗?Creator3D小鲜肉《小鸭快跑》新鲜出炉!
The following article is from KUOKUO众享 Author KUOKUO众享
摘要
正文
风骚的走位
cc.systemEvent.on(SystemEventType.TOUCH_START, (e: EventTouch) => {
let pos = e.getLocation();
// ......
});
cc.systemEvent.on(SystemEventType.TOUCH_END, (e: EventTouch) => {
let pos = e.getLocation();
if (this.startPos.x > pos.x) {
console.log('左');
// ......
} else {
console.log('右');
// ......
}
});
编辑器界面
模型阴影
脚底生风
死亡界面
代码相关
createOneEnemy () {
let n1 = Math.floor(3 * Math.random());
let x = -150 + n1 * 150;
let y = 0;
let z = 5000;
let e = instantiate(this.enemy);
this.node.addChild(e);
e.setPosition(cc.v3(x, y, z));
}
结语
(*^▽^*)