I Wanna Community

Fangames => Game Design => Programming Questions => Topic started by: Skuttie on November 01, 2015, 12:00:09 AM

Title: Changing the kids sprite on room warp
Post by: Skuttie on November 01, 2015, 12:00:09 AM
So how do I permanently change the Kids sprite on room change? Say for 10 rooms I want him pink and then the next ten I want him blue, how do I go about that?
Title: Re: Changing the kids sprite on room warp
Post by: Keygrin on November 01, 2015, 12:58:00 AM
What I would do is use a global variable that determines what sprites the character uses. Let's call it global.kid_color. Have the Player execute this code after using the warp that causes him to change color. An excerpt of how my crappy fangame in progress is coded:

Code: [Select]
if global.kid_color=0
{
s_idle=thekid_idle
s_walk=thekid_walk
s_jump=thekid_jump
s_fall=thekid_fall
}
if global.kid_color=1
{
s_idle=thekidpink_idle
s_walk=thekidpink_walk
s_jump=thekidpink_jump
s_fall=thekidpink_fall
}

sprite_index=s_idle
Title: Re: Changing the kids sprite on room warp
Post by: Skuttie on November 01, 2015, 10:21:15 AM
Looks good, thanks!