![[滑稽]](/static/emoticons/u6ed1u7a3d.png)
为啥要检测碰撞体积?
![[滑稽]](/static/emoticons/u6ed1u7a3d.png)
state_idle = function()
{
}
这才是你要的状态机好吧。
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
state_jump = function()
{
control_player(); //按键脚本
velv *= 0.4 ; // 跳跃 y移动速度
if(sprite_index != spr_player_jump && velz <= 0)
{
// 只有不在空中攻击才会跳跃
if(sprite_index != spr_player_jump_punch && sprite_index != spr_player_jump_kick)
{
sprite_index = spr_player_jump;
image_index = 0;
}
}
if(image_index >= image_number - 1)
{
image_index = image_number - 1;
}
if(punch)
{
state = state_jump_punch;
}
if(kick)
{
state = state_jump_kick;
}
applying_gravtiy(grav); // 重力脚本
// 落地下蹲
if(z == 0)
{
state = state_squat;
}
}