Blargh Wrote:Actually, once I get out of the starting bit, it starts working. Around Peach's bed, though, for some reason she crouches and raises her arms first, and then thrusts her hands down which is when she actually jumps. Curious that it's only that area. Maybe something to do with the ceiling code?
Yes! Thats because of ceiling code. I've tried to get rid of this little problem. What occurs actually:
1 - When Peach is confined in areas with low height and ceiling code above, the first jump respects ceiling code.
2 - if you keep pressing JUMP button, she will do the jump again, as soon as she touches the ground.
3 - for some reason, the second jump may ignore the ceiling code. It doesnt occur all the time.
4 - if you jump, then release the jump button, then jumps again, Peach respects ceiling code.
In her on-object code, when you press JUMP, 'jumping for collision' becames active.
- Code: Select All Code
if (jumping_for_collision) //if jumping for collision was set (local volatile variable created when she starts jumping)
{
// SHE WILL ENTER HERE WHEN JUMPING ONLY. IT WILL COLLIDE WITH CEILING
_root.char.grav=-3; //set the initial 'small jump' to displace her from ground
setProperty("", _y, _y + grav); //she will jump a bit just to displace her from floor
//grav is negative because going UP is going against positive Y in its axis
//as graphic games starts X,Y in the TOP LEFT corner
for (up=0; up<-maxJump-3; up++)
{
if (ceiling_collision.hitTest(_x-_width/2, _y-(_height), true))
{
break; //SHE is HIT in the head!
}
else
{
setProperty("", _y, _y - 1); //if not hit, she can keep going up until her max jumping height (maxjump)
_root.char.grav--; //her grav is decreasing (-4, -5, -6, until she collides with something above)
}
}
Maybe the jumping for collision is being set 'false' between jumps, but the code below activates it right after pressing JUMP button.
- Code: Select All Code
if (Key.isDown(_root.keyCONTROL) and !_root.flying_mode)
{
if (_root.can_touch_ground and (_root.touchingGround or _root.climbing))
{
jumping_for_collision=true; // to be used in the ceiling collision code above.
_root.char.grav = maxjump;
if(peach_right)
{
this(gotoAndPlay("jumpright"));
}
else
{
this(gotoAndPlay("jumpleft"));
}
}
} // if press UP key
I'll delve into my code when I have more time.
Blargh Wrote:I had other issues with pressing and holding control to jump and then pressing 'd' to go right. The bookmarking window comes up.
Not here. Thats because of the browser settings :/ CONTROL may not be the right button for jump, thats why some are requesting to be 'C'. (just like emulators config, as GENS and ZNES).