[Solved] RPG Games and the Overlapping issues

Get help using Construct 2

Post » Fri Jul 06, 2012 12:17 am

If you don't want to use a third party plugin, for each ordered is the method to use. The plugin I linked to might be faster, though.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Fri Jul 06, 2012 1:31 am

[QUOTE=Arima] If you don't want to use a third party plugin, for each ordered is the method to use. The plugin I linked to might be faster, though.[/QUOTE]

Aside from the ability to not publish to the Scirra arcade, are there any other downfalls to 3rd party plugin use?

I have to use SpriteFont right now, so does that mean I might as well use all plugins I feel are needed since I am already using one?
B
9
Posts: 59
Reputation: 997

Post » Fri Jul 06, 2012 3:09 am

There's a chance some plugins might not be 100% compatible with appmobi or cocoonJS (unsupported features and such - I've checked that the one I linked to works with cocoonJS so I don't think that's the case for that that plugin with appmobi though), but aside from that and no uploading to the scirra arcade, no downsides to them.Arima2012-07-06 03:10:21
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Thu Sep 06, 2012 8:10 pm

I always come here to check if the post still alive ^^

A plus need to be added here:

If you have enemies overlapping each other, you'll need to check their own.Y and use the solution of sorting them behind each other.

I was thinking in make an instance variable and call it by Z, them, check their.Y and sort on the canvas. You can also check if the object is displayed on the canvas, saving CPU ^^
ImageImageImageImageImageImage
B
93
S
20
G
14
Posts: 1,218
Reputation: 19,500

Post » Fri Oct 05, 2012 7:46 am

Objects can belong to multiple families at once. I just plug all the sprites I want to z sort into an additional family called "Zsort" and then do the "For Each (Ordered)" method. Works like a charm.
B
58
S
20
G
7
Posts: 305
Reputation: 8,804

Post » Mon Dec 31, 2012 6:03 pm

Sorry to bring this up but for someone new like me this helped a lot and I wanted to help a little more: If you change "on collision with N" with "is overlapping N" you don't have the overlapping problem that happens if the player gets stuck to the structure walking from top to bot.
B
9
S
5
G
4
Posts: 5
Reputation: 2,716

Post » Mon Dec 31, 2012 6:12 pm

Currently I have two layers for game actors. All other art is drawn between those two layers. The collision mask for each piece of art is what would trigger the character to fall behind the art(top half) the actor collision mask is at the feet. So if the actor walks on the lower half of the sprite it goes to the top actor layer. If its touching the top halftime moves to the bottom actor layer. Seems to work great so far.
B
69
S
21
G
15
Posts: 701
Reputation: 15,629

Post » Sat Jan 12, 2013 7:37 pm

[QUOTE=TL22] Objects can belong to multiple families at once. I just plug all the sprites I want to z sort into an additional family called "Zsort" and then do the "For Each (Ordered)" method. Works like a charm.[/QUOTE]

Works so great! This must be in the manual like example.
B
11
S
2
Posts: 21
Reputation: 1,171

Post » Thu Feb 14, 2013 8:12 pm

[QUOTE=TELLES0808]
If you have enemies overlapping each other, you'll need to check their own.Y and use the solution of sorting them behind each other.
[/QUOTE]

Has anyone figured this out with using the families idea (which is brilliant, by the way)?
B
22
S
3
Posts: 451
Reputation: 2,135

Post » Thu Feb 14, 2013 8:46 pm

Nevermind - I missed the For Each (Ordered) and was doing just For Each.

But just for people who are unfamiliar with Construct 2, I figured I'd at least post the exact code:

System Event (For Each (ordered) <yourspritename> Order by <yourspritename>.Y, descending.
Sprite Event (compare Y) if Sprite.Y < Player.Y
Sprite Event Is on Screen

Action Sprite Event Move to top layer

Hope that helps anyone else that was confused.

Steve
B
22
S
3
Posts: 451
Reputation: 2,135

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: Lof, YoHoho and 20 guests