Dynamic shadow

Okay, so I keep bumping in to challenges with my litte game.

On the scene there is now a movieclip that is now being rotated around. This movieclip is shaped like a rectangle. And at the bottom of the screen is a shadow (also a movieclip) that moves left and right, always staying aligned to the rectangle shaped movieclip.

This is pretty easy just by keeping both their xspeeds the same.

But the shadow’s width should also vary depending on the rectangle’s angle/rotation, being the shortest when the rectangle movieclip i standing upright. Can I get the value of the rectangle’s angle and adjust the shadow’s width accordingly, or what would be the best take on this?

Try working with the dropshadow filter and make it best to your use…

I would, but it doesn’t quite cut it for this project.

Thing is, there will be an object/movieclip floating around the scene, like an object without gravitation. Just putting on a dropshadow would look… not very realistic. The shadow should stay at the bottom of the screen, only moving horisontally, creating the illusion that it is being cast on a floor at the bottom of the scene.

well you will have to adjust its size according to what height the MC is at and take acount of rotation :stuck_out_tongue:

Ah, silly me, I figured it out and it wasn’t all that complicated.

I’m not taking into account the xheight of the rectangle movieclip, but I’m not gonna bother as it isn’t that visible.

[COLOR=Blue] if(this._x>_root.boks._x) //if the shadow is to the right of movieclip “boks”
{
this._x+=this.xspeed;
this._width=_root.boks._width+50;
}[/COLOR]