Create dynamic "shadow" effect for a platformer

Discussion in 'Programming' started by Jacob Thrasher, Jun 20, 2019.

  1. Jacob Thrasher

    Jacob Thrasher Member

    Apr 24, 2019

    I am working on an bird enemy for my platformer. The way I would like it to attack is as follows:

    The bird will be above the player's screen view, and casting a shadow on the ground. Once the player lands on that shadow the bird will follow him/her around for a couple seconds before swooping down onto the final position of the shadow. I am having trouble determining the best way to go about making a shadow that will morph around the wall objects (like a shadow would).

    I played around with creating an entire sprite for the shadow, but I found that that was not convincing because then parts of the shadow would be able to hang off of the ledge, which I obviously do not want.

    What would you recommend I do for a situation like this?
  2. 2Dcube

    2Dcube Member

    Jun 23, 2016
    You can draw part of a sprite with draw_sprite_part().
    So what I would recommend is:
    Find out which ground object(s) the shadow should be displayed on. Could be just one, in which case you draw the entire sprite.
    If it's 2 ground objects, draw the shadow in 2 parts, one on each object.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice