Thread: Shoots
View Single Post
  #12  
Old 02-12-2009, 08:01 PM
thatdwarf thatdwarf is offline
Former UN Dev Admin
Join Date: Nov 2005
Posts: 42
thatdwarf is on a distinguished road
just like written above as long as those variables are defined
You can see in Chompy's script where those variables (temp.startx, temp.angle, etc) are given values.

You can very well just put all the numbers/math in the appropriate location in the shoot() function, but it's very messy, and considered bad practice to use "magic numbers", meaning numbers without clear meaning.

Defining the variables beforehand gives the code more readability ^_^
Reply With Quote