ellipticaldoor

Members
  • Content Count

    4
  • Joined

  • Last visited

About ellipticaldoor

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I just figured out reading the docs, thanks for the help.
  2. I pasted all the code just in case. Im starting to learn pixi and Im kind of lost. Which is the recommended project structure? I want to make a tiling based game
  3. Uhm, like this also doesn't work import { utils, Application, Graphics, ticker } from 'pixi.js' import { PixiConfig } from './constants' if (module.hot) { module.hot.accept(() => {}) module.hot.dispose(() => window.location.reload()) } const kind = utils.isWebGLSupported() ? 'WebGL' : 'canvas' utils.sayHello(kind) const app = new Application(PixiConfig) document.body.appendChild(app.view) const state = { circle: { x: 0, y: 0} } const stage = () => { const graphics = new Graphics() graphics.lineStyle(0) graphics.beginFill(0xFFFF0B, .5) graphics.drawCircle(state.circle.x,90,60) graphics.endFill() return graphics } const gameLoop = delta => { state.circle.x += 1 + delta } const gameTicker = new ticker.Ticker().add((delta) => { gameLoop(delta) }) const setup = () => { app.stage.addChild(stage()) gameTicker.stop() gameTicker.add(delta => gameLoop(delta)) gameTicker.start() } setup()
  4. import { utils, Application, Graphics } from 'pixi.js' import { PixiConfig } from './constants' const kind = utils.isWebGLSupported() ? 'WebGL' : 'canvas' utils.sayHello(kind) const state = { circle: { x: 0, y: 0} } const stage = () => { const graphics = new Graphics() graphics.lineStyle(0) graphics.beginFill(0xFFFF0B, .5) graphics.drawCircle(state.circle.x,90,60) graphics.endFill() return graphics } const gameLoop = delta => { state.circle.x += 1 + delta } const setup = () => { const app = new Application(PixiConfig) document.body.appendChild(app.view) app.stage.addChild(stage()) app.ticker.add(delta => gameLoop(delta)) } setup() Hi, I recently started to learn PIXI and now Im playing with animations using the ticker. This code actually draws a circle and I can se gameLoop() is being called and updating state.circle.x though it looks like it not redrawing the stage. What Im missing?