- 注册时间
- 2009-7-22
- 最后登录
- 2009-7-23
②入门
- 积分
- 32
|
发表于 2009-7-23 15:37:02
|
显示全部楼层
查Gamestudio Manual手册
范例
function handle_movement()
{
IF (my.state_machine == state_death) { my.enable_scan = off; my.passable = on; my.entity_type = null; return; }
handle_target();
IF (player == my) { handle_player_input(); } ELSE { handle_ai_input(); }
my.attack_delay = move_variable(my.attack_delay,0,1);
IF (my.push_x != 0 || my.push_y != 0) && (my.velocity_x == 0 && my.velocity_y == 0)
{
my.velocity_x += my.push_x;
my.velocity_y += my.push_y;
}
process_state_machines();
process_animation();
process_movement();
handle_healthbar();
IF (player == my) { handle_camera(); }
} |
|