C
Coleson Frey
Guest
i even used the code from the manual and it doesnt work
/// randomly shoot
can_shoot -= 1;
event_inherited();
xoffset = x + lengthdir_x(5, obj_rotTurret.image_angle)
yoffset = y + lengthdir_y(5, obj_rotTurret.image_angle)
//xoffset = x + cos(image_angle * pi / 180) * 5
//yoffset = y + sin(image_angle * pi / 180) * 5
if (can_shoot = 30) {
image_index = 2;
}
if (can_shoot = 100) {
image_index = 1;
}
if (can_shoot < 1) {
with instance_create(xoffset, yoffset, obj_turret_cannonball); {
direction = obj_rotTurret.pointdir;
speed = 4;
}
instance_create(xoffset, yoffset, obj_effect_explosion);
can_shoot = (irandom_range(120, 200))
image_index = 0;
}
/// randomly shoot
can_shoot -= 1;
event_inherited();
xoffset = x + lengthdir_x(5, obj_rotTurret.image_angle)
yoffset = y + lengthdir_y(5, obj_rotTurret.image_angle)
//xoffset = x + cos(image_angle * pi / 180) * 5
//yoffset = y + sin(image_angle * pi / 180) * 5
if (can_shoot = 30) {
image_index = 2;
}
if (can_shoot = 100) {
image_index = 1;
}
if (can_shoot < 1) {
with instance_create(xoffset, yoffset, obj_turret_cannonball); {
direction = obj_rotTurret.pointdir;
speed = 4;
}
instance_create(xoffset, yoffset, obj_effect_explosion);
can_shoot = (irandom_range(120, 200))
image_index = 0;
}