AS 2 [HELP] Problem to 'KILL ENEMY'
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [HELP] Problem to 'KILL ENEMY'

  1. #1
    I'm not Crazy :D
    Join Date
    Nov 2015
    Location
    Brazil [<o>]
    Posts
    76

    Question [HELP] Problem to 'KILL ENEMY'

    Hey, I'm having a problem to remove the enemy's life when the bullet hit him, some help to fix?

    Code:
    function addEnemy():Void
    {
    	enemy_mc.enemyHealth = 100;
    }
    
    addEnemy();
    
    function createBullet():Void
    {
    for (var i=0; i<enemyArray.length; i++)
    {
    	_enemy_mc = eval(enemyArray[i]);
    				
    	if (this.hitTest(_enemy_mc))
    	{
    		this.removeMovieClip();
    		enemy_mc.enemyHealth -= 10;
    	}
    }
    }

  2. #2
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    883
    see this thread. it is about coins, but hero picking up coins is the same thing as enemy picking up bullets.
    who is this? a word of friendly advice: FFS stop using AS2

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center

Poll by Flashkit.com