View Single Post
  #8  
Old 03-13-2008, 12:09 AM
Programmer Programmer is offline
Coder
Programmer's Avatar
Join Date: Jan 2008
Location: -78.464422, 106.837328
Posts: 449
Programmer has a spectacular aura aboutProgrammer has a spectacular aura about
Send a message via AIM to Programmer Send a message via MSN to Programmer Send a message via Yahoo to Programmer
Quote:
Originally Posted by Inverness View Post
Yes and like I said, use a TStaticVar object and define its functions with function objects or a class.
PHP Code:
//// Example Script
function onCreated() {
  
this.topleft Objects.Rect(null00screenwidth 2screenheight 2);
}
function 
GraalControl.onMouseDown() {
  if (
this.topleft.inside(mousescreenxmousescreeny)) {
    
// do stuff
  
}
}
//// Weapon Script: Objects
public function Rect(objnamenxnynwnh) {
  
temp.obj = new TStaticVar(""@objname);
  
obj.int(nx);
  
obj.int(ny);
  
obj.int(nw);
  
obj.int(nh);
  
obj.join("type_rect");
  return 
obj;
}
//// Class Script: type_rect
function inside(nxny) {
  if (
nx in |this.xthis.this.w| && ny in |this.ythis.this.h|) {
    return 
true;
  }
  return 
false;
}
public function 
objecttype() {
  return 
"TRect";

It is not necessary to include what you're saying into GScript when the same functionality can already be achieved.
Simplicity, my friend.

Also, you're not getting my point.

read the following words:

INHERITANCE


Your argument contained no hint of inheritance at all


-----
I'd also like to point out that I said classes within Weapon scripts, not class scripts.

Creating a class in a Weapon script is much different than in a class script.
__________________
- Iᴀɴ Zɪᴍᴍᴇʀᴍᴀɴ

Last edited by Programmer; 03-13-2008 at 12:23 AM..
Reply With Quote