Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Using a 'flashlight' effect, effectively?

Rare

Member

I'm trying to incorporate the 'flashlight' effect into my game.  I would assume you need a picture that has a "triangle-like" beam of light highlighted, and the rest of the picture would be a darker shade.  I have this, but I'm having a problem making the picture move when the character moves, and have it directly lined up with the sprites flashlight.  Also, when the picture is displayed on the map, it seems to move with the screen and not the player.

Any suggestions to how I could make this work (using events specifically)?  :)

Thanks a ton!
 
Since a 'picture' is located relative to the screen, not the map, it should stay relative to the player in the middle of a larger map.  So, if you make a 'buffer' zone around your map (10 tiles in the X direction, 8 tiles in Y) where the character can't walk, the character will always be in the center of the screen, and the the picture will 'follow' the character.
The tough bit, without a little scripting, will be to get the light to rotate everytime the character changes direction. Perhaps a parallel event that checks the character's facing, and replaces the picture when it changes?

Be Well
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top