How do I choose a enemy?

0 favourites
  • 8 posts
From the Asset Store
Pixel Enemies for SHMUP consists of 45 enemy ship sprites to be used in your game.
  • hello everyone, I would like to know how to choose an enemy manually.

    Let me explain better, I have 5 enemies on the screen, the viewfinder automatically positions itself on the nearest enemy, but I would like to do, that with any input, mouse, keyboard, etc. ... I can scroll through all the enemies and select an enemy of mine choice, and if I don't even choose one, that the cycle has to start over.

    I hope I have explained, I thank in advance whoever wants to help me, thanks to you soon

  • hey guys can anyone help me?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The explanation isn't great and we can't see what you're seeing so have to imagine it. Guessing though, you could give enemies an instance variable numbered 0,1,2,3 etc and use a global variable alongside it. Always point the view at the enemy where the instance variable matches the global variable. If you're moving left/right with the keyboard you can subtract/add 1 from the GV. So if GV=1 it points at the enemy where enemy.variable=1

  • it doesn't work for me. you see the game is a platformer, so there are not always the same static enemies on the screen, but they appear and disappear as the game goes by. so the variable on enemies should be automatically assigned whether the enemy is on screen or not ..... hope I was clearer ....

  • Help me please.....

  • If they are constantly updating then you can keep clearing the variable values for all enemies then use for each (ordered) by X that means from left to right across the screen to renumber them. Or you could trigger this whenever an enemy dies, or some other way.

  • nothing, after a few weeks of trying, I could not get everything to work.

    Nobody could post me a small screenshot or a capx of the dynamics to be performed ...... I'm stuck !!!please!!!

  • Share the project file of what you tried and I can take a look

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