Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Update globalbounds  (Read 1484 times)

0 Members and 1 Guest are viewing this topic.

President

  • Newbie
  • *
  • Posts: 2
    • View Profile
Update globalbounds
« on: December 21, 2020, 02:25:17 pm »
I am trying to make collision with intersects. This works as expected. But when I move my player with sprite.move and I try to dodge the enemy intersect it still intersects. I found out that when I do sprite.move the globalbounds don't move so the intersects detects the startposition of the player. How can I move my globalbounds too with my player sprite.move?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Update globalbounds
« Reply #1 on: December 21, 2020, 03:02:36 pm »
When you move the sprite, the global bounds are updated as well. As such, it sounds more like you're holding on to a copy of the global bounds, which then of course won't be updated.
I suggest to use a debugger to find out what went wrong.

Btw. the "SFML Development" subforum is for threads about the development of SFML itself. For questions and help requests, use the different help subforums next time ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/