chefdez
Member
Hello there,
I have an enemy object that spawns a target on itself when the player right clicks in a slow motion state.
oPlayer:
oTarget:
My main goal is to have my player object "dash" towards these targeted points 1 by 1, with an alarm separating the dashes. For example:
I have an enemy object that spawns a target on itself when the player right clicks in a slow motion state.
oPlayer:
Code:
with(oEnemy)
{
if distance_to_point(mouse_x, mouse_y)<20
{
new_target_id = instance_create(x, y, oTarget);
new_target_id.EnemyTargeted = id; }
Code:
if (EnemyTargeted > -4 ) //if enemy object has detected mouse near to enemy,has created this target object, and has told this object the instance id of the enemy to follow
{
x = EnemyTargeted.x //match the target position to the enemy instance position x
y = EnemyTargeted.y //match the target position to the enemy instance position y
}
- Player enters slow motion state and a count down occurs.
- Player right clicks enemy within a specific distance
- Enemy creates a target on itself, and stores its own location.
- When the count down is over, the player object will be forced to that position, one by one if multiple enemies are targeted.