Collision

From Game Editor

Jump to: navigation, search

A Collision event is triggered by the animations, or drawn form, of an actor with another actor. When creating a Collision Event, gameEditor presents you with the settings of the event.

On

On determines where the collision must take place, in order to trigger the event.

  • Any Side

Any Side signifies any collision upon the Collide Actor. This would be used for general collisions, like a bullet hitting an enemy actor.


  • Top Side

Top Side is triggered when both the Event Actor and the designated collide actor are in collision with the top of the Collide Actor's pixels. An example of when you would use Top Side collision would be when jumping on buttons or enemies. The Actor Player would destroy the enemy actor upon collision of Top Side of Enemy. The most common use for top side collisions would be the floor.


  • Bottom Side

Bottom Side is triggered when both the Event Actor and the designated collide actor are in collision with the bottom of the Collide Actor's pixels. A bottom side collision would be used for overhead switches, ceiling, or other.


  • Left Side

Left Side is triggered when both the Event Actor and the designated collide actor are in collision with the left side of the Collide Actor's pixels. Left Side collisions tend not to be used, as usually it is better just to use 'Left or Right Side collision'. In some cases, games require single sided collision, in which case this or Right Side collisions would be used. An example being one way doors, or weak points of enemies.


  • Right Side

Right Side is triggered when both the Event Actor and the designated collide actor are in collision with the right side of the Collide Actor's pixels.Right Side collisions tend not to be used, as usually it is better just to use 'Left or Right Side collision'. In some cases, games require single sided collision, in which case this or Left Side collisions would be used. An example being one way doors, or weak points of enemies.


  • Top or Bottom Side

Top or Bottom Side allows for a general activation of an event, activating the event from either the top or bottom of the Collide Actor's pixels. Some use Top or Bottom Side collisions for floor and ceiling, using a left or right for walls, but overall, top or bottom side is used puzzle games.

  • Left or Right Side

Left or Right Side allows for a general activation of an event, activating the event from either the left or right of the Collide Actor's pixels. This style of collision would be used for more specific attacking. Again, this is used often in puzzle games.


Of Actor

Of actor designates the collide actor that is required to trigger the event. The available choices are any valid actor in the ged, or Any Actor, which will trigger the event upon any collision with the designated side.


Repeat this event while actor is colliding

This setting is either yes or no. If yes is selected, then while the two actors remain in collision, pixels overlapping, then the action triggered by the collide event will continue. It is commonly thought that when using PhysicalResponse, yes must be selected, this is not the case. When no is selected, the collide event will no longer be activated while the actors remain in collision.


Script with Collision

When using a collision event, triggering script, you can use an Especial Actor, collide. This can be used for even more specific actor collisions. This is good when dealing with clones and actor variables. It is possible also to have more control of both actors while in script, as you can reference the colliding actor with "collide", or "Collide Actor" in events.


Problems with Collide

One of the biggest problems with collide events, is the amount of processing they take up. With this event trigger, it will constantly check for collisions, this may not be bad when one or two actors are checking, but if you have a collide on an enemy, and you clone that enemy hundreds of times, like in some scrolling shooters, it would be much easier and much more efficient to simply put the collide on the player actor or the bullets. Since you know which actor is more common in the collision that you set up, choose the less common one, as it will search for the call only when need be.