
var app = new PIXI.Application(800,500);
document.body.appendChild(app.view);var bg = new PIXI.Sprite.fromImage("res/lianxi/collision/bg.png");
app.stage.addChild(bg);var magnet = new PIXI.Sprite.fromImage("res/plane/item/img_plane_item_04.png");
magnet.anchor.set(0.5,0.5);
magnet.width = 150;
magnet.height = 150;
magnet.x = 80;
magnet.y = 420;
magnet.rotation = -Math.PI/2;
app.stage.addChild(magnet);var ball = new PIXI.Sprite.fromImage("res/lianxi/zhuan/qiu-2_77.png");
ball.anchor.set(0.5,0.5);
ball.x = 750;
ball.y = 450;
ball.width = 50;
ball.height = 50;
app.stage.addChild(ball);var speed = 1;bg.interactive=true;
bg.on("click".move);
function nmove(){
speed++;
}
app.ticker.add(animate);
function animate(){
ball.x -= speed;
if(ball.x==150){
speed=0;
}
}