Segmented Boss (That Guy Over There Example Converted)

Get help using Construct 2

Post » Sun Jan 08, 2017 3:35 am

Despite the fact that Construct 2 is a far more intuitive program than Clickteam Fusion (or whatever other version name you care to refer to it by), there are a lot of examples out there created in the latter that are quite useful. One type of example is that of the 'segmented enemy'. You know, a base, a head and a bunch of instances of the same sprite that act as segments, which move somewhat in unison with each other. I noticed that there isn't exactly a proliferation of these examples for Construct 2, so I decided to convert one over.

If any of you have used Fusion then you'll have no doubt come across 'That Guy Over there 123' on Youtube. The link below is to a Capx displaying his segmented boss example. It's not the full example in that it doesn't include a player or the following thereof, but it does contain the most important (and complex) bit, which is the segments lining up with the boss base and head and the sin and cos equations for the movement of the head. I think it's pretty sweet and very expandable so I figured I would do something out of character (i.e. nice) and would share it with you all. In the spirit of said niceness, if any of you come up with some kool ways to expand upon this, please share them on this post so we (and I very much include myself in this) can all benefit.


https://www.dropbox.com/s/8ytigx3s0tt559r/Segment_Boss_Mine.capx?dl=0
B
25
S
14
G
3
Posts: 12
Reputation: 3,781

Post » Fri Nov 24, 2017 9:59 pm

Hi there @jlennon38, thank you for posting this but unfortunately i can't access it. Could you possibly make it available again?

Many thanks!
B
13
S
3
Posts: 62
Reputation: 901

Post » Tue Dec 05, 2017 10:30 am

Hi mate. I actually managed to lose the example myself, which is irritating because I took some time re-creating it in Construct 2 from Clickteam Fusion's antiquated nastiness. I am going to create it again when I get a spare moment, so hold that thought. I will re-post when done. Hopefully I can get to it this week or next.
B
25
S
14
G
3
Posts: 12
Reputation: 3,781

Post » Tue Dec 05, 2017 11:21 am

Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
17
S
9
G
100
Posts: 1,427
Reputation: 53,921

Post » Tue Dec 05, 2017 5:27 pm

Found the video. Looks way more complicated than it needs to be.

If you have sprites: head, base an multiple body

Then a event like the following should do it. You can use the sine behavior instead for moving the head if you like.

every tick:
--- head: set x to 320 + 100*sin(200*time)
--- head: set y to 100 + 50*sin(500*time)
--- body: set x to lerp(base.x, head.x, (self.iid+1)/(body.count+2)
--- body: set y to lerp(base.y, head.y, (self.iid+1)/(body.count+2)


You could use a instance variable instead of iid if you want to have multiple heads but for one this is fine. For a more interesting effect you could use qarp instead of lerp to give a curve. The middle parameter could be the position of an invisible sprite that's moving around with sine much like the head.
B
94
S
33
G
122
Posts: 5,443
Reputation: 77,949

Post » Tue Dec 05, 2017 10:17 pm

Wow the legend that is R0J0hound commenting on little old me's post. Awesome. Thanks for your input and for everything you've contributed to the community over the years.
B
25
S
14
G
3
Posts: 12
Reputation: 3,781


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 44 guests