Jump to content

Using var from other function in 'update'


Recommended Posts

Hi, it's my first time here and my first game. I don't know much about javascript also.

My problem is that I set a variable 'rockUp' to create sprite in my function addRocks and I want to use x of this sprite in 'update' to add points. Function addRocks is called by a looped timer set in 'create', so it can't detect x of that sprite correctly.

What do I have to do?

code: drive.google.com/file/d/0B2GJjU5fsrlgZEV3Y2F2dTJEelk/view

(sorry for my english)

Link to comment
Share on other sites


  • Recently Browsing   0 members

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