Need help: having a enemy shoot toward you

0 favourites
From the Asset Store
Give Sound to the enemies that are part of your game! :)
  • Hi, I need help figuring out a level. I want to have an animated ninja in the center of the screen throw stars toward you the player (the screen)

    When the stars hit a certain point they cause damage. I want to add this to my game ninja slice. Which already has a fruit ninja type level.

    The ninja slice is here:

    dropbox.com/s/kobuoqqc9lldbgc/Ninja_slice_shurikan.capx

    When you reach level 2 you can see the ninja throwing sprite and the ninja star sprite. But that's as far as I got.

    Any tutorials for something like this?

  • I forgot to mention I need the star to grow as it moves toward the screen.

  • I tried downloading your link but it says you saved it in version 148 and I am using 146. The current downloadable version is 146. Is there a way around this?

  • on the main scirra.com page navigate to the bottom of the screen.there you will see the 2 releases. the stable one (146) and the beta one (148).

  • Stain that's perfect. THANKS!

    Roccino thanks I downloaded it.

    Stain how could I set the stars to cause damage? Would having them cause damage if they leave the screen be the way to go?

  • Stain I managed to get the stars to bounce off when sliced by the mouse but I can't seem to get them to bounce off at the same size (they appear small) and back toward the ninja.

    I used a destroy sprite (star) when sliced and spawned a new star from that point but they fly off anywhere and not from large to small. The idea is to deflect them back at the ninja and he takes damage.

    Any ideas what I'm doing wrong?

  • you don't have to destroy and create I think. Just set bulletangle towards star.oldx star.oldy

  • I tried that but it's giving me an incorrect syntax.

    I then tried sending it to the sprite (throwing ninja) but they still bounce randomly.

  • It should work this way. No destroying or creating anything.

    slice is overlapping sprite10 - sprite10 set bullet angle of motion : angle(sprite10.x,sprite10.y,sprite10.spawnx,sprite10.spawny)

    I tried it with on touched and it worked.

  • Great!

    As I progress through this each step creates new challenges. Now when trying to have the star cause damage to the ninja that throws it by setting up a collision it automatically collides when spawned. I tried making the polygon collision area smaller but it seems to still kill itself.

    Any idea's on how to have it span stars that are redirected back to it to kill it but not kill it right off at the beginning?

  • Give the star a CanHurtNinja boolean variable and set it to false..

    In the same event you redirect the star set the variable to true

    star on collision with ninja

    if CanHurtNinja is true

    • Hurt Ninja.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Got it but I'm stuck on how to set it up to hurt the ninja.

    I created a variable NinjaLife=10

    But I can't get from the CanHurtNinja=true to it actually killing the little bugger.

  • star on collision with ninja

    if CanHurtNinja is true

    • star destroy
    • ninja subtract 1 from ninjalife

    ninjalife = 0

    • ninja destroy

    or something similar..

  • I can't seem to pull up the 'if CanHurtNinja' is true to get through it.

    It is set but I'm having trouble pulling up that option.

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