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?
Develop games in your browser. Powerful, performant & highly capable.
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.
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.
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
Ooooh, now that makes sense. I'll try it ASAP. Thanks, buddy!
Here's an example: platform_shadow.capx (r146)
I keep forgetting about while loops. Yeah, use that instead.
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
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
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:
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!
Made a more efficient version (don't want to loop 100 times every tick):
ramones,
both versions work great! But the latest one seems to be flawless, and it's solved the problems I was having. thanks for putting in the time to optimize and reupload it!! makes a huge difference. Cheers