I have not found a post yet .. so please send the link if you find one.
With a huge problem, I am creating a game of those that the ball has to break squares on the screen and I have everything ready, except the squares to be broken.
My problem is that I create a block object with the block's data. And when I do:
var bloco = new bloco(posiçãox,posiçãoy)
I create a block on the screen, but when I make another block, I can not. Or when var
has a different block name.
I tried:
var bloco2 = new bloco.constructor();
but I do not know where to insert the parameters of the object (posx e posy)
;
Does anyone know how to help me? I have to make a 270 and can not do it manually because they appear randomly on the screen.
Objects are in the context of a 2d canvas.