How do I Shooting Advanced shooting animation

0 favourites
  • 5 posts
From the Asset Store
Shoot balls to destroy as many blocks as possible, at each stage the game will become more difficult.
  • Good afternoon friends of scirra lovers of the creation of videogames, because the situation in which I find myself is that I create a basic animation for a platform game only aim and shoot pretty good by the way, I got it by watching the video tutorials of Jeremy Alexander (Jerementor), whom I thank infinitely for everything he teaches us. The question begins when I get a pretty good sprite which contains in your animation to shoot 4 frames. Aim with the weapon, the detonation and two more frames of the movement of the gun back. And the problem is that when I use the method of Jermentor only makes a frame and not see the other 3, I'm going crazy looking for how to achieve it but I still can not do it, beforehand I hope to excuse my English and hopefully some of the masters of This great forum could help me to solve this situation, greetings and in advance thanks.

  • Is it that you want the bullet to spawn from the gun on the detonation frame (frame 1) rather than the 1st frame (frame 0)? If so, you could use something like this:

    1. On shoot key pressed | set playing sprite animation "shoot" from start.

    2 If sprite.animation "shoot" is playing, if sprite.animationFrame = 1 | spawn bullet from sprite at (gun origin).

    You will need to add an origin point at the position of the barrel of the gun on the sprite, where you want the bullet to spawn from.

    A word of warning about spawning the bullet partway through an animation: unless your animation is very quick and short (or you have a deliberately long wind-up phase for your shot) it is best to spawn the bullet at the first frame because otherwise you may be introducing a noticeable lag into the shooting mechanic, which can make the game feel unresponsive.

    If this isn't what you're after please could you link to specific video you're talking about, or include a capx?

  • Is it that you want the bullet to spawn from the gun on the detonation frame (frame 1) rather than the 1st frame (frame 0)? If so, you could use something like this:

    1. On shoot key pressed | set playing sprite animation "shoot" from start.

    2 If sprite.animation "shoot" is playing, if sprite.animationFrame = 1 | spawn bullet from sprite at (gun origin).

    You will need to add an origin point at the position of the barrel of the gun on the sprite, where you want the bullet to spawn from.

    A word of warning about spawning the bullet partway through an animation: unless your animation is very quick and short (or you have a deliberately long wind-up phase for your shot) it is best to spawn the bullet at the first frame because otherwise you may be introducing a noticeable lag into the shooting mechanic, which can make the game feel unresponsive.

    If this isn't what you're after please could you link to specific video you're talking about, or include a capx?

    Sure friend, look, in the first video I show something similar to what happened to me, I did not stay in that animation, but if you realize it only points and the shot goes out.

    youtu.be/rBQ1eE7bKvA

    Now I can solve it in a way, now the problem is that when I jump and keep pushing the button of shot they leave up to 4 shots and it does not look good that, apparently it is a simple bug and if it is needed more I can upload what you ask me To review it in the following video I leave a sample of what I'm talking about.

    youtu.be/BIoW1WoselY

  • Looking at the code from the first video, I think your problem may be that the event 2 "Is shooting" condition will trigger every tick until frame 3 is reached. Try adding a "Trigger once while true" to that event - you can combine them rather than making it a sub event but make sure it follows on from the "Is shooting" condition e.g.:

    Event 2: obj_player | Is shooting | trigger once whilst true

    Not:

    Event 2: obj_player | trigger once whilst true| Is shooting

    If you PM me the code I can confirm for you that this is the case.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sorry, that's not entirely correct - you'll need to make another change:

    Events 4 -6 in your code should be under another main event:

    obj_player is playing "ID_SHOOTING"

    Adding the "trigger once" to Event 2 will prevent the ID_SHOOTING animation from triggering and resetting to normalAttackAnims every tick.

    Adding the new main event means that the code will only check the animation frames while ID_SHOOTING is playing.

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