性格不会提升

时间:2014-05-04 21:17:21

标签: controller controls character

我已经制作了一个角色控制器,根据闪光灯中找到的样本控制器脚本控制一只飞来飞去的小船,但出于某种原因,角色不会向上移动。

这是4方向脚本。

在有人要求IT DIDN退回任何错误或问题之前。

它不会向上移动。

function fl_MoveInDirectionOfKey(event:Event) 
{
    if(this.y > 10 ) 
    {
        if (upPressed)
        {
            movePlayerUp();
            if(focus==true) 
            {
            this.y -= 5;
            //lasers.y -=5;
            }
            else 
            {
                player.y -= 11;
            }
        }
    }
    if(this.y < 710)
    {
        if (downPressed)
        {
            movePlayerDown();
            if(focus==true)
            {
                this.y +=5;
            }
            else
            {
                this.y +=11;
            }
        }
    }
    if(this.x > 5)
    {
        if(leftPressed)
        {
            movePlayerReverse();
            if(focus==true)
            {
                this.x -=5;
            }
            else
            {
                this.x -=11;
            }
        }
    }
    if(this.x < 900)
    {
        if(rightPressed)
        {
            movePlayerForward();
            if(focus==true)
            {
                this.x +=5;
            }
            else
            {
                this.x +=11;
            }
        }
    }
}

1 个答案:

答案 0 :(得分:0)

您确定该功能是否被调用?脚本是否附在船上?

添加一些跟踪语句,然后查看代码的哪些部分:

trace("we got here");