User Tag List

Results 1 to 8 of 8

Thread: Linking Multiple Objects

  1. #1
    No Products Registered

    Join Date
    Oct 2009
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Linking Multiple Objects

    Hi there, I have been working on a game for several weeks, it is an overhead scrolling game kind of like Zelda.

    Up until now I have had no trouble really, I worked out the characters custom movement and such. I have run into a problem with enemies though. My goal is to make it so I can throw multiple enemies down and they will act appropriately.

    The problem I have run into is the animation for my enemies, what I have done is I use just a basic square as the ACTUAL enemy so I can say if this overlaps player, hurt him. This all works fine and dandy but I want each enemy to have a second object, the animation that repeatedly sets it's X and Y values to the ACTUAL enemy and make the actual enemy invisible so it looks like the animation is running around.

    But how do I make it so each enemy keeps track of each of their animations whether it says "Hey I'm walking play the walking animation" or "I'm dying" etc. It all works fine for the player animation but that's because there is only one of them. All of the enemy animations are communicating with ones they are not suppose too.

    I tried my own custom way to fix this, by saying on frame start that each enemy takes their X value and puts it in a variable then each enemy creates their animation on top of them and then you say like if X value of animation = X of actual enemy then these are linked and to do it's actions. But it had some trouble as it didn't work 100% of the time it had some strange glitches when I walked off screen.

    There may not be an easy way out but any help is much appreciated, I'm sure I'll figure it out.

  2. #2
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Linking Multiple Objects

    Make the detector square part of the enemy objects' animations. That way during the event loop you can change animation to collision box, test for collisions, then change it back to whatever it was before so the player sees the animations.
    Working as fast as I can on Fusion 3

  3. #3
    No Products Registered

    Join Date
    Oct 2009
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Linking Multiple Objects

    Wow nice, well this would work but it would require me to manually keep track of animation frames, unless there's something built in where it can say return to the frame it was at.

  4. #4
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Linking Multiple Objects

    Yeah there is something built in. Alterable values. But, sadly this isn't what you wanted.
    Working as fast as I can on Fusion 3

  5. #5
    No Products Registered

    Join Date
    Oct 2009
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Linking Multiple Objects

    No sweat, shouldn't be too hard, thanks for the help this saved me hours of coding.

  6. #6
    No Products Registered

    Join Date
    Oct 2009
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Linking Multiple Objects

    Just thought I'd thank you again =D I just implemented this in an hour would it could have take me days. Woohoo! Works perfect.

  7. #7
    No Products Registered

    Join Date
    Oct 2009
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Linking Multiple Objects

    Actually I just ran into a strange problem, for some reason it works fine for the the enemy to move and check against walls, but it screws up when I'm testing hit detection between the enemy and my character, Though it shouldn't I have everything set up correctly.

    Here's how I have my Event List set up

    GAME LOOP-->
    PRE-LOOP--> Sets animation to the square
    ENEMYS--> Calculates movement
    PLAYER--> Calculates movement and hit detection
    EVENTS--> Irrelevant
    POST-LOOP--> Sets animation back to normal so the player sees it
    END

    I don't get how the player isn't calculating the hit detection correct, I have an animation that is bigger then the hit detection and for some reason it's calculating the hit detection to that animation. I'm kind of lost anyone have any ideas? x.x

  8. #8
    No Products Registered

    Join Date
    Oct 2009
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Linking Multiple Objects

    Actually I fixed it, I set it to check for collision in the enemy loop rather then in the player loop and that fixed it, not really sure how that fixes it but I won't complain

Similar Threads

  1. 2 objects linking
    By Pharanygitis in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 18th January 2009, 02:24 PM
  2. Linking objects
    By stuckboy in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 10th May 2007, 05:13 PM
  3. Sum (multiple alt values, multiple objects)
    By Melvin in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 20th April 2007, 02:00 AM
  4. Linking loads of objects together...confusion
    By Mantoid in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 10th March 2007, 07:25 PM
  5. Linking objects problem.
    By Matt_Gardner in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 14th August 2006, 01:34 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
  •