Posted: 8th May 2021 16:22
edit: i dont want a drag and drop tool or a level editor (i hate both concepts), and im not a lazy person who dosnt like to code ....
i just wanted to know why agk dosnt have refrences (it dosnt it just copies vars assigned to other vars...) i also wondered if you could do somthing more modular with user defined types (again apparently not)
please don't offer me to go use game maker or unity.


how do you make a complex game with a lot of entities, screens gui etc.

you have types and all but you dont have a constructor so you have to init everything by hand.

you don't have references (every variable is its own copy of the data you give it).

you have to, remove /add / update, etc everything by hand (or is there a secret modular reusable way to do this?).

how do you do it without a lot of boilerplate code?

like:

create an array for bullets, enemies, powerups etc.

create a loop to update each

hide them/remove them when you go to a different screen (how do you do screens in the cleanest way?

and they say "so it will be a minimalistic language for beginners" like really? even in javascript, you can use vars as references to other vars.

in agk if you assign "very_long_name.array" to lets say "a as xtype" it will create a copy, like really? why do i need a copy of the same data when all i want is a reference/cleaner code to manipulate a very long type with an array.
and it dosnt say anywhere in their guides its that way.


i dont know how they expect you to have a big project that is not total spaghetti code with that.

if anyone has an example of a big project (or how to structure such a thing) with agk basic.

if i wanted a c++ engine i would have gotten a free one.

in blitz 3d i ported my framework no problem, here its just wierd please give me your input.
Posted: 8th May 2021 20:32
how do you create a game with a lot of entities without a ton of boilerplate code


You use GameMaker or Godot, you can not expect to pick up a code tool like AppGameKit and have tonnes of usefull code fall out of the box you build this up over time, your bullet example, one you write a system for firing a bullet, if your smart and write a modular system you now have a reusable bullet firing system that can be dropped in any game ...

over time the amount of boiler plate code you will need will become less and less as you establish a library of includes, bullets, player movement scripts and functions

AGK is a coders tool, a game framework, if you want to drag a load of images into a frame and click a button to see the results then AppGameKit is not the tool for you, you want a game engine, most people want the latter, I love AppGameKit and I don't even make games, I just get a kick out of making it do what it doesn't say on the tin

as for arrays, variables and pointers, remember Javascript is typeless, agk is not, you can not assign a string variable to a float value in almost every other language (bar Javascript and Lua off the top of my head) so all agk is asking of you is that you define the var type, you can then set it to your type array

+ Code Snippet
b as myType : b=myReallyLongArrayName[1]


if you are adding data it has to be processed somehow, how you handle that is up to yu but I like to ...
+ Code Snippet
Type myType
	vString as string 
	vFloar as float 
	vInteger as integer
EndType

global myArray as myType[-1]

// add to the array
a as myType
a.vString="Some String"
a.vFloar=99.99
a.vInteger=1233456
myReallyLongArrayName.insert(a)

// or in function form
Function AddmyType(c ref as myType, s$, f#, i)
	c.vString=s$
	c.vFloar=f#
	c.vInteger=i
	myReallyLongArrayName.insert(c)
EndFunction

AddmyType(a, "Some String2", 3.4, 666)


As for spaghetti code, thats on you my friend, if your code is a mess, you made it (unless its C++, then its just ugly!)

avoid spaghetti code by making vary targeted functions and separate code into sections, yes some kind of class system would be nice in AppGameKit but as there isn't so you simply have to "fake" it, well structured functional code is a thing of art so embrace it, lol
Posted: 9th May 2021 5:56
I'm not the best coder but here's how I go about it in my half-finished game Strawberry Quest. (full source included!)
Posted: 9th May 2021 6:15
you don't have references (every variable is its own copy of the data you give it).


No, each Variable is merely a Reference... AppGameKit handles Memory Management., so let's say you have:

Type Vec3 : X# : Y# : Z# : EndType
A As Vec3 = [ 0.0, 1.0, 0.0 ]
B As Vec3 : B = A
C As Vec3 : C = B

In said scenario ONLY A is actually the Root Data Reference (thus will contain the addresses for said data in A.X# A.Y# and A.Z#
The others are going to be Deferred References.
As long as Data Types Match (i.e. same Fundamental Data Type., String / Integer / Float; or User Defined Type) then they will simply de-reference.

Now an exception to the above is when you pass into Functions., then these are created as Data Copies UNLESS you specifically use the [Name] Ref As [Data Type] ... but even then this is presently limited to UDT or Arrays.
I think they should expand this to Fundamental Data Types as well; but then I think they need to expand the Fundamental Types to allow for 8/16/32/64 bit Variable Depth and denoting Signed / Unsigned (but then I'd prefer less Abstraction and more Explicit support)

?

Now beyond this., I'm actually not entirely sure what you're saying.
You know what would help; would be examples of what you're talking about from another language... then someone can say "Yes this is possible" or "No this isn't... but here's an alternative"
Several of your points don't really make sense.

This isn't a Text or Twitter Conversation; you're not limited by the number of Characters you can use; so be verbose and give examples.
Because what it sounds like to me is that you just want to use Unity, Godot, or Unreal Kismet; to create a template entity then just drag-and-drop a single command to make it work as a Particle Effect or Bullet or such.

AGK is a Programming Language... albeit Scripting, so while functionally it's capable; performance wise... yeah don't be thinking you'll be handling Thousands of Entities.
Want to see what I mean, go look at my conversion of a Software 3D Engine; what killed completing that was PERFORMANCE not Language Capability.
As such, as I always say. AppGameKit is best for "Small" Projects.

You want to do bigger and more ambitious things... look at Dark BASIC Professional instead.
But as noted, it doesn't sound like you want a Programming Language IF you don't want to do things yourself.
Even in Java you're doing A LOT of Boilerplate Code, arguably more in most situations.
Posted: 9th May 2021 11:27
wow i dont understand how you got to the conclusion i want drag and drop, i despise drag and drop, aka visual programming, it disgusts me, i dont even like 3d scene builders. unity sucks, and i never saw game maker as an option.

im a programmer close to 10 years, i mostly did database based web aplications.

i started game programming with flashpunk an as3 flash framework, the competitor of flixel (most complex thing i did lately is to implement flow field algorithm for an rts game its actually a nice algorithem).

it(flashpunk) uses entity (a as3 class) and entity derived/extanded class as "actors"/game objects, an entity has most things you need for game objects : movment (with solid hit detection) hit collision detection (box and pixel based and even raycasting), rotation,alpha, basic maths (angel between point/entity, distance) sprite/image manipulation/animation (including tween), input handling,etc etc.

each entity has a type so you can get entities with "get by type" or collide by type.

thers also world, itsl like a screen, each world holds entites, while non active worlds entites are not active or visable, you change world to move between screens.

for example a pong game with this framework:

worlds: start screen, game screen, game over

entities:
paddle
ball
score
buttons

edit:the big thing is that its oop meaning a class encapsulates data and functions (methods) so all you need to do is : world.add(some_entity) , and dont worry about it the world will update it as it keeps a list of entites, and to remove its as easy world.remove(some_entity), no need to loop anything update a list/array,display object like sprite remove does it all.

btw agk has this when you add or remove a sprite(and images and sounds etc), why dont they make a way to do this with user defined types? that would make my life much easier with less boilerplate code.

i can do all this without that framework, as proof over the years i ported it(flashpunk framework) to at least 10+ engines and languages (i know it very intimately):

my first attempt after i was told flash is dead(decleard dead), there were no class in js yet so i used prototypes (the engine is dom based):

https://github.com/yoel123/yoel-html5-game-engine-tutorials

later i ported it to phaser js:

https://github.com/yoel123/yoel-phaser-js-framework

and then to java with slick 2d (java has oop):

https://github.com/yoel123/yoel-java-slick2d-framework

it lacked mobile so i ported it to corona sdk, lua has oop, but its a bit clumsy:

https://github.com/yoel123/corona-sdk-picking-sticks

i will also make a picking sticks for agk.

i also ported it to unity (i dont have the files).

ported to naalaa ( a basic dilect):
https://github.com/yoel123/naalaa-avoider-game

naalaa has types but no oop but i manged

blitz 3d port:
+ Code Snippet
;//////////////////////main//////////////////////////
;create_y_world()
;Global y_camera,y_light,bla
;sphere = CreateSphere(32) 
;EntityColor sphere ,250,0,0
;EntityAlpha sphere,0.5
;PositionEntity sphere,0,0,5 
;EntityType sphere,sphere_col
;bla=y()

;test y_entity
;berrel = LoadMesh ("oildrum.3ds")
;PositionEntity berrel ,0.2,0,0 
;ScaleEntity berrel ,0.05,0.05,0.05

;y_test. y_entity= create_y_entity(berrel ,0.1,2,5)

;y_test\pos\x=-0.1


;y_world_update()
;//////////////////////end main//////////////////////////






;////////////////////////world class///////////////////////////////

Global  y_camera,y_light,campiv

;create world
Function create_y_world()

Graphics3D 640,480,16,2
SetBuffer BackBuffer ()
campiv= CreatePivot()
y_camera = CreateCamera(campiv)
;EntityAlpha campiv,1

y_light = CreateLight ()
End Function ;end create_y_world

;update world 
Function y_world_update()
While Not KeyHit(1)

	


	UpdateWorld
	RenderWorld 
	;my updtae
	y_my_update()
	
	;update all entitis pos
	For e.y_entity= Each y_entity	
		;update_y_entity(e)
		;e\pos\x =e\pos\x  -0.1
	Next
	
	Flip
	Wend   
End Function ;end y_world_update

;my update world
;Function y_my_update()

;End Function ;end y_my_update

;////////////////////////end world class///////////////////////////////

;/////////////////////////y_entity///////////////////////////////////
Type y_entity
	 Field grafic
	 Field pos.y_point
	Field speed
	Field solid
	Field y_Type
End Type 

;create y_entity
Function create_y_entity. y_entity(grafic, x, y, z, y_Type)

	Local e. y_entity = New  y_entity
	e\pos.y_point = New y_point
	e\pos\x = x
	e\pos\y = y
	e\pos\z = z
	e\grafic = grafic
	e\ y_Type = y_Type
	PositionEntity e\grafic,e\pos\x,e\pos\y,e\pos\z
	EntityType  e\grafic , y_Type
	Return e 
	
End Function ;end create y_entity

;update y_entity
Function update_y_entity(e. y_entity)

	;Local e. y_entity
	
	PositionEntity e\grafic,e\pos\x,e\pos\y,e\pos\z

End Function ;end update y_entity
;/////////////////////////end y_entity///////////////////////////////////
;/////////////////////////y_point///////////////////////////////////
Type y_point
	Field x#
	Field y#
	Field z#
End Type 
;/////////////////////////end y_point///////////////////////////////////

;////////fps cam////
Function fps_cam()
	TurnEntity campiv, 0, -MouseXSpeed ()/5.0, 0	
	TurnEntity y_camera, MouseYSpeed () /5.0, 0, 0			;rotate camera up/down according to mouse Y movement
	  If EntityPitch(y_camera) < -45					;don't allow camera to look below -45 degrees
	    RotateEntity y_camera, -45, EntityYaw(y_camera), EntityRoll(y_camera)
	  EndIf 
	  If EntityPitch(y_camera) > 45					;don't allow camera to look above 45 degrees
	    RotateEntity y_camera, 45, EntityYaw(y_camera), EntityRoll(y_camera)
	  EndIf
        MoveMouse GraphicsWidth()/2, GraphicsHeight()/2		;reset mouse position to middle of screen
     	
End Function ;end fps cam

Function entity_control(e,speed#)
	;e= y_camera
	wkey = KeyDown(17)						;collect user input
	  skey = KeyDown(31)						;It's a good practice to collect these inputs only once
	  akey = KeyDown(30)						;per loop.  This will prevent odd behaviors from happening,
 	dkey = KeyDown(32)	
	If KeyDown(203) Or akey Then MoveEntity e,-speed,0,0  ;left
	If KeyDown(205) Or dkey Then MoveEntity e,speed,0,0;right
	If KeyDown(208) Or skey Then MoveEntity e ,0,0,-speed;down
	If KeyDown(200) Or wkey Then MoveEntity e,0,0, speed;up
End Function ;end entity control

Function y()
 Print 123
sphere = CreateSphere(32) 
;EntityColor sphere ,250,100,0
;EntityAlpha sphere,0.5
PositionEntity sphere,5,0,5 
EntityType sphere,sphere_col
End Function 

;End



and fnaly the agk port:

yengine.agk:
+ Code Snippet
global count = 0

global current_world as yworld
global current_worldi //current world index

/*
its not ideal but to get current world you need:

worlds[current_worldi]

agk dosnt use refrences for vriables every var is its own place in the memory and dosnt point to another var
*/

global ysprite_count = 0
global yimg_count = 0
global ytxt_count = 0

global yimgs as yimg[]

global worlds as yworld[]

global ydebug as string
ydebug="debug:"

////////////////////////types/////////////////////////

TYPE yentity
	id as integer
	src as integer
	rindex as integer
	ytype as String
	pos as ypoint
	speed as float
	yactive
	alpha
	rotation as float
	frame
	yints as integer[]
	ystrings as String[]
	yfloats as float[]
ENDTYPE

TYPE ypoint
	x as float
	y as float
	z as float
ENDTYPE

TYPE yworld
	name as String
	yentitys as yentity[]
	rindex
ENDTYPE

TYPE yimg
	name as String
	id
ENDTYPE

////////////////////////end types/////////////////////////



/////////////////engine funcs/////////////////////////////////////

function yengineupdate()
	
	yworldupdate()
	myupdate()
	
endfunction  //yengineupdate

/////////////////end engine funcs/////////////////////////////////////

/////////////////////world funcs///////////////////////////////

//GetSpriteExists
//SetSpriteActive
//GetSpriteActive


function newyworld(name as string)
	
	nw as yworld
	nw.name = name
	nw.rindex = worlds.length+1
	worlds.insert(nw)
	
endfunction nw //newyworld

function changeworld(n as string)

	//hide all worlds sprites
	for i = 0 to worlds.length
		for j = 0 to worlds[i].yentitys.length
			SetSpriteVisible(worlds[i].yentitys[j].id,0)
			//ydebug = ydebug+"--"+str(worlds[i].yentitys[j].id) + "--"
		next j		
	next i
	
	//change world
	for i = 0 to worlds.length
		//find name and set current world to this world
		if worlds[i].name = n then  current_worldi = i
	next i

	//show new world sprtes
	for i = 0 to worlds[current_worldi].yentitys.length
		SetSpriteVisible(worlds[current_worldi].yentitys[i].id,1)
		//ydebug = ydebug +"xx"+ str(current_world.yentitys[i].id)+" xx"
	next i
endfunction //changeworld

//add entity to current world
function yadd(e ref as yentity)
	worlds[current_worldi].yentitys.insert(e)
endfunction //yadd

//add entity to a spesific world
function yaddw(w as string,e ref as yentity)
	
	for i = 0 to worlds.length
		//find name and add entity current world to this world
		if worlds[i].name = w 
			e.rindex = worlds[i].yentitys.length+1 // save the yentitys array index
			worlds[i].yentitys.insert(e)
		endif 
	next i
	
endfunction //yaddw

function yremovew(w as string,e ref as yentity)
	
		
	for i = 0 to worlds.length
		//find name and add entity current world to this world
		if worlds[i].name = w and worlds[i].yentitys.length <>  -1 and GetSpriteExists(e.id)
		//	worlds[i].yentitys.remove(e.rindex)
			worlds[i].yentitys[e.rindex].yactive = 0
			DeleteSprite(e.id)
		endif
	next i
	
endfunction //end yremovew 

function yworldupdate()
	//shortcuts (to get data they are not refrences)
	e as yentity
	w as  yworld
	wi = current_worldi
	w = worlds[wi]
	print("wi"+str(wi))
	//loop all entities in current world
	for i = 0 to w.yentitys.length
		e = worlds[wi].yentitys[i] //current entity
		//if the entity sprite exists update entity
		if GetSpriteExists(e.id)
			update_yentity(worlds[wi].yentitys[i]) //e dosnt hold refrence	
		endif
	next i

endfunction //yworldupdate



/////////////////////end world funcs///////////////////////////////

////////////////////////entity funcs///////////////////////////////////

function newyentity(x,y,speed,src_id)
	//incrament sprite count
	inc ysprite_count
	//create new entity and populate its atts
	ne as yentity
	ne.pos.x = x
	ne.pos.y = y
	ne.speed = speed
	ne.id = ysprite_count //give it some id
	ne.src = src_id //image id
	ne.ytype = "entity"
	ne.yactive = 1
	//create sprite
	CreateSprite(ne.id,src_id)
	//set start pos
	SetSpritePosition(ne.id,ne.pos.x,ne.pos.y)
	
endfunction ne //newyentity

function update_yentity(e ref as yentity)
	SetSpritePosition(e.id,e.pos.x,e.pos.y)
	//add rotation and alpha
endfunction yimg_count//update_yentity

function move_by(e ref as yentity,sx as float,sy as float)
		//no refrences so have to use current_world itself
		i = current_worldi
		worlds[i].yentitys[e.rindex].pos.x = worlds[i].yentitys[e.rindex].pos.x +sx
		worlds[i].yentitys[e.rindex].pos.y = worlds[i].yentitys[e.rindex].pos.y +sy
		//print(e.pos.x)
endfunction //tst

function get_by_type(t as string)
	
	es as yentity[]
	for i = 0 to worlds[current_worldi].yentitys.length
		//if type and active
		if t = worlds[current_worldi].yentitys[i].ytype  and worlds[current_worldi].yentitys[i].yactive=1
			 es.insert(worlds[current_worldi].yentitys[i])
		endif
	next i
endfunction es

function hit_test(e ref as yentity,t as string)
	ret as yentity
	es as yentity[]
	es = get_by_type(t)
	for i = 0 to es.length
		if GetSpriteCollision( e.id, es[i].id ) =1 then ret = es[i]
	next i
endfunction ret

function is_clicked(e ref as yentity)
	ret = 0
    if ( GetPointerPressed ( ) = 1 )
        sid = GetSpriteHit ( GetPointerX ( ), GetPointerY ( ) )
        if sid = e.id then ret = 1
    endif
endfunction ret //end is_clicked

function ise(e ref as yentity)
	ret = GetSpriteExists(e.id)
endfunction ret

//change entity intager val
function ei_change(e as yentity,pos,yval)
	i = current_worldi
	worlds[i].yentitys[e.rindex].yints[pos] = worlds[i].yentitys[e.rindex].yints[pos]+yval
endfunction

function sx(e ref as yentity,x)
	i = current_worldi
	worlds[i].yentitys[e.rindex].pos.x = x
endfunction

function sy(e ref as yentity,y)
	i = current_worldi
	worlds[i].yentitys[e.rindex].pos.y = y
endfunction


////////////////////////end entity funcs///////////////////////////////////

/////////////////////////util funcs//////////////////////////

function yaddimg(src)
	inc yimg_count
	//load img
	//(yimg_count,src)
endfunction yimg_count//tst

/////////////////////////end util funcs//////////////////////////

function tst()
	Print("tst")
endfunction //tst


main.agk (you will need ph.png placeholder in media flder):

+ Code Snippet
// Project: yengine 
// Created: 2021-05-07

// show all errors
SetErrorMode(2)

// set window properties
SetWindowTitle( "yengine" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window

// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts

#insert "yengine2d.agc"

LoadImage(1,"ph.png")

tstw as yworld
tstwt as yworld

tstw = newyworld("game")
tstwt = newyworld("menu")

//current_world = tstw

tste as yentity
bullet as yentity
target as yentity
global tste2 as yentity

tste = newyentity(50,50,1,1)
tste2 = newyentity(250,50,1,1)
tste.ytype = "tst"
tste2.ytype = "btn"

bullet = newyentity(50,250,2,1)
target = newyentity(350,250,1,1)
bullet.ytype = "bullet"
target.ytype = "target"
target.yints=[1,0]//hp (one way to do this)
target.yints.insert(1)//hp (another way todo this)

//yadd(tste)
yaddw("game",tste)
yaddw("game",bullet)
yaddw("game",target)
yaddw("menu",tste2)

changeworld("menu")

do
    print(ydebug)
	//move_by(tste,tste.speed,0)
	//move_by(current_world.yentitys[0],tste.speed,0)
	//update_yentity(tste)
	
	//yworldupdate()
	yengineupdate()

    Sync()
loop

global tsttimer = 0
function myupdate()
	
	if worlds[current_worldi].name="game"
		print("in game")
		//make tst type move
		tstts as yentity[]
		tstts = get_by_type("tst") // get al ts types 
		for i = 0 to tstts.length //loop them
			move_by(tstts[i],tstts[i].speed,0) //test move by
			if tsttimer>100 then yremovew("game",tstts[i]) //test remove with fake timer
		next i
		if tstts.length >=0 then print( "is tst exist: "+str(ise(tstts[0])) )
		inc tsttimer//incrament fake timer
		
		bullets_update()
		
	endif
	
	
	if worlds[current_worldi].name="menu"
		update_menu_world()
	endif
	

endfunction 


function update_menu_world()
	
		print("in menu")
		//click tste2 to change to game world
		if is_clicked(tste2) then changeworld("game")
	
endfunction


function bullets_update()
	
		bs as yentity[]
		//loop all bullets
		bs = get_by_type("bullet") // get al ts types 
		for i = 0 to bs.length //loop them
			move_by(bs[i],bs[i].speed,0) //test move by
			//sx(bs[i],bs[i].pos.x-1) //test sx sy
			bullets_hit(bs[i])
			
		next i
	
endfunction

function bullets_hit(b ref as yentity)
	
	t as yentity
	ts as yentity[]
	t =  hit_test(b,"target")
	if ise(t) //ise = GetSpriteExists for yentity
		print("target hit")
		ei_change(t,0,-1)
	endif
	ts = get_by_type("target")
	print("target hp: "+str(ts[0].yints[0]))
endfunction





im still pissed thers no proper refrence variables like:

a = "bla"
b = a
b = b + " holubalu!"

print(a)//prints bla
print(b) //prints bla holubalu!

dosnt seem anoying? lets see

im_a_very_long_object_array.pos.x = 5
//im a short var to refrence the line before for readabilety and fun
ex = im_a_very_long_object_array.pos.x //short for entity x
speed = 1
ex = ex +speed

print(ex)//prints 6
print(im_a_very_long_object_array.pos.x) //prints 5.....why me why

so i have to use im_a_very_long_object_array.pos.x to update that entities pos (or create a function for that) .

agk seems like a very powerful toll with many platform support and everything you need to make a game out ob the box the basics and luxury features.
i would prefer to use its basic scripting language (if i wanted cpp i would have used a diffrent free engine).
somtimes simple is better for faster devlopment.
but no oop is very hard for somone who is very used to and fond of oop.
again it dosnt even have proper references.

if somone has an advise or a workaround (or a feature i dont know about) it will help me a lot.
Posted: 9th May 2021 19:41
If you want to drag and drop your sprites etc this is one of the reasons people use the studio version of agk

The alternatives are using any one of the editors available
search the forums people share them there are 3d

for 3d https://forum.thegamecreators.com/thread/227129
or this one https://forum.thegamecreators.com/thread/225456

for 2d https://forum.thegamecreators.com/thread/223121

or could make your own there is a bare bones 3d one here i have shared the code https://forum.thegamecreators.com/thread/222027?page=3
there are lots of them on the forums and with the beauty of json files it makes for much cleaner code

the editors you chose is a personal preference but often customizing one to your own personal requirements is best do a search of placement in the forums and you will find a heap of 2d ones
Posted: 9th May 2021 19:44
often developing software requires developing custom tools here is a game i am working on it uses a heap of tools but shows clearly
a track editor and terrain editor that had to be made aswell as the game both of which were created in agk



another one by me a 2d placement editor with source very early stages https://forum.thegamecreators.com/thread/219932
Posted: 10th May 2021 0:22
i despise drag and drop, aka visual programming, it disgusts me


Visual scripting, sure I got you covered



I do hate this OOP snobbery, OOP guys pick up basic and do nothing but moan about it, if you don't like functional programming which from your posts is quite obvious then go back to OOP.
Posted: 19th May 2021 3:07
The reference assignments is kind of something you just get used to to be honest. A good text editor with auto completion makes it less an issue since you can just type a few characters and let the editor expand it to the long array name for you.

There's also some tricks you can do with constants - which aren't really the same thing as a const but are actually find:replace preprocessor tokens

Also, a constructor is still just a function at the end of the day, you can set up a function and call it to handle initializing an object, its an extra step, but does the job

+ Code Snippet
#CONSTANT CURRENT_WORLD my_long_world_array_name[World.CurrentIndex]

#CONSTANT THIS_WORLD my_long_world_array_name[this]

Type StaticClass_World
    CurrentIndex as integer
Endtype

Global World as StaticClass_World

Type Class_World
    WorldName as string
Endtype

Dim my_long_world_array_name[] as Class_World

W as Class_World
new_World(W, "Title Menu")
new_World(W, "Main Screen")
new_World(W, "Credits")

World.CurrentWorld = 0

Do
  Print("current " + CURRENT_WORLD.WorldName)
   For this = 0 to array count(my_long_array_name[])
      print(str$(this) + " " + THIS_WORLD.WorldName
   Next this
Loop

Function new_World(W as Class_World ref, name as string)
    W.WorldName = name
    My_long_world_array_name.add(W)
Endfunction


Posting from phone, there are probably some minor syntax errors sorry
Posted: 21st May 2021 1:56
As someone who loved Action Script 3 I have found AppGameKit to be the best thing since. You either get used to the idiosyncrasies or they drive you nuts and you move on. But I don't think a perfect solution exists... Although the syntax is basic this is an OOP language, and you can pass data as a reference https://www.appgamekit.com/documentation/guides/types_004.htm