Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:40 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.