User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 13 of 13

Thread: best practices with managing sidescroller enemy movement?

  1. #11
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    646
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    I think you need to experiment with moving the actual enemy hitbox around instead of using multiple detectors. There are a few places where this would save you a lot of objects. Some general tips:

    -instead of 4 detectors for left/right/top/bottom, simply shift 1 pixel in each direction, checking for collision each time. You could use 4 values to set these as "colliding", one for each direction, but i use a workaround with one value for left/right and one value for top/bottom: values are reset to 0 before checks. overlapping on left adds 1 to value, overlapping on right adds 2 to value. if value = 1 then object overlaps left. if value = 2 then object overlaps right. if value = 3 then object overlaps on both sides, then do the same for the y value.
    -you can shift the hitbox to check for small ledges like in your image using 3 checks: whole hitbox height up, whole hitbox width over, whole hitbox width and height over. you could also ditch a few "chase" detectors using multiple checks this way on horizontal, or if you use a circle, opt instead for a distance check to player.
    -if you do need actual external detectors, then you only need one side: just check the left/right direction of your object and move them to the other side as needed
    -one set of detectors looped though objects like Gamester suggests is also good practice. add in my suggestion of "swapping sides" with a single direction of objects to make it even more compact.
    -hidden triggers in level work great and if they'll save you a few annoying checks or detectors: use them

    as to movement: i always use fastloop movement for the actual "core" of any moving object that needs collision.

  2. #12
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,299
    Mentioned
    94 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Volnaiskra View Post

    ..... there's probably a great deal that I haven't thought through properly, and that I should probably seek the advice of those who have more experience with this sort of thing.
    Never have truer words been spoken. Thanks for the great tips everyone! Keep them coming!

  3. #13
    Clicker Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)

    Join Date
    Nov 2017
    Posts
    97
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    This is indeed a great thread and should be helpful to anybody searching sidescroller enemy movement into in future.

    Good points regarding restoring animations within the loop, Vol - never thought of that.

    I actually attempted the "one hitbox looping through all enemies" method but for some reason, I just couldn't get it to work. Any examples? Not even a mfa, just like, a description of how the loop is structured and how it would work? I'd appreciate it greatly!

Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. 3D Effect on 2D Sidescroller?
    By Devis in forum Fusion 2.5
    Replies: 6
    Last Post: 27th February 2015, 03:01 PM
  2. KALABAN - A sidescroller survival horror [WIP]
    By SirRandom in forum WIP & Released Games & Apps
    Replies: 4
    Last Post: 22nd January 2015, 07:33 PM
  3. sidescroller help!!!
    By Mostafa in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 15th July 2013, 04:28 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
  •