Collision Boxes

I am having trouble finding an easy method to assign a larger collision box to an actor..

The problem is that the actor is rectangular and relatively long..

Do I have to change the actor in photoshop and just make the blank area around the actual actor bigger or is there another easy solution without having to change much in the game itself?

Comments

  • caiokawasakicaiokawasaki Member Posts: 68
    I am having trouble finding an easy method to assign a larger collision box to an actor..

    The problem is that the actor is rectangular and relatively long..

    Do I have to change the actor in photoshop and just make the blank area around the actual actor bigger or is there another easy solution without having to change much in the game itself?
    I don't understand what you mean man =/
  • LinoLino Member Posts: 10
    Well I have meteorites falling down into a forest in my app and if you tap on them they disappear but it's very hard to actually get them destroyed because the collision area is so small.. you have to tap very precisely.. i want them to disappear even if you don't click exactly on the center..
  • LinoLino Member Posts: 10
    You obviously either didn't watch the video or didn't read my question. I asked for a solution that works with RECTANGULAR actors.

    I already found this video but i this doesn't work with rectangles.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2013
    Yes, you need to create blank space around the meteorite image and re-import it.

    Either that or have each meteorite spawn an extra (larger) invisible actor that reacts to touch and have it move at the same speed and direction as the meteorite.

    And I suppose you could also have rules related to mouse position. Something like this:

    When Mouse Button is down
    .....When [all] game.mouse.position.X > self.position.X-50 AND game.mouse.position.X < self.position.X+50 AND game.mouse.position.Y > self.position.Y-50 AND game.mouse.position.Y < self.position.Y+50
    ..........Destroy actor

    That should allow for 50 pixels of space around the actor's center.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • LinoLino Member Posts: 10
    Thanks

    I guess i'll change the Image quickly as this seems to be the easiest solution...
Sign In or Register to comment.