Decided to have a fully animated, 8-direction moving character

Started by KyriakosCH, Mon 03/10/2016 16:37:28

Previous topic - Next topic

VampireWombat

#100
Quote from: KyriakosCH on Thu 20/10/2016 17:27:24
^ Awesome :)

But how would one use this as a background?... Too many frames, no?
It looks like it can be done entirely by making 2 different images with the different light levels. Create an object and set clickable to off. Then create a view and use the images. Set the object to the view and then animate the object. Playing with the object animate function and the frames in the view should be able to get you the desired effect.
Adding the 2 images into the view more times can make the blinking more erratic. Like 1,2,1,2,2,1,2,1,2,1,1.

This is the script I used for testing.

function room_AfterFadeIn()
{
oBlink.SetView (3);
oBlink.Animate (0,  13,  eRepeat,  eNoBlock);
}


The two images I used in my test.
When importing make sure to use the alpha channel and change transparent color to as is.
Spoiler


[close]

Snarky

I would script the flickering as a random event (i.e. generate a random number each game loop in repeatedly_execute_always(), and show the dark version if the number is above or below some threshold).

This is also a case where it makes sense to use multiple background frames instead of a full-screen object. Just make one frame the light version and the other frame the dark one, and then stop background from cycling automatically by calling SetBackgroundFrame(0) in the enter room function.

This is getting into coding advice, though.

VampireWombat

I tried this method because it seemed the simplest and most direct method I could think of for the desired effect. Using it as an object that covers the room instead of a background means that the lighting changes affects the character and other objects added after it.
But yes, it does get into coding advice.

SMF spam blocked by CleanTalk