1 decade ago by Jon
Hello,
I am trying to increase the size of a ball after a user clicks on it.
I am spawning multiple balls at once with the following:
The EntityBall is just a simple entity that specifies the animSheet (the ball is spinning which is why I didn't use an image). I am able to successfully create the two balls from the above code.
However, now I want to allow the user to click on one of the balls and the size of that ball to increase.
After searching these forums for a while I cannot seem to find a way to do this. I have tried doing stuff like:
But nothing changes. I figured this was going to be the easier part of my little project :) I guess I am wrong once again.
Any tips on increasing the size of the animation?
I am trying to increase the size of a ball after a user clicks on it.
I am spawning multiple balls at once with the following:
ballOne = ig.game.spawnEntity('EntityBall', 75, 250); ballTwo = ig.game.spawnEntity('EntityBall', 75, 150);
The EntityBall is just a simple entity that specifies the animSheet (the ball is spinning which is why I didn't use an image). I am able to successfully create the two balls from the above code.
However, now I want to allow the user to click on one of the balls and the size of that ball to increase.
After searching these forums for a while I cannot seem to find a way to do this. I have tried doing stuff like:
radius = Math.random().map(0, 1, 20, 50).round(); ballOne.size={x:radius, y:radius};
But nothing changes. I figured this was going to be the easier part of my little project :) I guess I am wrong once again.
Any tips on increasing the size of the animation?