0 Favourites

platform shadows

This forum is currently in read-only mode.
  • I'm trying to come up with a good solution for a shadow effect I want in a platform game and I need help brainstorming the best way to accomplish it. I want the shadow to follow the player's x position but to always appear on the platform directly underneath the player (even if the platform if off the screen in the case of long falls).

    This image sort of demonstrates what I'm looking for:

    <img src="http://i.imgur.com/EoAMh.png" border="0" />

    My first reaction is to use loops and a sprite that can start at the player and move down looking for collisions. I feel that might be somewhat CPU intensive just for a shadow effect. That's why I'm looking for other opinions.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • I used such a technique for an object to always face towards a correct angle for slopes and such. If you optimize it depending on the size of the platform objects (wider stepping etc.), it doesn't affect the cpu very much.

    Another way could be to always detect the platform object at player.x and set shadow.y to platform.top (very rudimentary, just to tell the basic approach)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)