User Tag List

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

Thread: How can I allow user to only click on an object when not behind a specific layer??

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    Robotica's Avatar
    Join Date
    Jul 2015
    Location
    Las Vegas, NV and Orange, CA.
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How can I allow user to only click on an object when not behind a specific layer??

    Hello clickers,

    I have a question. Please view this image below:
    stage05_issue_with_negate_mouse_over.jpg

    I am aware that you can allow a user to not destroy an object if your object is behind a certain object... in this case it would be the blocks... code would be:

    +use clicks on robot
    NEGATE +mouse is over blocks

    But this would only work for the robots on the far outter edges and very dead center but not for other robots overlapping with blocks because then they cannot be shot would be invincible...

    I'm sending the same object/robot to all 3 layers (front, middle, back as shown in the hierarchy of my layers at the right hand side of the screenshot... and I want to send only this one object to preserve memory and cpu).

    I could just use one robot for each of the 3 rows and send out instances of the same 3 objects... but I rather just have ONE object and send it everywhere I need with a coordinate and directions of left or right.

    How would I have it so that you can only destroy a robot on a specific layer if he is not hiding being a specific layer of blocks?

    thanks!

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    Robotica's Avatar
    Join Date
    Jul 2015
    Location
    Las Vegas, NV and Orange, CA.
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    do beee, do be dooo...

  3. #3
    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)
    There's probably a way to do this by keeping track of when a robot is entirely obscured by a block and therefore can't be shot, but to do it without having to keep track of any additional state... have you used fastloops yet? It looks like you're using separate layers for the robots and the blocks that obscure them - so when the player presses fire, you could create an invisible object at the position where the cursor was (the 'bullet'), and then loop like this:

    Player presses fire:
    -> Create 'bullet' at 0,0 from cursor
    -> Bullet: Set layer to (the frontmost layer)
    -> Run loop 'bulletDetect' 8 times (or however many layers you have).

    On loop 'bulletDetect' AND bullet is overlapping one of the blocks:
    -> Destroy the bullet
    -> Stop the loop
    -> Do anything else you need to indicate a miss/block hit

    On loop 'bulletDetect' AND bullet is overlapping a robot:
    -> Destroy the bullet
    -> Stop the loop
    -> Indicate a hit

    On loop 'bulletDetect':
    -> Set layer of bullet to [current layer of bullet] - 1

    When you run this, the bullet will travel down the layers checking in order from front to back.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    Robotica's Avatar
    Join Date
    Jul 2015
    Location
    Las Vegas, NV and Orange, CA.
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oooooo, nice! thank you!

    edit:
    Nope, I have not used fast loops yet but I used to eat a lot of fruity loops as a kid.

    I will study your suggestion until I figure it out. Thank you!

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    Robotica's Avatar
    Join Date
    Jul 2015
    Location
    Las Vegas, NV and Orange, CA.
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmmm, I was actually trying to add a cursor Sunday but I couldn't figure out where to select 0,0 from cursor... when I select "relative to" it only lists my objects (blocks, robot, floor). Any ideas where I should be clicking??

    set_coordinates_or_relative_to.jpg

  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)
    How about the X - Y from the mouse?

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    Robotica's Avatar
    Join Date
    Jul 2015
    Location
    Las Vegas, NV and Orange, CA.
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah figured it out. It's another few steps... create object.... then it's somewhere else... grid box of the object... select position -> set x coordinate -> set x position to xmouse.

    Okay... but it noticed it appears 5 pixels up and 5 pixels to the left... not exactly on point where I am clicking.

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    Robotica's Avatar
    Join Date
    Jul 2015
    Location
    Las Vegas, NV and Orange, CA.
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here is a visual representation of how far off it is.

    Attachment 17413

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    Robotica's Avatar
    Join Date
    Jul 2015
    Location
    Las Vegas, NV and Orange, CA.
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Jeff View Post
    How about the X - Y from the mouse?
    Hi Jeff.
    I think I have that correct. Is this right?

    x and y coordinates of mouse.jpg

  10. #10
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,822
    Mentioned
    7 Post(s)
    Tagged
    2 Thread(s)
    Well it certainly can be done.

    Since your targeting Android (mobile) I would look into the multi touch object and see if the X-Y of the users touch is what you want.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. layer object bugs (swf specific)
    By life2searching in forum SWF/Flash Export Module Version 2.0
    Replies: 1
    Last Post: 30th July 2010, 08:12 PM
  2. Problem with deleting objects on a specific layer
    By ChrisStreet in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 7th June 2009, 01:29 PM
  3. Select all objects in a specific layer and more.
    By RHK in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 8th September 2008, 06:21 PM
  4. Layer Object can't move counters to specific layer
    By JoKa in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 20th November 2007, 12:11 PM
  5. User mouse click to start moevement.
    By wargasmic in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 14th December 2006, 09:56 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
  •