User Tag List

Results 1 to 4 of 4

Thread: Need help with unique enemy movements (bouncing ball object)

  1. #1
    Clicker Fusion 2.5

    Join Date
    Oct 2012
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help with unique enemy movements (bouncing ball object)

    I have these enemies with unique movements. Not only do they jump left and right, they also bounce at random, tailored to a global value that signifies when they randomly bounce left or right. My problem is that using a simple spread value in ID with a checknear function of them bouncing doesn't seem to be working. All duplicates imitate each other. Additionally, all duplicates stop jumping as well.

    However, something important to note, this code is for a game I'm creating with a couple of friends. I'm not sure about the ethical quandaries of getting help with my code. I'll give credits, but would I have to compensate as well? Let me know if anybody knows anything about that.

    I suppose you can take a look at the code to know what I mean. I'm sorry in advance, I'm was lazy and I didn't label it ahead of time. The code isn't awfully complicated, if it is I will kindly label it if need be. You only have to take a look at the movement and jumping portions I labeled in the code, feel free to ignore everything else.Enemy Help.mfa

  2. #2
    Clicker Fusion 2.5

    Join Date
    Jan 2018
    Posts
    190
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    i dont understand your code because it's in english and i am french but this probleme, generally is caused because you need a loop , you also need to create every detector for every ennemi, or just one detector which will be affected at every ennemi with a loop (then detection must be in the loop too)

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,159
    Mentioned
    199 Post(s)
    Tagged
    0 Thread(s)
    On line 65 you spread the value after calling the loop - in other words the loop is running before the value is spread and so doesn't work.

    But what fredetmumu said, is that you need a "For Each" loop - if you right click under the enemy in the event editor - then select count - then select - for each enemy - then Fusion will check each enemy individually. (Just search the forums for: "for each loop" examples - there are many)

    However, if you use the platform movement object and the bouncing ball object together you will get a lot of conflicting code running and putting the "for each loop" into your example caused chaos because things just don't work with the two movements together. I would suggest you don't include your enemies in the platform movement object but just give them the bouncing ball movement.

    Other things I noticed:
    line 89 - the always does nothing there - you can remove it.
    You do not need a collision and an overlap event - only one will do.
    A collision is only executed once the first time they collide. An overlapping condition is executed each time while they are overlapping.

    Asking for help in the forums is part of learning Fusion. No payment or credits are necessary. It's okay to ask people how to write something - we all do, think of it as an interactive manual - you wouldn't feel guilty about reading or following examples in a manual - you shouldn't feel guilty for getting / asking for help in the forums either.

  4. #4
    Clicker Fusion 2.5

    Join Date
    Oct 2012
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for all the advice so far, I beridded of the PMO from the enemy and I'm using custom movement for it now. I got the enemy to move left and right and built in gravity for it with the help of this video by almightyzentaco: https://www.youtube.com/watch?v=XktQxCeuluo

    I proceeded to build it's bouncing movement again without the PMO, I thought I got it working but no cigar. There is something in it's jumping behavior that is conflicting with it moving left and right, because it seems to only want to move in one direction once I built it's bouncing behavior on top of its xmove and ymove code. I for the life of me cannot figure out what the conflict is, I'd appreciate it if I could once again could locate the problem.Enemy Help (3).mfa

Similar Threads

  1. Controlling Physics Bouncing Ball Movements
    By Jusfury in forum Fusion 2.5
    Replies: 1
    Last Post: 15th April 2020, 03:05 AM
  2. Export Failed with Bouncing Ball Object
    By Daniel_M in forum Android Export Module 2.5
    Replies: 13
    Last Post: 11th May 2016, 08:54 PM
  3. Bouncing ball movements stop randomly
    By soopytwist in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 3rd September 2015, 07:40 PM
  4. Physics - bouncing ball object collision with itself?
    By AndyBazooka in forum Fusion 2.5
    Replies: 6
    Last Post: 6th July 2014, 10:58 PM
  5. How do I drag and drop a bouncing ball object?
    By Aloan in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 13th March 2011, 05:52 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
  •