I'm a visual person so here is a reference image that I will refer to below.
My goal is to have these animations defined when I define the character and not each time I use it in the script.
To keep things efficient using small images for the eyes and mouth would be best (like in my image above). But this means that they have to be positioned over the character image. Since each character image will be a different size and in a different location the smaller animated images will need to reference where the character is. This position information would have to be setup with the character definition.
It would be nice if the mouth animation only played during the same time as the text for that character is being "typed" on the screen.
So this is what I'm thinking:
Code: Select all
#CHARACTER
#Mii
image mii happy = ("characters/mii/happy.png", "characters/mii/mouth.png", 20, 50, 20, 120, .1, "characters/mii/eyes.png", 20, 50, 20, 120, .1, 5)
image [name] [mood] = ("[base file name]", "[mouth file name]", [posx], [posy], [framex], [framey], [delay], "[eye file name]", [posx], [posy], [framex], [framey], [delay], [eye open delay - frame 1])
This would be used the same way it is now but with the eyes automatically looping all the time and the mouth only showing (and animating)when the text for that character is being typed on screen. It would have to know that using the character name call with text will tell it to animate the mouth. The framex and framex is what one frame (x3 in the example) is in the file so it knows where to show one frame from the file for the animation loop. The posx/y is in reference to the base character image. Delay is how much time between each frame.
The other thing to consider is what do to when the character moves. I think the easiest is to turn off the animations and hide the animated files during the transition and then have them re-evaluate the character position when it is done and continue etc.
SO I have no idea how this can be done or if it can. Either way anyone have some input?
I looked at lipflap which is close but a little bit more complex then I was hoping as you have to define the animation during each use and it has a delay for each frame/file. If I was a coding master I could probably work with that as my base for this idea. sigh...
(Disclaimer: I didn't draw that character, it is from a copyrighted games. This is just for a reference.)