scrolling got stuck

nir3112nir3112 Member, PRO Posts: 304

Hi,

I have some problem with my code and I don't know what..

In few years back I used some code to make my scenes scrolling up and down or right and left, some of you maybe familiar with this code..it's using the Drag & Cam actors.

I used this code on most of my apps and it works, so I copied the code and just changed the screen size in the calculation and everything is working fine.

Now im make some update to my app and the scrolling got stuck when scroll very fast up, I checked the code 100 times and its the same on my other apps with the layer setup and all... but it's not working now, after all my checks I think the linear velocity is the problem - when I scroll very fast up the velocity changed to -0 instead of 0.

I attached a project file with the code, please download it and try to scroll very fast up and you see the scroll stop working after that.

Thanks for all the help and I'm sorry for my English ^_^'


Comments

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879

    @nir3112 -- Is it because the drag actor is moving beyond the scene boundaries? (If the drag actor goes beyond 500 pixels from the scene boundary, it will be destroyed automatically.)


    Try giving the drag actor a couple of rules that keep it on the scene:

    When drag.position.x is greater than 2000, change drag.position.Y to 0

    When drag.position.x is less than 0, change drag.position.Y to 2000

  • nir3112nir3112 Member, PRO Posts: 304

    Thanks!! it fixed the problem[=

    I can't believe I missed that ^_^'

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879

    @nir3112 -- Glad it is working!

Sign In or Register to comment.