createSprite() Question

I am a little confused by createSprite().

Should this code:


produce the same results as this code:

image (1)

Because it does not.

What am I not understanding here?



Hi @jwilson25,

Yes. I absolutely understand your confusion. I think the answer is when a sprite has an animation, the 3rd and 4th parameter (width and height) do not apply because the animation has height and width - or at least that is what I think. When the sprite does not have animation, then the height and width applies. Here is an example. I have had kids make complete games where the main sprite is just the square.

That’s always been my thinking:)

That has been my experience. The height and width only apply to a sprite before assigning it an animation (ie. in its gray box stage).


1 Like