User Tag List

Page 1 of 17 1 2 3 11 ... LastLast
Results 1 to 10 of 168

Thread: how to make character disappear

  1. #1
    Clicker Fusion 2.5 Developer
    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)

    Join Date
    Mar 2018
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to make character disappear

    1st question - so in my game there is a badguy called "scarecrow" and when you choose him in frame 1 he will be active in frame 2. so how do i make him fully disappear when not selected? meaning how do i make sure he wont be active and if i walk on him i wont get hurt. and also having the food be spawning on top and around his area when not active but not spawning on top of him when is active (i have a code under the food section where it prevents food from spawning on top of the characters.) the code for the scarecrow is located in the "enemies" tab and also the "move safely" tab and also lines 5 & 6. 2nd question - when the player collides with the bombs he doesnt get hurt even though i programmed him to. when the bomb collides with the player its supposed to create an explosion that takes a heart from the player but instead just goes over him acting like he doesnt exist, i checked everything and dont seem to find any errors. i also have a player collision box that for some reason doesnt exist either, i have the player collision in the frame and code checks out but for some reason if you turn the visibility on for the collision box and start the frame, it doesnt show up anywhere. 3rd question - when you select the bat enemy from frame 1 he is supposed to spawn from the top, bottom, and the left side, but he only spawns from mostly the bottom and barely on top, im not sure why this happens and why he never spawns from the left side. thanks

    game file - game.mfa

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,005
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Euingee View Post
    1st question - so in my game there is a badguy called "scarecrow" and when you choose him in frame 1 he will be active in frame 2. so how do i make him fully disappear when not selected?

    Option 1: Assuming he is choice number 14 then you'd insert this at the start of frame of frame 2:

    * Start of Frame
    + First Choice Bad Guy <> 14
    + Second Choice Bad Guy <> 14
    scarecrow : Destroy


    Option 2: Tick off the block that creates him at the start and only create him if the First Choice or Second Choice = 14.


    2nd question - when the player collides with the bombs he doesnt get hurt even though i programmed him to. when the bomb collides with the player its supposed to create an explosion that takes a heart from the player but instead just goes over him acting like he doesnt exist, i checked everything and dont seem to find any errors. i also have a player collision box that for some reason doesnt exist either, i have the player collision in the frame and code checks out but for some reason if you turn the visibility on for the collision box and start the frame, it doesnt show up anywhere.
    Place the player collision in the frame - preferably on top of the player - not off to the side. Off to the side it might be caught by the "Destroy if too far from the frame" setting.


    3rd question - when you select the bat enemy from frame 1 he is supposed to spawn from the top, bottom, and the left side, but he only spawns from mostly the bottom and barely on top, im not sure why this happens and why he never spawns from the left side. thanks
    You have the condition in your create events that the baddies shouldn't be overlapping. The left spawn is the last to be created and at that point there are always going to be baddies and they're probably going to be overlapping and mostly then it won't be created. I would recommend you remove that condition - the one in bold. It's going to trip you up on all your baddies.

    * Every 08''-00+ First Choice Bad Guy = 13
    + First Choice Bad Guy <> 10
    + Second Choice Bad Guy <> 10
    + NOT Group.Bad is overlapping Group.Bad
    Special : Set Timer Bad Guy 13 to 0
    New Objects : Create bat at (0,0) from left_side_spawn


    Tip: Duplicate your Ready button on frame 1 to the end of the second screen so the player can also click ready from that screen.

  3. #3
    Clicker Fusion 2.5 Developer
    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)

    Join Date
    Mar 2018
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @Janette5 thank you! but now for some reason when you select the bat and an enemy that spawns for the top or the sides sometimes they spawn on top of each other or some just dont spawn on one side at all. like if you select the praying mantis and the snake they will spawn on top of each other and the snake will only spawn on side and not the other. im not sure why it does that.

    game file - game.mfa

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,005
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    Your condition Group.Bad is overlapping Group.Bad - negated - does not scope to the current baddie - it will test all baddies and if any baddies are overlapping anywhere in the scene it won't create the baddie. This means a lot of the time your baddies just aren't going to be created. That's why I recommended you remove that command.

    Having multiple items run every 6 seconds is not the best way to program Fusion. I think if you use a countdown value and spawn every enemy in their own time then it might work better.

    For example, if the player chooses 2 enemies that both spawn at 6 seconds from the left - those 2 enemies will be created on top of each other.
    or if the player chooses an enemy that spawns every 6 seconds and one that spawns every 4 seconds - then every 2nd time the first enemy is created is also the third time enemy 2 is created i.e. both enemies are created at 12 seconds (6 x 2) and (4 x 3) and once again they'll be created on top of each other. This pattern will repeat several times. Since you're creating them off-screen perhaps you can test if it's overlapping another enemy after the creation event and if it is, either destroy it or stop it for a second or two and then send it in so they don't both enter the screen on top of each other.

  5. #5
    Clicker Fusion 2.5 Developer
    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)

    Join Date
    Mar 2018
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @Janette5 how would i test if its overlapping another enemy off screen? i think stopping it for a second or two could work best but im not sure how to put it in. i have an idea of how to do it but i messed up.

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,005
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    I thought of a better idea:

    Step 1: For this to work you need to remove the tick on the properties of every baddie: Destroy object if too far from frame.
    Step 2: I chose 4 flags as follows:

    Flag 10 when baddie spawns from the left
    Flag 11 when baddie spawns from the right
    Flag 12 when baddie spawns from the top
    Flag 13 when baddie spawns from the bottom

    Step3: With the code that you're creating your baddies, insert these flags - I've changed the crab and snake below as examples:

    Code:
    * Every 04''-00
    + First Choice Bad Guy = 1
    Special : Set Timer Bad Guy 1 to 0
    New Objects : Create crab at (0,0) from top_spawn
    crab : Set Flag 10 on
    * Every 06''-00 + First Choice Bad Guy = 1
    Special : Set Timer Bad Guy 1 to 0
    New Objects : Create crab at (0,0) from bottom_spawn
    crab : Set Flag 11 on
    * Every 04''-00 + Second Choice Bad Guy = 1
    Special : Set Timer Bad Guy 1 to 0
    New Objects : Create crab at (0,0) from top_spawn
    crab : Set Flag 10 on
    * Every 06''-00 + Second Choice Bad Guy = 1
    Special : Set Timer Bad Guy 1 to 0
    New Objects : Create crab at (0,0) from bottom_spawn
    crab : Set Flag 11 on
    * Every 08''-00 + First Choice Bad Guy = 2 + First Choice Bad Guy <> 10 + Second Choice Bad Guy <> 10
    Special : Set Timer Bad Guy 2 to 0
    New Objects : Create snake at (0,0) from left_side_spawn
    snake : Set Flag 12 on
    * Every 10''-00 + First Choice Bad Guy = 2
    Special : Set Timer Bad Guy 2 to 0
    New Objects : Create snake at (0,0) from right_side_spawn
    snake : Set Flag 13 on
    * Every 08''-00 + Second Choice Bad Guy = 2 + First Choice Bad Guy <> 10 + Second Choice Bad Guy <> 10
    Special : Set Timer Bad Guy 2 to 0
    New Objects : Create snake at (0,0) from left_side_spawn
    snake : Set Flag 12 on
    * Every 10''-00 + Second Choice Bad Guy = 2
    Special : Set Timer Bad Guy 2 to 0
    New Objects : Create snake at (0,0) from right_side_spawn
    snake : Set Flag 13 on

    Step 4: Insert this code - for every direction:

    Code:
    // ALWAYS
    
    
    * Group.Bad: Flag 10 is on  //test for the flag which indicates it's newly created
    + Group.Bad is overlapping Group.Bad  //test if the baddies are overlapping
    + Pick one of Group.Bad  //only pick one of the baddies that are overlapping
    Group.Bad : Set Y position to Y( "Group.Bad" ) - 200 //move this baddie back 200 pixels so they no longer overlap
    * Group.Bad: Flag 11 is on + Group.Bad is overlapping Group.Bad + Pick one of Group.Bad
    Group.Bad : Set Y position to Y( "Group.Bad" ) + 200
    * Group.Bad: Flag 12 is on + Group.Bad is overlapping Group.Bad + Pick one of Group.Bad
    Group.Bad : Set X position to X( "Group.Bad" ) - 100
    * Group.Bad: Flag 13 is on + Group.Bad is overlapping Group.Bad + Pick one of Group.Bad
    Group.Bad : Set X position to X( "Group.Bad" ) + 100
    * Group.Bad is in the play area //set the flags off when the baddie enters the screen
    Group.Bad : Set Flag 10 off Group.Bad : Set Flag 11 off Group.Bad : Set Flag 12 off Group.Bad : Set Flag 13 off
    I tested it and it appears to work. It basically delays the one baddie because it will take longer for him to go onto the screen but he won't be overlapping the other one. You'll still notice some baddies not appearing simply because
    they might be constantly moved back so that another baddie can advance.

    _______________
    Also you must reset your global values when your frame restarts:

    Set Count Bad Guys Selected = 0

    You can insert this into a start of frame event of frame 1.

  7. #7
    Clicker Fusion 2.5 Developer
    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)

    Join Date
    Mar 2018
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @Janette5 do i need to set the flags on all the baddies? and in the code for the crab you put set flag to 10 but the crab spawns on top and bottom, im not really sure if you meant to put flag 12 and 13 instead of 10 and 11 or if it was done on purpose. and where would i put the code for every direction? do i need to put it under the "enemies" group or just make a new one. and to reset the global values on frame 1, when the player clicks on the ready button do i need to reset it then? or is there another way to do it? thanks!

  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,005
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Euingee View Post
    @Janette5 do i need to set the flags on all the baddies?
    Yes

    and in the code for the crab you put set flag to 10 but the crab spawns on top and bottom, im not really sure if you meant to put flag 12 and 13 instead of 10 and 11
    Mistake - in the example I made I had used 10 + 11 to be the top and bottom and when I wrote the description I swapped them all around. Sorry.

    and where would i put the code for every direction? do i need to put it under the "enemies" group or just make a new one.
    Anywhere - you can put it at the bottom of the enemies group.

    and to reset the global values on frame 1, when the player clicks on the ready button do i need to reset it then? or is there another way to do it? thanks!
    No, write a Start of Frame Event on frame 1 to reset it, and that's the only place you need it

  9. #9
    Clicker Fusion 2.5 Developer
    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)

    Join Date
    Mar 2018
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @Janette5 ok so i tested everything out and it all seems to work. but just to be sure, for step 4, is this how i need to write it? Untitled.png

  10. #10
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,005
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    No, sorry for the confusion - I'll make a mental note to only post here after my coffee has kicked in... not before!

    Basically what I'm doing is moving the baddies backwards from their position 100 or 200 pixels - 200 is probably better - which puts them behind the other baddie instead of on top of the other baddie.

    You don't need the command always - that was just my group heading - you can delete it in your example, it does nothing there.

    Then the code should be:

    Spawn from Left is on
    Group.Bad is overlapping Group.Bad
    Pick one of Group.Bad
    Set X position to X( "Group.Bad" ) - 200


    Spawn from Right is on
    Group.Bad is overlapping Group.Bad
    Pick one of Group.Bad
    Set X position to X( "Group.Bad" ) + 200


    Spawn from Top is on
    Group.Bad is overlapping Group.Bad
    Pick one of Group.Bad
    Set Y position to Y( "Group.Bad" ) - 200


    Spawn from Bottom is on
    Group.Bad is overlapping Group.Bad
    Pick one of Group.Bad
    Set Y position to Y( "Group.Bad" ) + 200

Page 1 of 17 1 2 3 11 ... LastLast

Similar Threads

  1. How to make transparent shadows disappear with an object?
    By Half_Mexican in forum Fusion 2.5
    Replies: 1
    Last Post: 10th March 2019, 04:09 PM
  2. Replies: 19
    Last Post: 30th April 2017, 07:16 PM
  3. How to make a sprite scale and then disappear
    By nicklowkc in forum Fusion 2.5
    Replies: 3
    Last Post: 24th November 2015, 10:22 AM
  4. [SOLVED] click object to make it disappear
    By stillhawk in forum The Games Factory 2 - Technical Support
    Replies: 5
    Last Post: 16th June 2007, 10:42 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
  •