//下面是完整代码
var DIR = cc.Enum({
UP:0,
RIGHT:1,
DOWN:2,
LEFT:3,
});
cc.Class({
extends: cc.Component,
properties: {
direction:DIR.UP,
speed:32,
/* _____>x
|
|
y
*/
tileX:0,
tileY:0,
offsetX:0,
offsetY:0,
map:{
default:null,
type:cc.TiledMap
},
ground:{
default:null,
type:cc.TiledLayer,
},
barrier:{
default:null,
type:cc.TiledLayer,
},
upBtn : { default: null, type: cc.Button},
rightBtn : { default: null, type: cc.Button},
downBtn : { d