//小车
this.Car = new cc.Sprite(res.Car_png);
this.Car.x = size.width/2;
this.Car.y = size.height/2 - 176;
this.Car.scale = 0.3;
this.addChild(this.Car, 1);
//触摸事件,只在手机和平板终端上运行时触发
cc.eventManager.addListener({
event:cc.EventListener.TOUCH_ONE_BY_ONE,
onTouchBegan:function(touch,event)
{
var pos = touch.getLocation();
this.Car.x = pos.x;
},
onTouchMoved:function(touch,event){},
onTouchEnded:function(touch,event){},
onTouchCancelled:function(touch,event){}
},this);