pixijs.com icon indicating copy to clipboard operation
pixijs.com copied to clipboard

Issues with fish-pond tutorial

Open jacrys opened this issue 7 months ago • 0 comments

On step 2, "Adding a Background", the instructions are missing the vital step of adding

// Add the background to the stage.
app.stage.addChild(background);

This causes the background not to be added to the canvas.

On step 4, "Adding Water Overlay", the last set of instructions say to add this code:

elapsed += time.deltaTime;
overlay.tilePosition.x = elapsed * -1;
overlay.tilePosition.y = elapsed * -1;

which does not work. First, elapsed is not defined anywhere, and the addition assignment operator throws an error.

The code from the "solution" button is as follows:

// Extract the delta time from the Ticker object.
const delta = time.deltaTime;

// Animate the overlay.
overlay.tilePosition.x -= delta;
overlay.tilePosition.y -= delta;

jacrys avatar Jul 09 '24 15:07 jacrys