Blob shadows

Get help using Construct 2

Post » Mon Nov 25, 2013 9:17 pm

I need a simple shadows for characters in my platformer. They need to follow their parent and snap to floor but (of course) never follow them while they jump. Only X-axis movement and occasional Y-axis changes when jumping/dropping on other platforms. I don't really know how to do this without making a horrible wall of commands and triggers.

Any ideas?
B
21
S
7
G
4
Posts: 233
Reputation: 3,474

Post » Mon Nov 25, 2013 9:21 pm

Run a loop to set the shadow to your player's x position and adjust its y position if it is or isn't overlapping a platform. Something like that at least.. haven't done it in a while.MadFactory2013-11-25 21:22:31
Image
B
243
S
30
G
13
Posts: 1,787
Reputation: 18,770

Post » Mon Nov 25, 2013 9:26 pm

My problem is that I don't know how to set its Y correctly. Somehow I need the shadow to instantly "drop" so it feels like it's sliding on surface and warping on higher/lower platforms. I might experiment on the Platformer behavior tomorrow.
B
21
S
7
G
4
Posts: 233
Reputation: 3,474

Post » Mon Nov 25, 2013 9:28 pm

That's what the loop is for.

+Shadow.count > 0
-Run loop "" 5 times or so

+On "" loop
-Set shadow to player.x
++If overlapping solid
--Set shadow.y to shadow.y-1
++If not overlapping solid
--Set shadow.y to shadow.y+1
Image
B
243
S
30
G
13
Posts: 1,787
Reputation: 18,770

Post » Mon Nov 25, 2013 9:58 pm

Ooooh, now that makes sense. I'll try it ASAP. Thanks, buddy!
B
21
S
7
G
4
Posts: 233
Reputation: 3,474

Post » Mon Nov 25, 2013 10:28 pm

Here's an example: platform_shadow.capx (r146)
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,650

Post » Mon Nov 25, 2013 10:45 pm

I keep forgetting about while loops. Yeah, use that instead.
Image
B
243
S
30
G
13
Posts: 1,787
Reputation: 18,770

Post » Thu Oct 09, 2014 6:56 pm

@ ramones

Thanks for the example. I've already replaced my player shadow in the standard levels. Though I am having a problem trying to add this to my gravity based levels. You can see the game in the following link
Game Trailer

it will probably explain better.

I guess my question is how do I compensate for the the constant change in gravity? any ideas would be a great help, thanks
B
58
S
17
G
5
Posts: 184
Reputation: 8,958

Post » Thu Oct 09, 2014 10:35 pm

@MelVin What problem are you having? I tried it with the rotating platformer template just moving the shadow at the gravity angle instead of straight down:
You do not have the required permissions to view the files attached to this post.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,650

Post » Fri Oct 10, 2014 6:03 pm

thanks for the example!

The problem I'm having is the shadow keeps skipping around, and is getting bigger instead of smaller when the gravity is changed. I'm using Gravityzones, A little different then the example but I'll take a look and post back once I change things to line up with your example. Thanks again ramones!
B
58
S
17
G
5
Posts: 184
Reputation: 8,958

Next

Return to How do I....?

Who is online

Users browsing this forum: KTML5 and 25 guests