Fangames > Programming Questions

Apply Spray Code

(1/1)

Kyir:
Could anyone outline the kind of code that's used for the attacks in avoidance fights where apples are sprayed in a general direction but with RNG? I'd appreciate it a lot.

pieceofcheese87:
creation code of apple:

--- Quote ---direction=point_direction(player.x,player.y)+random_range(-50,50) //or whatever you want the range to be
--- End quote ---
and since it needs to move,

--- Quote ---speed= //speed
--- End quote ---

Kyir:
Thanks.

Navigation

[0] Message Index

Go to full version