Wednesday, March 20, 2024
HomeSample Page

Sample Page Title


Lets say there are 5 items, displayed as pictures on an html5-canvas.
Each picture (unit) has a unique measurement. For the sport I have to know the scale of that unit, and likewise it is center level.

How and the place do I save this knowledge?
If I load the picture, do I save that picture knowledge in a, f.e., an array of objects, the place every object has that picture attributes?

What do I do if that unit dies, do I delete that object from the array? And do I simply create a object after I create a brand new unit once more?

What construction can I take advantage of right here? An array of objects does not appear very environment friendly to me (I do not even know if it really works, not very skilled).

I had one thing like this in thoughts:

let unit_imgs = [
    {
        width,
        height,
        midpoint,
    },
    {
        width,
        height,
        midpoint,
    },
    { ... },
];

Any different, higher, methods to do that?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments