User Tag List

Results 1 to 7 of 7

Thread: Is there any way to use For Each loops with the Platform Movement Object?

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export Module

    Join Date
    Mar 2014
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is there any way to use For Each loops with the Platform Movement Object?

    Recently, I've wanted to try my hand at a more in-depth platform game than I've made before. I have a pretty good handle on how the Platform Movement Object works, and I can set up a player pretty easily. In theory, I should be able to do this with enemies as well.

    I've put together a For Each loop that will create a Platform Movement Object for each enemy object I've placed on the screen. This seems to be working fine until I try to give each object an individual action. Specifically, I have it so each enemy object has one of it's values set to 0 or 1. If it's zero, I want it to move left to test the movement out. But every time I select the action that sets the right movement arrow to pressed, it affects EVERY instance, not just the ones with the value set to zero.

    Is there any way I can set up enemies set up with the platform movement object and have them react individually? Or is there an inherent limitation in the object that prevents this?

    Thanks for the help!

  2. #2
    Clicker Fusion 2.5Fusion 2.5 Mac
    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)
    zip2kx's Avatar
    Join Date
    Jun 2015
    Posts
    759
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Yes this is actually normal way of doing platform AI.
    What you need to do is to give the PMOs an alt value and set that value to the fixed value of your enemy object. Then in your event check if PMO Value = Fixed value of Enemy object >> do whatever.

  3. #3
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,013
    Mentioned
    63 Post(s)
    Tagged
    0 Thread(s)
    You're having problems with scoping. What zip said is precisely what you need. But if you want more info and examples, I wrote an article a while ago all about scoping, including with ForEach loops.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export Module

    Join Date
    Nov 2013
    Location
    San Diego, CA
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There's an example file showing how to do this. I'll dig it up for you later today when I'm at my computer.

    Sent from my SAMSUNG-SM-G928A using Tapatalk

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleInstall Creator Pro
    Ls2's Avatar
    Join Date
    Jun 2011
    Location
    Maceiˇ - Brazil
    Posts
    909
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    GentlemanTiger,

    Hello. Take a look in this thread. render8 and BartekB did post excellent examples that are exactly what you need.

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export Module

    Join Date
    Nov 2013
    Location
    San Diego, CA
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ls2 View Post
    GentlemanTiger,

    Hello. Take a look in this thread. render8 and BartekB did post excellent examples that are exactly what you need.
    This is the example I was thinking of. Should suit your needs perfectly.

    Sent from my SAMSUNG-SM-G928A using Tapatalk

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export Module

    Join Date
    Mar 2014
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ls2 View Post
    GentlemanTiger,

    Hello. Take a look in this thread. render8 and BartekB did post excellent examples that are exactly what you need.
    While all the examples were useful, this one helped me crack the problem finally. Thanks a lot for the help!

Similar Threads

  1. Replies: 1
    Last Post: 23rd September 2016, 08:37 PM
  2. Horizontal Moving Platform using Platform Movement Object example
    By Warmachine in forum Guides, Tutorials, Examples, Widgets
    Replies: 0
    Last Post: 20th January 2015, 09:31 PM
  3. Replies: 2
    Last Post: 5th January 2015, 10:13 PM
  4. Jump Through Platform (Platform Movement Object)
    By Tuna in forum SWF/Flash Export Module Version 2.0
    Replies: 8
    Last Post: 4th January 2011, 12:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •