User Tag List

Results 1 to 8 of 8

Thread: Recognising enclosed shapes and their centres?

  1. #1
    Clicker iOS Export ModuleSWF Export Module

    Join Date
    Feb 2008
    Location
    Australia
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Recognising enclosed shapes and their centres?

    Well, I have no idea how to get started, as I'm not all that good with any advanced features of ClickTeam products (albeit I have been using them since The Games Factory was released), and I wish to make a game capable of recognising when you have moved in a way that forms an enclosed shape, which would then create a new object in the centre of the shape made- eg. you draw a circle and a small circle/another object appears inside your shape, it doesn't need to recognise shapes, but I would really like to make it recognise an enclosed shape has been created.

    Of course, my limited knowledge of the product (My shiny new copy of MMF2D!) prevents me from leaping right in and making my idea reality, so I am asking for help, where should I start, what should I use and how should I approach the problem?

    I've had the idea of making a trail of objects create behind say, the mouse or another object representative, and allow you to "draw" with the limited trail of "ink" that forms. but I have no idea how to make it recognise an enclosed shape has formed.
    This isn't to say I havn't tried to make my idea work, I've tried, but I don't know how to create an object in the centre of a group of objects (of the same type) after making the trail "overlap" and enclose the shape.

    SO, any tips for me, any extensions I should use, specific object types? Or is this impossible?!

    -Simplified explanation: How do I make a set of events that allows a program/game to recognise moving in the outline of an enclosed shape and creating an object within (prefferedly at the centre of) the formed shape?

  2. #2
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Recognising enclosed shapes and their centres?

    It's easiest if you force the user to draw the shape in one go (destroy all the ink when they let go of the mouse), and with the following conditions:
    They move the mouse at least 64 (tune this number) away from where they first pressed it, otherwise you ignore the shape as being too small.
    The shape is closed by having the mouse go back over the first piece of "ink".
    The center of the shape is then half way between the furthest left/right up/down locations they moved the mouse while the button was held.

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleXNA Export Module
    DistantJ's Avatar
    Join Date
    Jan 2008
    Location
    Gloucester, UK
    Posts
    2,144
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Recognising enclosed shapes and their centres?

    Ah, like NiGHTS! Umm... This is a tough one, actually, but, I guess I'd go for something like Dynasoft mentioned...

  4. #4
    Clicker iOS Export ModuleSWF Export Module

    Join Date
    Feb 2008
    Location
    Australia
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Recognising enclosed shapes and their centres?

    Yes! Like NiGHTS!
    That sorta way, but maybe with the mouse, or maybe not.

    Dynasoft, thanks for the tip, but I want a "stream" to the ink, not a limited amount.

    But then again, that way could work, but I'm unsure of how to find the extremities of the ink line like you said to, how exactly would I find the "maximum" in which they moved each direction to find the centre. Everything else I'm pretty much good with, actually I might be able to figure out how to work with a "stream" using your idea, but it might get a bit wonky (centres might be a bit off).

    NEW PROBLEM: How do I measure the "extremes" of the positions of objects of the same type, like Dynasoft said I should?

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleXNA Export Module
    DistantJ's Avatar
    Join Date
    Jan 2008
    Location
    Gloucester, UK
    Posts
    2,144
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Recognising enclosed shapes and their centres?

    I think there's an extension out there to pick the object with the highest internal value... And you could do it through that while always setting the internal value to the co-ordinate, etc...

  6. #6
    Clicker iOS Export ModuleSWF Export Module

    Join Date
    Feb 2008
    Location
    Australia
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Recognising enclosed shapes and their centres?

    Yeah, that should do it. Now I need to find the Extension~ I'll check through the ones I have, though I doubt I have it.

    Thanks!

  7. #7
    No Products Registered

    Join Date
    Sep 2006
    Location
    Germany
    Posts
    861
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Recognising enclosed shapes and their centres?

    Select Object Extension.

  8. #8
    Clicker iOS Export ModuleSWF Export Module

    Join Date
    Feb 2008
    Location
    Australia
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Recognising enclosed shapes and their centres?

    Okay, I'll find that and try it out.

    Ooh, I tried it, seems like what I need... But I cannot figure out how to position the newly created object at the x/y that it needs ( between the highest and lowest values).

    I have the event as follows- "(created object) animation Appearing is playing" + "Select (ink) with highest alterable value A" (the x value) + "select (ink) with lowest alterable value A" (the second X value)

    (NOTE: the created object was created by the collision of the ink trail with another object of itself in a previous event)

    -Set X position of (created object)... and thats where I get stumped, the Select Object extension still doesn't let me differentiate between the two objects of the same type when retreiving the "A" value, as it ends up finding the average of the same object twice. (meaning the X position of the (created object) is always one O_O)

    Should I make two seperate events to find the values of the positions and place them as seperate global values? Or is there any easier way?

    EDIT: YAY! It sorta works... But how do I exclude the objects that are not part of the shape formed? Sorta looks strange that objects appear way off centre when the shape includes some lines that are out of place.

    EDIT AGAIN: Made it as good as I can get, while allowing a constant stream rather than a fixed ink amount.
    If anyone wants the working file (incase anyone else wants to do something else like this)just say so, I'll put it on here, but do take in mind the whole thing just uses the "generic diamond" picture for objects.

Similar Threads

  1. Box 2D help - Shapes
    By blub in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 19th June 2012, 03:05 PM
  2. My Shapes
    By Francois in forum Released Games & Apps in Flash
    Replies: 0
    Last Post: 21st March 2012, 04:33 PM
  3. Problems with my engine.. example enclosed
    By Redsquirrel in forum File Archive
    Replies: 6
    Last Post: 18th May 2011, 04:38 PM
  4. Problems with my engine.. example enclosed
    By Redsquirrel in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 18th May 2011, 04:36 PM
  5. FREE SHAPES PSD
    By imothep85 in forum File Archive
    Replies: 2
    Last Post: 3rd April 2008, 09:47 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
  •