User Tag List

Results 1 to 4 of 4

Thread: picking an object at random from a restricted zone

  1. #1
    No Products Registered

    Join Date
    Aug 2006
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    picking an object at random from a restricted zone

    At at loss for how to code this.

    There's enemies galore all over the screen.

    Occasionally, I want MMF to pick one and have it shoot at the player, but only if they're within a certain zone (in this case, the lower half of the screen).

    How to restrict the zone?

    I can't think a way to code this:

    * Every 1"
    * Pick object at random as long as that object is within zone XX,YY

    Grateful to any who comment.

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Francois's Avatar
    Join Date
    Jul 2006
    Location
    Montpellier, France
    Posts
    6,920
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    Re: picking an object at random from a restricted zone

    You have the condition "Pick a random object in a zone". If you want only one type of objects (if you have different objects in the zone), do :

    Every 1
    Pick "Object" at random
    "Object" lays in zone (xx,xx) to (xx, xx)

    This should work...

  3. #3
    No Products Registered

    Join Date
    Aug 2006
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: picking an object at random from a restricted zone

    Thank you very much, Francois.

    But in that case, can you answer another question for me?

    How would you code pick an object at random as long as it's within XY of an active object's action point?

    I guess what I'm asking now is how do you code "pick an object that is within a radius of another", or reasonably close to another.

    Let's say the player's sprite can go all over the screen.

    And you want the mushrooms to spring to life if the player gets near. The only problem is that the mushrooms wander all over the screen as well.

    In that case, have mushroom shoot something if player gets near it? All this can happen in different areas of the playfield.

    How?

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,367
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)

    Re: picking an object at random from a restricted zone

    There is a very simple solution for this:

    Have a large round invisible object on top of the player that has a radius of your choice. Then just test this object for overlapping with another object to make them move or shoot.

Similar Threads

  1. Picking more than one object at random?
    By Shawn in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 17th September 2010, 03:37 PM
  2. need help with picking an object
    By method72 in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 11th September 2009, 01:31 AM
  3. Picking Objects in a zone
    By danjo in forum Extension Development
    Replies: 0
    Last Post: 26th January 2008, 11:04 PM
  4. Pick Random Object From a Zone.
    By 00J in forum File Archive
    Replies: 0
    Last Post: 28th December 2007, 07:27 AM
  5. Need help with loops and object picking
    By Isbeorn in forum File Archive
    Replies: 8
    Last Post: 3rd September 2006, 05:17 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
  •