Jump to content

JcXGTcW

Members
  • Content Count

    2
  • Joined

  • Last visited

  1. After 3 hours of fighting, I just find out how to solve this. Just to var and initialize animatedSprite outside the setup function var fish_ = new AnimatedSprite.from("path/to/some/img"); function fishSetup(){ some_setup_functions(); } Thanks for your attention!
  2. I want to make my fish(fish_) can transform to another form (fishFly_) while jumping, and I wrote a function called "jump" to do so. But when I was trying to change the .visible of them, console gave me: Uncaught ReferenceError: fish_ is not defined at jump (game.js:142) //the line of "fish_.visible = true;" in "else statement" of "jump function" at t.fn (game.js:127) //which is the line of app.ticker at t.emit (TickerListener.ts:107) at e.update (Ticker.ts:479) at _tick (Ticker.ts:187) seems like I used the wrong way to change it. Can someone
×
×
  • Create New...