Quote:
Originally Posted by Inverness
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(null, 0, 0, screenwidth / 2, screenheight / 2); } function GraalControl.onMouseDown() { if (this.topleft.inside(mousescreenx, mousescreeny)) { // do stuff } } //// Weapon Script: Objects public function Rect(objname, nx, ny, nw, nh) { temp.obj = new TStaticVar(""@objname); obj.x = int(nx); obj.y = int(ny); obj.w = int(nw); obj.h = int(nh); obj.join("type_rect"); return obj; } //// Class Script: type_rect function inside(nx, ny) { if (nx in |this.x, this.x + this.w| && ny in |this.y, this.y + 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.