Quote: "AppGameKit already makes you number each image, sprite, and 3D object as you make them"
Are you using the syntax that auto-allocates an ID:
imgId = loadImage("myimage.jpg")
mySprite = CreateSprite(imgId)
Quote: "Fields can also be defined without explicitly defining the field's type"
This means you can create variables like so:
global x // integer
global x# //float
global x$ //string
My approach is to use arrays which are a user defined type (e.g Character Type and Weapon Type)
In the Character type, you have an integer named
WeaponId. This is the element number in the Weapon Array.
It can get more complex:
WeaponId[] can be an array of Weapons within the character type.
The Weapon array can be a set of blueprints, which you copy across to the character and customise (health, strength etc)
There is no theoretical limit to the number of sub-arrays you can have within your types, and sub-types within types. I have 4 levels in one of my structures, each level being an array of types.
You nest your arrays by declaring them as an array in your type. e.g
Type tAmmo
HitStrength as integer
respawnTime as integer
EndType
Type tWeapon
Health as integer
Ammo as tAmmo[]
EndType
Type tCharacter
Health as Integer
Weapons as tWeapon[]
EndType
Global gCharacters as tCharacter[]
Here I have unlimited characters with unlimited weapons with unlimited ammo. The characters, weapons and ammo can all have their own characteristics.
This gives you all of the flexibility you need.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt