Blargh Wrote:Cool! I'm starting to get my head back in the game, but I'm not all there yet. >_>
Its done!
(topic with SWF for you to see)
viewtopic.php?f=7&t=2265 (the FLA - updated 1.13b)
https://rapidshare.com/files/1279289310 ... _1.13b.rarGo to level 2, then take the frog suit and descend to the ground (or go outside of the water).
I'll be showing the code below (the right areas to change).
I can also apply the code directly into your code (but I think you should do that without too much hassle. 1- take my FLA - 2-copy/pasta the four peach states in char.character (standfrogleft, standfrogright, walkfrogleft, walkfrogright) - standfrog has only 1 animation (steady state) and walkfrog, 16 animation frames. The others are mirrors. 3- dont overwrite anything, just paste - 4- fix something , 5- include code to peach on object in all levels (you know, have to replicate to all peaches).
The code to be added to Peach on object (when pressing RIGHT) :
Spoiler (click to show/hide):
Below, (!_root.frog_movement) in the first else is the normal peach walking speed. I preferred to use this logic.
Also, you can disable ' _root.underwater ' and any IF logic with it, in case you dont want to let her walk slower if shes touching ground in the water.
- Code: Select All Code
//WALKING and STANDING
if (Key.isDown(_root.keyRIGHT) or Key.isDown(_root.keyD))
{
if (!_root.frog_movement and _root.underwater and _root.touchingGround)
setProperty("", _x, _x + 3); //walk slow underwater
else if (_root.frog_walking and _root.touchingGround)
{
//jumping_for_collision=true;
setProperty("", _x, _x + 10);
}
else
setProperty("", _x, _x + _root.char.charspeed);
peach_right = true;
if (_root.underwater and !_root.touchingGround)
_root.char.gotoAndStop("swimright");
else if (_root.frog_movement and _root.touchingGround)
{
_root.char.character.gotoAndStop("walkfrogright");
_root.char.grav = -10;
}
else if (!_root.frog_movement)
_root.char.character.gotoAndStop("walkright");
}
else if (peach_right)
{
if (!_root.frog_movement and _root.underwater and !_root.touchingGround)
_root.char.gotoAndStop("swimright");
else if (_root.frog_movement && _root.touchingGround)
_root.char.character.gotoAndStop("standfrogright");
else if (_root.frog_movement)
_root.char.character.gotoAndStop("frogswimstandright");
else
_root.char.character.gotoAndStop("standright");
} // end else if
}
Now, code while pressing LEFT:
Spoiler (click to show/hide):
- Code: Select All Code
if (Key.isDown(_root.keyLEFT) or Key.isDown(_root.keyA))
{
if (!_root.frog_movement and _root.underwater and _root.touchingGround)
setProperty("", _x, _x - 3); //walk slow underwater
else if (_root.frog_walking and _root.touchingGround)
{
//jumping_for_collision=true;
setProperty("", _x, _x - 10);
}
else
setProperty("", _x, _x - _root.char.charspeed);
peach_right = false;
if (_root.underwater and !_root.touchingGround)
_root.char.gotoAndStop("swimleft");
else if (_root.frog_movement and _root.touchingGround)
{
_root.char.character.gotoAndStop("walkfrogleft");
_root.char.grav = -10;
}
else if (!_root.frog_movement)
_root.char.character.gotoAndStop("walkleft");
}
else if (!peach_right)
{
if (!_root.frog_movement and _root.underwater and !_root.touchingGround)
_root.char.gotoAndStop("swimleft");
else if (_root.frog_movement and _root.touchingGround)
_root.char.character.gotoAndStop("standfrogleft");
else if (_root.frog_movement)
_root.char.character.gotoAndStop("frogswimstandleft");
else
_root.char.character.gotoAndStop("standleft");
} // end else if
I hope no '{' or '}' was missed out. The logics are simple, and I tried to organize it while in this message.
If you see with attention above, added code are almost all those with (_root.frog_movement) and (_root.frog_walking) in the IFs.
Frog_movement activates the new animations.
Frog_walking is a flag INSIDE char.character.walkfrogright (and left, as it copies what you change in walkfrogright, and vice versa).
Frog_walking gets TRUE between frame 5 to 13.
You ask, why? Well, thats because a frog walk moves only if she's make those little jumps. So she moves to right/left only in those 5-13 frames.
Now, change the powerups to activate _root.frog_movement just in the frog power, and disable it in other powerups:
Spoiler (click to show/hide):
E.g: enabling in Frog (label 'grab')
- Code: Select All Code
if (_root.LockCostume == false)
{
_root.DressNum = _root.Dress[5];
_root.CharNum = _root.DressChar[5];
_root.NoBoob = false;
_root.frog_movement=true;
}
Finally, you have to disable it if Peach are hit and costumes are changed.
(You may have a better idea where to place _root.frog_movement.
If some errors appears (like frog sound keep playing while in goomba scenes), thats because it should be stopped when Peach hits the goomba
(in goomba on-object, those areas with 'squish' for example, go into squish code and put where goomba notices:
_root.char.character.walkfrogright.gotoAndStop(1);
_root.char.character.walkfrogleft.gotoAndStop(1);
Notice that I'm using gotoAndStop in the peach animation instance inside each walkfrog frame, that is, you have to instance them, clicking on them.
I created a special function to deal with that. Peach backside was also having problems like that (when Peach is in backside mode and goomba gets her, backside finishes (end frame) and, magically, the _root movement becames true, so you imagine the mess!
So I've put _root.char.character.backside.gotoAndStop(1) too. All nice and clean! So, if Peach goes backside or frog left/right after sex scenes, for example, these animations will start playing normally even if peach on-object keeps using _root.char.character.gotoAndStop("walkfrogleft"), for example, because this 'gotoAndStop' WILL replay that stopped inside movie from the start.
You can also let her animation better in your version if you wish. You surely are better in this area : )
Dont forget, the frog sound is into my FLA (its being used inside the char.character.walkfrogright. You know, walkfrogleft are just a mirror of it). If you copy/pasta it, and sound doesnt go with (because of course you will not replace peach in order not to lose your costumes), just search for it in my library and paste to your FLA (the name is 'frog', a wav file). And include it inside char.character.walkfrogright (or left), like in FRAME 2.
Done