Transparency, pixels and colliders
Hi
I've looked through some old posts and found a partial answer to my query.
Is there a way to make the collider behaviour activate only when in contact with the actual image or pixel data - ingnoring the transparent bounding box.
Earlier posts have answered the question for regular symmetrical shapes by using cropping within Photoshop or within GS, you can make your own custom collide rule (if the player's position is contained in a global variable). Just check:
if player.x > self.x-10
if player.x < self.x+10
if player.y > self.y-10
if player.y < self.y+10
And you have essentially just created a 20x20 bounding box.
These solutions work for regular shapes but I don't think they work for irregular shapes.
Thanks
I've looked through some old posts and found a partial answer to my query.
Is there a way to make the collider behaviour activate only when in contact with the actual image or pixel data - ingnoring the transparent bounding box.
Earlier posts have answered the question for regular symmetrical shapes by using cropping within Photoshop or within GS, you can make your own custom collide rule (if the player's position is contained in a global variable). Just check:
if player.x > self.x-10
if player.x < self.x+10
if player.y > self.y-10
if player.y < self.y+10
And you have essentially just created a 20x20 bounding box.
These solutions work for regular shapes but I don't think they work for irregular shapes.
Thanks
Comments
Ace
Now on the collision actor, add a rule that says when attribute self.Border is greater than magnitude(game.players x-self.position.x,game.players y-self.position.y) then Collide.
This is off the top of my head as I'm on my phone, but that's the gist.
Ace
Thanks again
Cheers