how to (and best way) to make movement patterns?

0 favourites
  • 5 posts
From the Asset Store
Best car suspension with spring effect and very cool terrain generation.
  • Hello all!

    What i'm trying to do is a way to build a level with objects arranged in specific patterns in relation to other objects or with some "formation" pattern by themselves.

    To best clarify my intention see this quick video:

    Subscribe to Construct videos now

    It's a Arkanoid like game with many objects following different movement patterns, like circling around an object, or following a zigzag line.

    Some movements and patterns are easy to do. Sine Behavior and Pin Behavior solves many of those patterns but some others seems hard to make.

    The "line movement" with or without abstract form is a hard one for me.

    Circular movements around another object feels like a Pin thing with parenting and rotations but sometimes it doesn't work as intended.

    Anyway, if someone made similar movement patterns and know how to make them in a manageable, editable way. I will appreciate it.

    (Also interested in how to best load those patterns, like using xml, or something like that)

  • I have to refloat this topic since i'm still struggling with a method to make "movement patterns" or "arrangements in custom shapes formations" and things like that.

    More examples of what i try to do (do and do efficiently):

    1) Move objects in an eight shape or spawn an "eight formation" of objetcs.

    2) Move objects in some kind of curved line or zigzag line.

    3) Move objects around another object following a rotating path around it. (Like orbiting around an object). This one is easy but i put it as an example of Movement Patterns.

    Again the link of a game with a lot of this kind of movement patterns i want:

    Subscribe to Construct videos now

    What make me dizzy is how to save those patterns in a efficient way.

    Hard code them? Spawn objects with an array? Create an xml with each movement and call functions from this file?

    Fixed formations is one thing, but movements following a figure kills me.

    This feels like the way one should program "Bullet Hells".

    I need some direction here   <img src="smileys/smiley18.gif" border="0" align="middle">

  • I think those triangles in the top left and right will be using the sine behavior and the bullets using the bullet movement..

    I guess you could start simple rather than create the whole thing at once.

    Also the path finding will work for zigzagging I believe.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • For most pattern movement you can do an equation.

    Figure 8 for example:

    set x = radius*cos(speed*time)+center_x

    set y = radius/2*sin(2*speed*time)+center_y

    For multiple objects on the same path add a instance variable and call it offset and give it the value from 0-360.

    set x = radius*cos(speed*time+self.offset)+center_x

    set y = radius/2*sin(2*speed*time+self.offset)+center_y

    You can also replicate it with the two sine behaviors as well. One vertical and one horizontal. Just make the vertical period half the period of the horizontal. Most zig zag patterns can be done with one sine behavior and one bullet.

  • Thank for the replies!

    So in the end it's all about formulas than hardcoded positions. I was talking with a friend about this (my friend is a programmer), but i ended up blowing his head off with performance issues.

    I will try your equations R0J0hound thanks for your help with this!

    Playing with combinations of Physics and sine behavior i found that they don't play mean with each other as i expected. I will try to add bullet behavior to the mix. I didn't take it into account for some reason.

    Let me see how it goes!

    Thanks for helping me ;)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)