User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 18

Thread: Make enemies invisible outside window/visible inside window

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    paobrasil's Avatar
    Join Date
    Apr 2012
    Location
    Rio de Janeiro, Brazil
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Make enemies invisible outside window/visible inside window

    Hello again my friends,

    I'm trying to make my enemies become invisible when outside visible window area and visible when inside visible window area.

    I have a lot of enemies, but all with the same qualifier, then I did:

    X right (Group.Enemies) < X Left Frame
    Or (logical)
    X left (Group.Enemies) > X Right Frame
    Or (logical)
    Y Bottom (Group.Enemies) < Y Top Frame
    Or (logical)
    Y Top (Group.Enemies) > Y Bottom Frame

    =>>>>> Set Invisible


    X right (Group.Enemies) >= X Left Frame
    X left (Group.Enemies) > <= Right Frame
    Y Bottom (Group.Enemies) >= Y Top Frame
    Y Top (Group.Enemies) <= Y Bottom Frame

    =>>>>> Reappear.



    But, I dont know why, my enemies dont become visible again when get inside the visible window area. Someone know what I'm doing wrong?

    Thanks, best regards!

  2. #2
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your top event means that whenever any enemy fulfils any of those conditions, all enemies will be made invisible - the "Compare two general values" event doesn't select a specific enemy to act on.

    You could work around this using a Foreach loop, but perhaps we should take a step back as well - why do you need enemies to become invisible when they're outside the window? By definition, the player won't be able to see them anyway...

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    paobrasil's Avatar
    Join Date
    Apr 2012
    Location
    Rio de Janeiro, Brazil
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For performance reasons? right or i'm wrong?

  4. #4
    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,306
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    I'm with paobrasil on this one, actually. I've used a similar trick before and noticed that there may be some minor performance boosts by manually making objects outside of the visible area invisible, though I can't be too sure...

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    paobrasil's Avatar
    Join Date
    Apr 2012
    Location
    Rio de Janeiro, Brazil
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, I want to deploy my game to IOS, Android & OUYA. So, each minor performance boost it's important. But, I really dont know if we need to set invisible, or the graphics card automatically dont draw objects outside the window. But, even if it dont draw, I have some events, like loops that are executed when the active it's visible, for example, the enemy throw a bomb trough a loop, so it's important to keep it invisible.

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    Maybe the option "Inactivate if too far from frame" could do a similar job?

    In my actual project, since many objects are invoved,
    I'm destroying them while they leave the visible area,
    at the same time saving their positions & specific settings
    in order to recreate them when in need.
    You could also consider this option.

    However, to answer your starting question:
    you could do that job by directly comparing X position of (object)
    and letting some room to let the active completely go out of the screen (example. X position of object > frame width + 10)
    rather then retrieving its position by "compare two general values"
    which, as DavidN said, is not object-selective.

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    paobrasil's Avatar
    Join Date
    Apr 2012
    Location
    Rio de Janeiro, Brazil
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I need to avoid create/destroy action because of android that cant figure it too well...

  8. #8
    DiggityBam
    Guest
    Quote Originally Posted by DavidN View Post
    Your top event means that whenever any enemy fulfils any of those conditions, all enemies will be made invisible - the "Compare two general values" event doesn't select a specific enemy to act on.

    You could work around this using a Foreach loop, but perhaps we should take a step back as well - why do you need enemies to become invisible when they're outside the window? By definition, the player won't be able to see them anyway...
    I second using a Foreach loop, its happening just as David is saying, its reading all enemies and setting them to invisible. So unless all your enemies jam pack together within the screen, they will remain invisible so long as any are outside.

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by schrodinger View Post
    1) Maybe the option "Inactivate if too far from frame" could do a similar job?

    2) However, to answer your starting question:
    you could do that job by directly comparing X position of (object)
    and letting some room to let the active completely go out of the screen (example. X position of object > frame width + 10)
    rather then retrieving its position by "compare two general values"
    which, as DavidN said, is not object-selective.
    The two above should do the job!
    I personally use the second (albeit for destroying)
    which is object-selective and works fine

    Example:
    remove_objects.mfa

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    ..and of course you can use that with "X Left Frame" too.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Fit inside and adjust window
    By Olivier in forum HTML5 Export Module 2.5
    Replies: 36
    Last Post: 28th May 2019, 07:25 PM
  2. Fit inside & Adjust Window Size
    By ProdigyX in forum Android Export Module Version 2.0
    Replies: 2
    Last Post: 9th October 2014, 08:28 AM
  3. [RC3] fit inside and adjust window size issues
    By SoftWarewolf in forum Android Export Module Version 2.0
    Replies: 4
    Last Post: 11th February 2013, 07:08 PM
  4. make layer visible/invisible?
    By Iwantmyrpg in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 20th September 2009, 11:39 PM
  5. Window Control -> visible area manipulation
    By RayMarble in forum The Games Factory 2 - Technical Support
    Replies: 6
    Last Post: 22nd December 2008, 10:50 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
  •