How Can Win Points When Enemy Is Killed

Discussion in 'How Can I...?' started by Bllaaa, Sep 5, 2018.

  1. Bllaaa

    Bllaaa Boxer

    Joined:
    Jul 26, 2018
    Messages:
    68
    Likes Received:
    9
    I know it's a basic problem, but I don't know how to do.

    1- My player is facing an enemy and he can shoot a bullet.
    -----------P--------------------E
    ------------------------------------------
    2- When the bullet collides with an enemy it kills him.
    -----------P--------------------T
    ------------------------------------------
    3- When the enemy dies, the player won +1 points.
    -----------P-+1---------------T
    -----------------------------------------

    I know how to win points when the player collides with a "coin", but that's all. Can he win points when he kills an enemy, brokes a crate or something else?

    Thanks for the help guys. ^^
     
  2. Bllaaa

    Bllaaa Boxer

    Joined:
    Jul 26, 2018
    Messages:
    68
    Likes Received:
    9
    Ok found on the fofo in there ˆˆ
    https://www.buildbox.com/forum/inde...-points-for-killing-enemies-bbdoc.5697/page-2

    Thanks to the community

    Step by Step Tutorial:
    1. make a small png with a particular color that works as a helper image. Something really small, like 4x4px.
    2. import the image as an action
    3. Go to the action panel on the left and select the action you just imported
    4. Go to the default animation and click on the pen icon to edit it
    5. Change the scale to something really big. Like 160x90. Make sure it is bigger than a iPad screen. Close the window again.
    6. Click on Collision Shape Edit (which is right above the Default animation)
    7.Click on the "square-with-the-four-dots"-icon. This will adjust the collision shape to the new scale
    8. You'll see that the imported action in the game-field is now really big (exactly as you scaled it). Select the action and copy it by clicking cmd+c (Mac) or ctrl+c (PC)
    9. Delete the action from the game-field
    10. Go to the enemy death animation, click on the pen icon to edit it
    11. Click on the blank space from the death animation pop-up window once and then paste the action by clicking cmd+v (Mac) or ctrl+v (PC)
    12. Move it so it doesn't cover the center point (because of the bug)
    13. Go back to the action panel, select the action again and set it to 0 opacity
    14. Give the action the value of your choice. This can be coins or points, depending on your setup
     
  3. jerry

    jerry Avid Boxer

    Joined:
    Sep 25, 2015
    Messages:
    421
    Likes Received:
    232
    Thats awesome that you are finding your own answers!! Now you know and will help with memory retention. Good job.
     
    Bllaaa likes this.

Share This Page