Author Topic: Apply Spray Code  (Read 1857 times)

Kyir

  • The Kid
  • Posts: 293
  • Normal Guy
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 35.0.1916.114 Chrome 35.0.1916.114
    • View Profile
  • Playstyle: Keyboard
Apply Spray Code
« 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.

pieceofcheese87

  • Global Moderator
  • The Kid
  • Posts: 346
  • Personal Text
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 35.0.1916.114 Chrome 35.0.1916.114
    • View Profile
    • Twitch Tv Channel
  • Playstyle: Keyboard
Re: Apply Spray Code
« Reply #1 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
« Last Edit: June 02, 2014, 11:14:51 AM by pieceofcheese87 »
Signature

Kyir

  • The Kid
  • Posts: 293
  • Normal Guy
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 35.0.1916.114 Chrome 35.0.1916.114
    • View Profile
  • Playstyle: Keyboard
Re: Apply Spray Code
« Reply #2 on: June 02, 2014, 12:24:03 PM »
Thanks.