L
lilthrailer
Guest
So I have this code in step:
------------------------------------------
event_inherited();
while(hp obj_bandit > 0){
phy_position_x += sign (obj_player.x - x) * brother_speed;
phy_position_y += sign (obj_player.y - y) * brother_speed;
}
while(hp obj_bandit_red > 0){
phy_position_x += sign (obj_player.x - x) * brother_speed;
phy_position_y += sign (obj_player.y - y) * brother_speed;
}
if(hp obj_bandit_red < 0){
brother_speed = 4
}
if(hp obj_bandit < 0){
brother_speed = 4
}
while(instance_exists(obj_player)){
phy_position_x += sign (obj_player.x - x) * brother_speed;
phy_position_y += sign (obj_player.y - y) * brother_speed;
}
if(keyboard_check_pressed(ord("E"))){
var damage_oth = instance_create_depth(x - 40, y -20, 0, obj_damage);
damage_oth.creator = id;
}
------------------------------------------
this is what I have in create:
------------------------------------------
event_inherited();
hp = 5;
player_speed = 4;
brother_speed = 0;
image_speed = 0;
depth = -10;
------------------------------------------
this is the error that I get:
------------------------------------------
Object: obj_brother Event: Step at line 6 : malformed while statement
Object: obj_brother Event: Step at line 6 : got 'obj_bandit' expected ')'
Object: obj_brother Event: Step at line 6 : unexpected symbol ">" in expression
Object: obj_brother Event: Step at line 6 : malformed assignment
------------------------------------------
What's the problem?
------------------------------------------
event_inherited();
while(hp obj_bandit > 0){
phy_position_x += sign (obj_player.x - x) * brother_speed;
phy_position_y += sign (obj_player.y - y) * brother_speed;
}
while(hp obj_bandit_red > 0){
phy_position_x += sign (obj_player.x - x) * brother_speed;
phy_position_y += sign (obj_player.y - y) * brother_speed;
}
if(hp obj_bandit_red < 0){
brother_speed = 4
}
if(hp obj_bandit < 0){
brother_speed = 4
}
while(instance_exists(obj_player)){
phy_position_x += sign (obj_player.x - x) * brother_speed;
phy_position_y += sign (obj_player.y - y) * brother_speed;
}
if(keyboard_check_pressed(ord("E"))){
var damage_oth = instance_create_depth(x - 40, y -20, 0, obj_damage);
damage_oth.creator = id;
}
------------------------------------------
this is what I have in create:
------------------------------------------
event_inherited();
hp = 5;
player_speed = 4;
brother_speed = 0;
image_speed = 0;
depth = -10;
------------------------------------------
this is the error that I get:
------------------------------------------
Object: obj_brother Event: Step at line 6 : malformed while statement
Object: obj_brother Event: Step at line 6 : got 'obj_bandit' expected ')'
Object: obj_brother Event: Step at line 6 : unexpected symbol ">" in expression
Object: obj_brother Event: Step at line 6 : malformed assignment
------------------------------------------
What's the problem?