Flashlight Effect?

By Pineapple

Resident (41)

Pineapple's picture

13-11-2022, 03:13

Hey, I was wondering if anyone could explain how the "flashlight" effect in Sacred Valley works?
I'm assuming it has something to do with sprites and background color 0, or possibly AND/OR-ing the sprite and BG color?

Also, is it possible to do this in BASIC?
Thanks.

Login or register to post comments

By aoineko

Paladin (809)

aoineko's picture

13-11-2022, 10:10

I don't know how it is done in Sacred Valley, but the easiest way I see is to change the border/backdrop color to white (VDP register #7) and to disable the display (bit #6 of register #1).
Your screen will turn fully white.
This way, after the flash, you can come back to your game display without having to change the VRAM content (you just have to put back your background color and re-enable the display).

I don't know much about BASIC but the VDP() function should make this easy.

By Pineapple

Resident (41)

Pineapple's picture

13-11-2022, 23:23

Thanks, but I didn't mean screen flash.

I want to know how the circle highlight effect is done in the title screen of This game.

By gdx

Enlighted (6005)

gdx's picture

14-11-2022, 01:08

Nice effet!

I think the yellow part are sprites redefined every frame depending on the color of the foreground.

By aoineko

Paladin (809)

aoineko's picture

14-11-2022, 09:25

Yes, I confirm that it is a sprite redefined each frame. If the calculations are done in real time, it may be quite resource intensive but it's not a problem for a title page.

There is also a very clever flickering of the sprite color (color 10 and 11) to give the impression that the light is "unstable".

By theNestruo

Champion (398)

theNestruo's picture

14-11-2022, 14:04

Pineapple wrote:

I want to know how the circle highlight effect is done in the title screen of This game.

aoineko wrote:

Yes, I confirm that it is a sprite redefined each frame.

Hi, Pineapple: if you use the debug modes of WebMSX (Alt+D) you'll get a live demo of aoineko explanation :)

aoineko wrote:

If the calculations are done in real time, it may be quite resource intensive but it's not a problem for a title page.

That would make an interesting "making of" article! I hope VisualEdu reads this, because I love "making of" articles! ^_^