- 85
- Posts
- 7
- Years
- Seen Nov 24, 2023
My game is made with Version 17.2. I'm trying to change "Def pbchangepokemon" so that, when a pokemon changes form, a white screen appears (like when you throw a pokeball) and fades away after the pokemon has changed sprites.
Here's how I changed the code by using .movetone, but all it does is only change the color of the pokemon transforming and it also messes up its sprite position.
Can anyone help me make this code work properly? ($game_screen.start_tone_change does not work, either)
Here's how I changed the code by using .movetone, but all it does is only change the color of the pokemon transforming and it also messes up its sprite position.
Code:
def pbChangePokemon(attacker,pokemon)
spritePoke=@sprites["pokemon#{attacker.index}"]
picturePoke=PictureEx.new(spritePoke.z)
picturePoke.moveTone(6,1,Tone.new(255,255,255,0))
pbWait(6)
pkmn=@sprites["pokemon#{attacker.index}"]
shadow=@sprites["shadow#{attacker.index}"]
[email protected]?(attacker.index)
pkmn.setPokemonBitmap(pokemon,back)
pkmn.x=-pkmn.bitmap.width/2
pkmn.y=adjustBattleSpriteY(pkmn,pokemon.species,attacker.index)
if @battle.doublebattle
case attacker.index
when 0
pkmn.x+=PokeBattle_SceneConstants::PLAYERBATTLERD1_X
pkmn.y+=PokeBattle_SceneConstants::PLAYERBATTLERD1_Y
when 1
pkmn.x+=PokeBattle_SceneConstants::FOEBATTLERD1_X
pkmn.y+=PokeBattle_SceneConstants::FOEBATTLERD1_Y
when 2
pkmn.x+=PokeBattle_SceneConstants::PLAYERBATTLERD2_X
pkmn.y+=PokeBattle_SceneConstants::PLAYERBATTLERD2_Y
when 3
pkmn.x+=PokeBattle_SceneConstants::FOEBATTLERD2_X
pkmn.y+=PokeBattle_SceneConstants::FOEBATTLERD2_Y
end
else
pkmn.x+=PokeBattle_SceneConstants::PLAYERBATTLER_X if attacker.index==0
pkmn.y+=PokeBattle_SceneConstants::PLAYERBATTLER_Y if attacker.index==0
pkmn.x+=PokeBattle_SceneConstants::FOEBATTLER_X if attacker.index==1
pkmn.y+=PokeBattle_SceneConstants::FOEBATTLER_Y if attacker.index==1
end
if shadow && !back
shadow.visible=showShadow?(pokemon.species)
end
picturePoke.moveTone(0,picturePoke.totalDuration,Tone.new(0,0,0,0))
loop do
picturePoke.update
setPictureSprite(spritePoke,picturePoke)
pbGraphicsUpdate
pbInputUpdate
pbFrameUpdate
break if !picturePoke.running?
end
end
Can anyone help me make this code work properly? ($game_screen.start_tone_change does not work, either)