Hey everybody there
I need to do a size change of a sprite on impact with bullet and when no contact to revert it to it’s original size.
Any help please ?
Thanks…
Hey everybody there
I need to do a size change of a sprite on impact with bullet and when no contact to revert it to it’s original size.
Any help please ?
Thanks…
You can simply check collision between the sprite and the bullet and change the scale of the sprite when collision happens.
For example if you want to make the sprite smaller on impact,
For each object "sprite"
Trigger Once
If sprite is in collision with bullet : Do =0.2 to scale of sprite
If you want to decrease it size each time a bullet is in collision with the sprite
For each object "sprite"
Trigger Once
If sprite is in collision with bullet : Do -0.2 to scale of sprite
If you want to change the scale only for specified amount of time, you can use a timer. Once you have changed the scale of any sprite, you can start a timer, I suggest to use object variables to make a timer specifically for the sprite you want to work with.
You can do a timer by doing something like this and simply check the value of the object variable:
Do = 100 * TimeDelta() to sprite.Variable(Timer)
If you want to change the scale only as long the sprite is in collision with the bullet, you can simply just:
For each object "sprite"
Trigger Once
If the scale of sprite is < 1 and it is NOT in collision with bullet : Do=1 to scale of sprite
When you scale the sprite 1 is the default size 0.1 is basically 10% of it original size I think you can go as low as 0.01 which is 1% and you can go as high as you want if you enter 2 it is 200% of it original size or 1.5 is 150% and so on.
Awsome a million thanks ) I am almost done with my retro Turrican remake game with new gfx sound and fx.
This was the last few bugs and problems …