reducing collision size

matthowarthmatthowarth Member Posts: 76
edited November -1 in Working with GS (Mac)
high all,

our game has some beautiful graphics (illustrated by the hugely talented Chris Mould- google him, he's good!!!)

To retain the non rectangular edges of these illustrations, I'm using the png format with transparency and it works nicely. However it does mean that sometimes the transparent edge makes collisions occur when visually they shouldn't. I know that GS currently only supports rectangular and circular collisions, so I wondered if I can tell my actor to collide not with its own edge, but with a smaller rectangle or circle.

I have used Teeshirtbooth's tutorial on making multiple hit points on an actor which works a treat (thanks TSB), but for some of the objects in the game, it's a bit of a sledgehammer to crack a walnut, so I wondered if there was an simpler method?

thanks

Matt

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    A few of our games use a mask actor that is smaller and it works well.

    We then constrain the bigger actor to the smaller mask actor and use the small mask actor as the collision.

    Darren.

    image
  • matthowarthmatthowarth Member Posts: 76
    Hi Darren,

    yes this is what we're doing at the moment, I wondered if we were doing it the right way, or if there was a control somewhere that we hadn't spotted for reducing (or even enlarging) collision size.

    I don't know how you are removing the larger actor when a collision occurs, but we have the "mask" actor, upon death spawning a small invisible actor with a very short life span and the larger actor dies when it comes into contact with it. Fairly instantaneous to the naked eye.

    Good to know we're using similar methods.

    cheers

    Matt
  • mattyr64mattyr64 Member Posts: 82
    just stick in an attribute that is something like isAlive = true, when the mask actor hits the enemy have it to change attribute isAlive to false. then inside your visible character actor, have it killed based on that attribute being false! ;)
  • UtopianGamesUtopianGames Member Posts: 5,692
    Coming from gamemaker they had a bounding box to change the size and shape of collision...this is one of my most requested features for GS and I'm sure we will have it one day.

    image
  • matthowarthmatthowarth Member Posts: 76
    hi Mattyr64,

    I thought about using attributes, but there are numerous actors on screen and I couldn't get my head around how to do it without having a multitude of attributes and editing every instance of the actors.

    Any thoughts?

    Hi Utopiangames,

    it would be a useful feature and if you could have a number of (scalable) primitives nested within a single actor to roughly define its collision edge would be even better!!!

    cheers
Sign In or Register to comment.