What happens to MoveTo after all sprites are destroyed?

0 favourites
  • 3 posts
From the Asset Store
A set of 10 pixel art animated magic effects with icons. 2 Fire, 2 Earth, 2 Wind, 2 Water, Portal, Explosion.
  • Hi guys, first of all thanks for a fantastic product ! love it although have only been working on it for a few days.

    I am creating a tile based game and I place several enemies on the "board" at the start.

    After the player moves I call a function to move the enemies (it's a turn-based game)

    This is the block I'm using.

    The problem is , after I destroy all the enemy sprites (after they get killed) the block doesn't trigger, i.e. the player sprite doesn't move

    what happens to the MoveTo.is Moving condition after all the sprites get destroyed ? I assumed nothing is moving because no sprites exist !

    Thanks in advance

  • Yeah, if the sprite doesn't exist, then the condition "Sprite Is Not Moving" returns false and the whole event is not triggered. Here is an easy way to fix this:

    On Numpad 6 is pressed
    
    	(sub-events)
    
    	Sprite Is Moving : (no actions)
    
    	Else : Sprite10 Set X...
    		: Function call moveenemies
    
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Many thanks for the quick response.

    very helpful.

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