I Wanna Community

Fangames => Game Design => Programming Questions => Topic started by: Kyir on June 02, 2014, 10:37:36 AM

Title: Apply Spray Code
Post by: Kyir on June 02, 2014, 10:37:36 AM
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.
Title: Re: Apply Spray Code
Post by: pieceofcheese87 on June 02, 2014, 11:12:16 AM
creation code of apple:
Quote
direction=point_direction(player.x,player.y)+random_range(-50,50) //or whatever you want the range to be
and since it needs to move,
Quote
speed= //speed
Title: Re: Apply Spray Code
Post by: Kyir on June 02, 2014, 12:24:03 PM
Thanks.