Jump to content

render texture trail with time delay (in a loop) issue


Recommended Posts

I want to make a sprite cross the screen and leave a trail but do slowly (as in one of the main website examples: render texture trail) 
I'm running this in a loop, changing the xPos and yPos each  time.

game.time.events.add(Phaser.Timer.SECOND * 0.2, function () { gameAddRenderTexture.renderXY(gameMakeSprite, xPos,yPos, false); }, this);

but it doesn't work :(


I tried passing in gameAddRenderTexture & gameMakeSprite but no luck (both are global vars)


any ideas?

I'm thinking this is some general javascript by ref / by val type thing but I can't find any answers.




Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...