I'm having another issue, with the star collision. My guy is colliding with the star, but its not disappearing, I'm assuming the collision event isnt working.
Its definitely colliding with the star, as I am unable to pass it, but the event is not firing I believe. I may have put it in the wrong spot perhaps inside the CPP file?
I've tried your code/config and it's working for me. However as I don't have your assets, I've been using box.png for the bullet, the platform and the star as well.
I also had to move PhysicsEventHandler higher in the file so that I could compile it (at the moment it's defined/declared after being referenced).
Have you tried running in debug to see if you get any messages?
Ah that was it, it must have been declared below where I was calling it from. I'm using Visual Studio code and just running make from the gmake folder to compile the project, I will look at getting a better IDE for this. Thanks for the help, sorry for having such a newbie problem.
Comments
I'm having another issue, with the star collision. My guy is colliding with the star, but its not disappearing, I'm assuming the collision event isnt working.
Heres the function in the main cpp file.
Then my init section:
Hey @sacked, I've split this question from the original thread as it wasn't related to the original issue and didn't match the title anymore.
I can't see any obvious issue with what you posted. Could you post the content of your config file as well?
Yes I would guess it's the config for StarObject and HeroObject not having their masks set correctly.
Then config
Its definitely colliding with the star, as I am unable to pass it, but the event is not firing I believe. I may have put it in the wrong spot perhaps inside the CPP file?
Looks to be set right. Can you at least get a breakpoint in the PhysicsEventHandler funciton?
I've tried your code/config and it's working for me. However as I don't have your assets, I've been using
box.png
for the bullet, the platform and the star as well.I also had to move
PhysicsEventHandler
higher in the file so that I could compile it (at the moment it's defined/declared after being referenced).Have you tried running in debug to see if you get any messages?
Ah that was it, it must have been declared below where I was calling it from. I'm using Visual Studio code and just running make from the gmake folder to compile the project, I will look at getting a better IDE for this. Thanks for the help, sorry for having such a newbie problem.
Odd. Usually that would be a compile error for me. Glad it's all solved though.
Yep, weird indeed. And no worries for the questions, we're here to help.