Collision Detection and Spinning Actors

billybarringtonbillybarrington Member Posts: 5
edited November -1 in Working with GS (Mac)
Hey,

I'm making a Face Avoidance game. Hoping I can publish soon but gonna need some help from you guys before getting there.

I'm a relative newcomer to game salad and games programming in general. After starting the game a few weeks ago I've just had other commitments so may have forgotten some basics.

Having problems with the collision detection. When the player is near, but not touching, an enemy they are dying. The enemy and player are a closer to a circle in shape. This too sensitive collision detection is ruining the experience. Anyone got any ideas?

Also, the players character has an unhealthy desire to start spinning a minute or two into play. Anyone come across this before?

I have more queries but firsts things first, can anyone help?

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    hey there

    For your first question try going into the physics attributes of the actor and changing the collision shape to a circle

    For your second question go into the attributes of the actor and check fixed rotation

    cheers
  • Thanks for the quick reply,

    The fixed rotation seems to have done the job. Thanks.

    I'd already changed the collision shape to a circle...... there's noticeable gaps in between the enemy and player but collisions are still being detected.

    Is there any way of measuring the pixels on screen in game salad? Having trouble with spawn locations also.
  • monsterpunchmonsterpunch Member Posts: 37
    billybarrington said:

    Is there any way of measuring the pixels on screen in game salad? Having trouble with spawn locations also.

    Hey Billy. A iphones app screen size is always 480 width by 320 Height.

    Now if you want to calculate an actors position, add TWO attributes to the main Scene called like, positionX and positionY. Go the object, add two Constrain Attributes. The first Constrain attribute should be like

    [[game.positionX] - [self.position.x]]
    and the second Constrain to be
    [[game.positionY] - [self.position.Y]].

    What this does is constantly take the numeric value of the objects X/Y value, and track it on the scene Attribute positionX. Now that its being recorded, any OTHER actor can take that number and use it how it wants. PM me if you have any questions.
  • Thanks for your help.

    I have done as you've said and now have two attributes tracking my players characters X and Y position.

    Now I am struggling with working out how to use this information for my Enemy Spawns. The problem is that sometimes they spawn too close to the player, leaving it impossible to avoid them. If I make the random spawn relative to the player then there is a good chance that the enemy will spawn off screen and not make it into the game. Can't have that happen

    So, I basically want to tell the enemies to spawn
    Randomly Between 100, 300 AND + or - 40 outside of Position X and Y.

    Headache.

    Thanks again.
Sign In or Register to comment.