User Tag List

Results 1 to 5 of 5

Thread: Blocking Overlaps with an Object

  1. #1
    Clicker Multimedia Fusion 2

    Join Date
    Sep 2006
    Location
    Britain, South Coast
    Posts
    1,030
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Blocking Overlaps with an Object

    I'm building a sidescrolling space-shooter game where the user can build his own ship. The basic principle is to put all the mechanics in place (engines, cockpit, cargo bay, etc) then cover the ship with armour and weapons.

    I had been hoping to make damage work this way: A circle is created when an explosion occurs. Any armour in this circle receives damage, and eventually is destroyed. If a more fragile part becomes exposed (like an engine) and comes into contact with a damage zone, this part is destroyed. So you need to kit your ship out well.

    The problem is testing which bits have armour protecting them and which bits don't. You can't just do "is object DAMAGE overlapping object REALLY_VULNERABLE_ENGINE", because that returns true whether there's armour in the way or not.

    And you can't negate it by adding "+ DAMAGE is NOT overlapping ARMOUR" because if armour is anywhere in the damage zone, exposed parts will be treated as if they were protected.

    And you can't say "+ ARMOUR is overlapping REALLY_VULNERABLE_ENGINE" because this will stop damage happening even if only half the engine is protected.

    The only way I can think of is to define damage zones as squares rather than circles (a nuissance, but there we go) and run a fastloop with a 1x1 object checking the area of the square to see which parts are exposed and apply damage to the topmost for each pixel.

    But that may be slow, so I wondered if anyone knew of a simpler way? Is there some way MMF's own collision detection can be used to help, or am I stuck with fastloops?

  2. #2
    No Products Registered

    Join Date
    Jun 2006
    Posts
    302
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Blocking Overlaps with an Object

    you can do this:

    instead of destroying the armor parts when they are dead, set a flag or value on them saying: Destroyed = 1

    then, make a condition testing:

    damage is overlapping armor
    damage is overlapping vulnerable_part
    armor value Destroyed = 1
    -> do whatever

    that way you know that the damage has entered through a part that is damaged.

  3. #3
    Clicker Multimedia Fusion 2

    Join Date
    Sep 2006
    Location
    Britain, South Coast
    Posts
    1,030
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Blocking Overlaps with an Object

    Thanks, but that's not really what I'm after.

    The problem is trying to find out if an object is covered ENTIRELY by armour objects, or not. If only half of it is covered, and the exposed half is overlapping a damage zone (caused by an explosion or whatever), then the exposed component must take damage.

    It would be fine if you could somehow block collision detections using other objects, but I don't think that can be done.

  4. #4
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleInstall Creator Pro

    Join Date
    Jul 2006
    Location
    Germany
    Posts
    1,090
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Blocking Overlaps with an Object

    This one is hard to explain, I'll use this screenshot to help visualize, please look at the fairy and the blue balls surrounding her: http://www.jochenkaercher.com/gfx/feyruna/gallery/feyruna-screen2-800x600.jpg

    These balls are created in a fastloop. They are placed in 45° steps at a fixed radiance based on the fairy's centered hotspot.

    If you use small, invisible detectors instead of these balls and use more than one circle with different radiances, you can cover the whole area of a circular shaped explosion.

    Instead of testing the explosion overlap, you only test the small particles:
    particle overlaps engine
    + particle doesn't overlap armor -> add damage

    It depends on shape and size of the explosion and the armor pieces if this looks realistic or not. May also be tricky to check each particle without confusing MMF, you'll probably need spread values to refer each particle correctly.

  5. #5
    Clicker Multimedia Fusion 2

    Join Date
    Sep 2006
    Location
    Britain, South Coast
    Posts
    1,030
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Blocking Overlaps with an Object

    That's a good idea! I'll try that!

Similar Threads

  1. Only show part of object that overlaps another
    By Ryzla in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 29th December 2013, 06:03 PM
  2. If bullet overlaps a certain object, damage the shooter of the bullet
    By StardustSpeedman in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 10th September 2012, 02:43 PM
  3. Line overlaps and object?
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 14
    Last Post: 23rd June 2009, 01:41 AM
  4. Clicking only 1 object while overlaps happen?
    By pulp in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 9th July 2008, 06:15 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
  •