User Tag List

Results 1 to 5 of 5

Thread: Stopping enemies overlapping on top down scroller?

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    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)
    rosse119's Avatar
    Join Date
    Dec 2012
    Posts
    473
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Stopping enemies overlapping on top down scroller?

    Hello,

    I'm currently working on a top down 2D scroller similar to Spyhunter called Super Renegade Response, my issue is I have made some cars that bumps the player off the road, it uses 4 detectors on the player car, two wide ones at each side so when a bumping car is in that sensor it changes its x coordinate depending whether its on the left or the right.

    The problem I have is I can only have one of these cars on screen at once as they tend to overlap as they are both drawn closer to the player car.
    Anything I can do to fix this?

    I thought of sensors for the bumping cars too, but how would you make each duplicate have its own sensors? As they are the same Active.

    Thank you in advance.

    James

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Francois's Avatar
    Join Date
    Jul 2006
    Location
    Montpellier, France
    Posts
    6,920
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Difficult to answer without seeing the code.
    You will overpass the collision detection if you directly change the X and Y coordinates, and the cars will overlap.
    Have you thought about using Physics? If you do, just use a force to push the cars when the detectors are hit..

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    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)
    rosse119's Avatar
    Join Date
    Dec 2012
    Posts
    473
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Let me see if I can remember the code used.

    Always set Left bumper sensor at position on player (did this for all sensor)

    If bumper car is overlapping right sensor every 0.02miliseconds set x of bumper car to x-2(it might be +2 can never remember when not actually doing it)
    This repeated for the other side to.

    If bumper car collides with player while overlapping sensor then set x of player car to either +15 or -15 depending on what side it is on.
    I also set it so if your front sensor touches a bumper car it will set the Y of bumper car to Y-2
    and same for the rear sensor but y+2

    The best thing I have managed so far is to say if bumper car collides with another bumper car then stop, so far that kind of works but only with 2-3 in set positions, it would be great to have 7 on screen all fighting to knock you off the road.

    I don't have clickfusion yet only MMF2 and its an Ouya title so don't think Box2D extension works with that on MMF2.

  4. #4
    Clicker Fusion 2.5Android Export ModuleSWF Export Module
    Ziplock's Avatar
    Join Date
    Oct 2013
    Posts
    448
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to use IDs. Rename Alterable Value A to ID in your "Left Bumper" and your "Enemy Car."

    // Create ID values for both objects

    Always:
    -> Spread value 0 for ID in ("Left Bumper")
    -> Spread value 0 for ID in ("Enemy Car")

    // Create 1 bumper if less bumpers than cars

    If Number ("Left Bumper") < NObjects ("Enemy Car"):
    -> Create ("Left Bumper") at (0,0)

    // Destroy 1 bumper if more bumpers than cars

    ID of "Left Bumper" > NObjects ("Enemy Car") - 1:
    -> Destroy ("Left Bumper")

    // Affix left bumpers to cars

    Always:
    -> Start Loop "Affix Left Bumper" NObjects ("Left Bumper") Times

    On Loop ("Affix Left Bumper")
    + ID of ("Left Bumper") = Loop Index ("Affix Left Bumper")
    + ID of ("Left Bumper") = ID of ("Enemy Car")
    -> Set position of ("Left Bumper") to ("Enemy Car")
    Attached files Attached files

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    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)
    rosse119's Avatar
    Join Date
    Dec 2012
    Posts
    473
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    This is great, I will download this tonight. Thank you ever so much.

Similar Threads

  1. Overlapping Enemies Question- with example file
    By Youthinkasido in forum Fusion 2.5
    Replies: 5
    Last Post: 15th August 2014, 12:07 AM
  2. Enemies in Side-Scroller Can't Jump
    By Fralex in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 3rd June 2012, 10:20 PM
  3. thrown enemies not detecting other enemies
    By mobichan in forum File Archive
    Replies: 4
    Last Post: 8th April 2009, 06:40 PM
  4. stop enemies from overlapping each other
    By ionside in forum Multimedia Fusion 2 - Technical Support
    Replies: 13
    Last Post: 27th March 2009, 03:52 AM
  5. Help need for top down scroller.
    By rezurrection in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 20th June 2008, 02:19 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
  •