0 votes
by (230 points)

I need to know how it is called when "you put many variables inside another one", for example like this:

<<set $Enemy ={ name:"Small Spawn",hp:10,mhp:10,mp:1,mmp:1,lu:0,mlu:1,
image:"Enemies/SSpawn.png",G:5,exp:7,}>>

So now I would be able to simply call one of those by writing:

Health: $Enemy.hp/$Enemy.mhp

I need to do the same thing in python so I need to know the proper name in order to search for it, thanks.

 

1 Answer

+1 vote
by (159k points)
selected by
 
Best answer

The value that appears after the equals sign within your <<set>> is known as a Generic Object literal in JavaScript.

Python has a data-type known as a Dictionary, which behaves in a simular way.

by (44.7k points)

These links may also help:

W3Schools - "JavaScript Objects" (general info) & "JavaScript Objects" (specific info)

MDN - "JavaScript object basics"

Also, just to be clear, there are lots of different specific types of objects in JavaScript, such as arrays, but as greyelf said, what you're asking about is the general or generic object type.

...