Grabbing sprites from other sprites

0 favourites
  • 4 posts
From the Asset Store
Build your map with these isometric objects and terrains
  • Is there a way to get sprites to grab the image from another sprite? I think it would be useful to be able to do this for standarized death animations enemies and such.

  • It's not advisable.

    A: All instances of the same object use the same texture.

    B: You would be increasing the memory use with something that's already in memory.

  • if you have an animation that is universal between objects, such as an explosion that occurs when you shoot any enemy or their health = 0, it may be helpful to make a seperate sprite of just the explosion animation, and spawn said sprite on the object when triggered, and once the animation is finished playing it destroys so as not to take up added memory or create lag.

    this would look something like,

    enemy; on enemy health =<0 ; enemy ; spawn object ; 'explosion animation'

    ; enemy; destroy

    explosion animation; on created ; play animation 'Explode' from start

    explosion animation; on animation 'explode' ended; 'explosion animation' ; destroy

    you could disable collisions with the death animation so as once the enemy has died they cant hurt you, just be sure to spawn the animation onto the enemy before you destroy the enemy, or it will default and spawn the animation on all instances of the chosen sprite.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Speaking of explosions, just noticed the every tick.....

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)