"Grow" in size code is too fast


#1

I'll describe how to make a sprite grow in size smoothly as. the Grow value is too
quick.

If you start with a sprite size that's 100
When arrow is tapped
Grow by size multiplied by 1.1

This makes a sprite grow by 10 percent when tapped.
When you make a sprite in the distance grow bigger to look like it's getting closer, this code will help.

Just using the normal grow code and increasing by 1 makes the sprite grow too quick when small and grow too slow when large because only a number is being used and not a percentage like 1.1 which is 10 percent of the sprites current size.


#2

Awesome tutorial! I'm sure me, and so many other people will use this! :clap::smile:


#3

Great tutorial!

I just do

Repeat times ____ :
Set size (size as a % + 1)
End

Same concept lol


#4

No, size plus 1 won't work realistically

If a size is 1 and you add 1, the size has doubled.


#5

:thinking::thinking::thinking::thinking::thinking:


#6

Meh. It seems to work fine for what I need :sweat_smile: ¯\⌒(ツ)⌒/¯


#7

I was working on a first person 3d sort of game and had some trees in the distance behind other trees.

When the trees in front grew to a larger size, the speed they grew by got slower and the smaller trees behind grew bigger quickly.
This didn't look very real at all, so i had to make the trees grow at a smooth rate.


#8

Fair enough. I can see that this is more useful - particularly in some situations like yours :wink:

I just don't generally make projects where this could be applied so my input here is uselos...


#9

I kinda get it...but this looks good!


#10

I appreciate your comments and ideas.
Everyone codes differently to get the same effect sometimes.


#11

Thanks and yeah that's true.

That's the cool thing about coding: you don't always have to have a fixed way of doing things!