Whats the easiest way to make and enemy shot at a player but at a variable y coordinate so the enemy doesn't just shoot accurately at the same spot each time, was trying to do something like ths shoot relative to x player and y player(+rand 10 - rand 10) but i cannot find an advanced window for y coordinate
there may be an easier way. But i have made the bullet move a random of 70 pixels up and down by adding a random(70) to variable a and subtracting a random(70)from that then using a second variable to lock the first variable so the event doesn't keep applying an new variable. it then runs a fast loop that moves the bullet up or down (positive or negative) and and sets "A" back to zero by subtracting or adding 1 from "A"
I guess that's one way of doing it, but not the way I'd choose.
I'd use a standard 360 degree movement for the bullet (using Sin & Cos).
Calculate the angle from the enemy to the player, using ATan2.
Add a random amount to the angle before shooting.