Skip to content

Commit

Permalink
obj move
Browse files Browse the repository at this point in the history
  • Loading branch information
seogang-game committed Oct 8, 2018
1 parent 63927b8 commit d7da347
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
const app = new PIXI.Application({width:640, height:480});
document.body.appendChild(app.view);

document.body.appendChild(app.view);
let g = new PIXI.Graphics;
g.beginFill(0xFF0000, 1);
g.drawCircle(0, 0, 30);
g.endFill();

app.stage.addChild(g);

let g_t = 0;
app.ticker.add(delta=>{
g_t += delta;
g.x = Math.sin(g_t * 0.05)*100 + app.renderer.width/2;
g.y = app.renderer.height/2;
})

0 comments on commit d7da347

Please sign in to comment.