Hello GLBASIC community,I just want to invite you to try my 8080 Arcade Emulator http://apd-games.com/emulator.html and see my my new app for iOS and Android DEFENDER 1 http://apd-games.com/.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuotePosted by: OceanIt took me a while to find out that I could do classes using TYPES and functions inside TYPES.
« on: Today at 10:48 am » Insert Quote
do you really need to return 'v1', as such objects are passed by reference anyway?
QuoteFUNCTION subv2 AS TObject:
Quote*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.9.829 SN:b4f5b7db - 3D, NET
"Vectors1-10.gbas"(207) error : wrong argument type :
http://www.glbasic.com/forum/index.php?topic=8048.msg67541#msg67541
PVector mouse = new PVector(mouseX,mouseY);
PVector dir = PVector.sub(mouse,location);
TYPE TObject
x#
y#
z#
FUNCTION set: x, y
self.x = x
self.y = y
ENDFUNCTION
FUNCTION add: v AS TObject
self.x = self.x + v.x
self.y = self.y + v.y
ENDFUNCTION
FUNCTION subv: v AS TObject
self.x = self.x - v.x
self.y = self.y - v.y
ENDFUNCTION
FUNCTION subv2: v1 AS TObject, v2 AS TObject
v1.x = v1.x - v2.x
v1.y = v1.y - v2.y
RETURN v1 /// <====== THIS GENERATES THE ERROR
ENDFUNCTION