User Tag List

Results 1 to 5 of 5

Thread: Parenting objects to an active?

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    pdsoft's Avatar
    Join Date
    Mar 2011
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Parenting objects to an active?

    Hey,

    Ive been trying to figure out if MMF2 has any type of parent/child system for objects like actives? I need to group a set of changeable graphics together so that they will move at exactly the same time, when in use with the 8 direction movement.

    I tried just setting the x, y position to a target but there is noticeable lag. I need timing to be exact.
    Ive heard of fastloops, it speeds the process up? I need something efficient enough for flash and mobile platforms. I not sure if fastloops will work properly on every platform...

    I need something like this because Im currently working on a new game and it will feature a customizable character. Things will be changeable like armor, clothing and hair style. When the character walks, I need the hair and clothing to move exactly with it.

    Is there a method to doing this that I might not be thinking of?

    Thanks

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    happygreenfrog's Avatar
    Join Date
    May 2011
    Location
    I.L.T.D.O.I.R (I.L.T.D.O.I.R's Location: The Dimension Of Infinite Recursion)
    Posts
    4,304
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    I'm pretty sure you could make a custom 8-directions movement to do it without the lag. Try searching "custom 8 directions movement" or something like that in the file archive to see what I mean, as I'm almost certain some people have done it before...

  3. #3
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Yima's Avatar
    Join Date
    Feb 2008
    Location
    Sweden
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Normally you use a simple (invisible) box for any game mechanics, and place graphics on it once all movement is done.

    To achieve what you want to do, I suggest doing something like this:

    Use two variables (put in the player box), named "Xspeed" and "Yspeed".

    When "Right button is pressed": Set "Xspeed" to 1 (or whatever max speed you want for your character).
    When "Left button is pressed": Set "Xspeed" to -1 (same as above).
    When "Up button is pressed": Set "Yspeed to -1.
    When "Down button is pressed": Set "Yspeed to 1".

    Below these player input checks, you add two events:

    If "Xspeed"<>0: Start loop "Move player X" abs(Xspeed) times (in the loop, you want to move the player one pixel at a time. The number of times the loop is run is determined by the speed of the player).

    If "Yspeed"<>0: Start loop "Move player Y" abs(Yspeed) times

    After these two events you can handle the loops.

    On loop "Move player X": Set X position of Player box to (X position of Player box + (abs(Xspeed)/Xspeed))

    On loop "Move player Y": Set Y position of Player box to (Y position of Player box + (abs(Yspeed)/Yspeed))

    After these movements are done, you are free to put any graphics you like on top of the player object, making sure you alter the direction of the graphics depending on what way the player is facing.

    One important reason that using loops is a good idea, is that you can do pixel by pixel collision detection. All you need to do is add, for example:

    On loop "Move player X"+Player box is overlapping a backdrop: Set X position of Player box to (X position of Player box -(abs(Xspeed)/Xspeed))

    In the line above, when the player overlaps a backdrop, we push the player back one pixel relative to the direction he was heading, moving him out of the obstacle. A better solution for this might be using detectors to check for collisions, but this is a more advanced topic normally related to platform game engines. In your case, I believe the above solution might work.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    pdsoft's Avatar
    Join Date
    Mar 2011
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In the past Ive tried making my own custom movement but got hung-up on collisions. Ive got an old project laying around somewhere, it was missing a line like this:
    "Set X position of Player box to (X position of Player box -(abs(Xspeed)/Xspeed))"
    and it was also missing "On Loop" conditions, the player object would always get stuck on backdrops.
    Probably the only thing that will use fastloops is my player object, so performance issues may not arise? Im going to test for each platform.
    Thanks for the explanation! Im going to try this out.

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fanotherpg's Avatar
    Join Date
    Jul 2006
    Location
    High Wycombe, Buckinghamshire, UK
    Posts
    3,665
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can force animation and frame in animation on base of value, I made working Diablo like equipment with changable items on characters (weapon, armor, helmet etc).

Similar Threads

  1. no more than 29 active objects
    By TEdoc in forum File Archive
    Replies: 7
    Last Post: 6th September 2009, 10:09 AM
  2. 2 ?s: Simulated 3d and Parenting Objects
    By astrospoon in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 25th April 2009, 08:50 AM
  3. Collisions Between Active Objects & Image Objects?
    By mkj5025 in forum The Games Factory 2 - Technical Support
    Replies: 3
    Last Post: 18th February 2009, 08:58 PM
  4. Active Objects or Active Pictures?
    By Mantoid in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 17th July 2008, 01:19 AM
  5. Selecting other objects behind active objects?
    By LeeJiHoon in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 16th April 2008, 02:43 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
  •