Results 1 to 2 of 2

Thread: Scrolling Shooter Collision Events confusion

  1. #1

    Smile Scrolling Shooter Collision Events confusion

    Hi,
    I am just working through the examples but there is something that I am not grasping.
    When you have a bullet & plane object and you need to add a collision event, would you
    put that event in the plane object or the bullet? In theory you could use either to destroy
    the instances, is there some general guideline for this?

    Thanks in advance for any replies!
    Kr
    PriorZ
    Game Designer Course.

  2. #2

    Default

    I got a nice explanation from one of the tutors, thought I would share:


    "As a general rule, every object will be checking for the necessary collisions.
    Generally, any time an object detects that it is colliding with something, it will call a function relevant to the object it collided with.
    Please note that collision is handled in different way between 2D and 3D games.

    For the sake of the example below, we will assume that they are using Axis Aligned Bounding Boxes (AABB)

    Example:
    A bullet collides with an NPC.
    Each object will be checking for collisions at all times.
    We can detect the collision between the bullet and the NPC using the AABB attached to each object.
    When the AABBs are overlapping, there must be a collision.
    The bullet will then note that it has collided with an object, and will subsequently destroy itself.
    Please be aware that some bullets may not want to be destroyed as soon as they hit something (think penetration or ricochet).
    The object they hit (in this case the NPC) will then call a relevant function based on the object hit. If the object was a bullet, you might want the NPC to die, or to take damage.

    So each object has its own collision detection, and each will call a function based on the object it has collided with.

    Collisions don't always result in things being destroyed, for example; a player walking into a wall. This collision would cause a different effect, but would be handled in the same way; although a wall would probably be masked to have no reaction to a player running into it.

    I hope this helps clarify things for you, however, if you have any further questions then please let us know."
    Kr
    PriorZ
    Game Designer Course.

Similar Threads

  1. Scrolling Shooter
    By ianr in forum T2G Designer, General Discussions
    Replies: 15
    Last Post: 09-16-2013, 05:21 PM
  2. Scrolling Shooter - Problem with final scrolling
    By TheDaniLlama in forum T2G Designer & Production, Technical Discussions
    Replies: 2
    Last Post: 02-28-2013, 11:14 PM
  3. scrolling shooter
    By Payne 47 in forum T2G Developer, General Discussions
    Replies: 2
    Last Post: 12-11-2012, 08:04 PM
  4. confused by Scrolling shooter,
    By Benito in forum Game Maker
    Replies: 3
    Last Post: 01-24-2010, 03:15 PM
  5. Collision events
    By Tinman in forum Newbies Area
    Replies: 11
    Last Post: 08-23-2009, 01:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •