User Tag List

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

Thread: Onscreen/offscreen create and destroy

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLC
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)iOS Export Module (Steam)

    Join Date
    Jul 2008
    Location
    The U of K.
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Onscreen/offscreen create and destroy

    hello lol cud sum1 pls help with this problem i hav

    Okay, I'm not that stupid, but I'm feeling pretty simple at the moment thanks to this problem I'm having, and I suspect it's got a simple answer that's just not coming to me. Normally I'd be willing to wrestle with it for days until it's solved, but the game's a christmas present for someone and I'm well behind!

    My problem is this:

    What I have
    A main active object that when value a =1 an event creates 6 active objects in positions relative to that object. When val a =0, it destroys these objects (by detecting that they overlap the main active. There are many of these main active objects hence the use of alterable values.

    What I want to do

    For various reasons I want these 6 objects to exist when they're onscreen, visible to the player (it's a scrolling game) and destroyed when they're not (offscreen), and then created if and when the player gets close enough to the main active object again.

    How do you suggest I do this?

  2. #2
    Clicker Multimedia Fusion 2
    dragonguy's Avatar
    Join Date
    Apr 2008
    Location
    RULE BRITANNIA!
    Posts
    3,071
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Onscreen/offscreen create and destroy

    There are some expression you can use to help.

    X Left Frame
    X Right Frame
    Y Top Frame
    Y Bottom Frame

    You can create new condition -> Special Object -> Compare two general values and type one of them in and use to tell whether or not it's close enough to the screen.

  3. #3
    No Products Registered

    Join Date
    Jun 2007
    Posts
    323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Onscreen/offscreen create and destroy

    I would use
    "If active is getting closer than -20 from windows edge" -destroy object

  4. #4
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,822
    Mentioned
    7 Post(s)
    Tagged
    2 Thread(s)

    Re: Onscreen/offscreen create and destroy

    Your also going to have to build a whole elaborate system to recreate them when the player scrolls back.

    If possible I might just make them stay around when they are off screen. You could turn them invisible or something if they need to reappear or have some special effect when the player reappears.

  5. #5
    No Products Registered

    Join Date
    Aug 2006
    Posts
    984
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Onscreen/offscreen create and destroy

    Quote Originally Posted by Jeff
    Your also going to have to build a whole elaborate system to recreate them when the player scrolls back.

    If possible I might just make them stay around when they are off screen. You could turn them invisible or something if they need to reappear or have some special effect when the player reappears.
    this

    usually, destroying/recreating objects constantly when you could hide them or move them to another layer instead is asking for problems and performance issues

  6. #6
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,822
    Mentioned
    7 Post(s)
    Tagged
    2 Thread(s)

    Re: Onscreen/offscreen create and destroy

    Ah yes I was thinking bigger like he was going to have various objects all over and they weren't relative to the player more relative to the screen.

    Seemed like a lot of work to go thru re figure where it needed to be and if it existed or not when the player came thru this section of the screen last time.

    I would be looking into something simplier comparing the X,Y of the player to the X,Y of the special active object and just recreating them as needed and destroying when not.


    I doubt you wanted something like this but it was interesting so I hacked out an example

    www.flyinvinteractive.com/mmfexamples/hack_getting_close_example.mfa

    Move your active towards the red box
    If you get within 150 pixels of it a green ball will appear and rotate around you -- until you moved out of the 150 pixel zone.
    Note -- I threw down a yellow backdrop but I didn't make sure it was pixel perfect I just wanted a visual representation of where the zone was.

    Who knows if it will help you but it was fun to play with for a couple minutes

    The corners seem odd on the detection - I am sure a math wiz can do it better -- I hate math so I just used an object feature to test how far away they were.


  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLC
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)iOS Export Module (Steam)

    Join Date
    Jul 2008
    Location
    The U of K.
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Onscreen/offscreen create and destroy

    Quote Originally Posted by camelman
    I would use
    "If active is getting closer than -20 from windows edge" -destroy object
    That's what I use to destroy, yep. And load again, too.

    Thing is, I got it working to a degree, but the create event keeps repeating itself.

    I've tried it with all of the objects made, the performance hit was big and unworkable.

    I've made some progress.

    Question: Is there a way for an event to occur once per group activation? Then I can deactivate the event when it's done, and activate again when needed, for the event to play again. I know there's Limit conditions, but none of them seem to do what I require.

    You're right to say that's not quite what I'm looking for Jeff, but it's an interesting example and has inspired me to sort out an unrelated issue I was having on another project.

  8. #8
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,822
    Mentioned
    7 Post(s)
    Tagged
    2 Thread(s)

    Re: Onscreen/offscreen create and destroy

    There is an "on group activation event"
    Perhaps try that and see if it works for what you want.

    Under the special then group of events


  9. #9
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLC
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)iOS Export Module (Steam)

    Join Date
    Jul 2008
    Location
    The U of K.
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Onscreen/offscreen create and destroy

    I tried that one, but it doesn't execute the event just the once.

  10. #10
    Clicker Multimedia Fusion 2SWF Export Module
    Jacob's Avatar
    Join Date
    Jul 2007
    Location
    Second pixel to the right
    Posts
    3,208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Onscreen/offscreen create and destroy

    try
    Always
    +only one action when event loops

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Making objects visible while onscreen, then hiding them while offscreen
    By Xeeko in forum iOS Export Module Version 2.0
    Replies: 11
    Last Post: 13th February 2013, 08:20 AM
  2. created objects create objects and destroy both.
    By wizlore in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 25th September 2012, 09:37 PM
  3. Test if object is onscreen vs. offscreen?
    By ratty in forum Multimedia Fusion 2 - Technical Support
    Replies: 15
    Last Post: 28th July 2012, 04:50 AM
  4. spawning offscreen
    By life2searching in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 18th May 2012, 09:56 AM
  5. offscreen action
    By ad in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 26th April 2012, 08:18 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
  •