this looks about right, thank you! so if i want to call ai/sue etc. how would i do that?
right now i'm using this:
Well, it depends on how you have your character art set up. If you just have single images for each character, then the way I showed it would call those image up depending on whether the "character variable" is set to Ai or Sue, right?
You can do anything that works for you in there though. If "ai smile" is your character sprite for Ai, then you could instead put:
Code: Select all
"if CharacterVariable == 'ai'", "ai smile",
. . .where I had that if statement, and it would reference that image. You can put any valid image into that slot of the code. You can also mess with the front half, so if you wanted it to change based on her emotions, you could do something like
Code: Select all
"if CharacterVariable == 'ai' and Emotion == 'happy'", "ai smile",
"if CharacterVariable == 'ai' and Emotion == 'sad'", "ai frown",
. . .to call a second image. Keep in mind that CharacterVariable and Emotion are just made up variable names, you can use any variables you want.
In my game, I use a LiveComposite to make the main character, and then I use a frame like the one above to do a similar function to what you're working with I can just put the character sprite's name in, and since her emotions are changed on the Live Composite version, I don't need to fiddle with that in the contain version.
but anyways, like Philat said, once you've established that set-up, "Phone" (which is again just my name for it, use any name that you like) would become an image object just like any other, and you can move it around, fade it in any out, do anything to it that you can do to any object, but it would automatically cause those same things to happen to the backplate, top plate, and interior images you established all at once, as if you've glued them all together.
If you change the variables while the phone is visible, like changing "ai" to "sue," then sue will instantly replace AI on the phone.
One other trick you can do, is you can white something like this:
Code: Select all
image aidancing:
"ai smile"
ease 0.5 xpos -10
pause 0.25
easeout 0.5 xpos 10
repeat
and then in that phone container we were working with before, put a line like
Code: Select all
"if CharacterVariable == 'ai' and Emotion == 'dancing'", "aidancing",
and it would cause Ai to start moving around inside the phone, using numbers that reference the phone's location, so like it doesn't matter where you put the phone on the screen, if you cause the charter to wiggle a little, they would wiggle relative to their default position inside the phone. You could use any sort of transforms in there that you like.