Turret Sprite Sheet

0 favourites
  • 15 posts
From the Asset Store
- This pack is suitable for shooting games, running games, platform games, and side-scrolling...
  • Hello,

    I'm working with the template turret game and would like to spruce up the graphics. I have a couple of turret sprite sheets but do not know how to properly set it up so that it animates correctly. Can anyone point me in the right direction?

    Thanks in advance for any help.

  • First and foremost you should read the manual entry for the animation editor. Here it is.

  • Go through the basic tutorials as they cover animations.

  • Thanks for the replies. I understand setting up animations and spritesheets - just not incorporating animations with the turret behavior. I'll keep digging. Thanks again.

  • Although I've read all the material suggested here, I'm also having trouble animating turrets. Like jbarker281, I have been unable to find answers.

    Specifically, I want my object with the turret behavior to animate differently depending on what angle it's at. For example, when my turret rotates towards its target, instead of simply rotating the sprite towards the target, I want it to play animations I have set up when it rotates to specific degree angles. Is this possible?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Check the current angle and then set your animation frame based on it

  • The issue with using animation as opposed to rotation on turrets is that the sprite editor considers the right hand edge to be the "front" of the sprite. Best would be to use rotation but have animation frames for your effects while it rotates.

  • Thanks a bunch for the comments, I appreciate it. You may have pointed me in the right direction, I'll mess around a bit and see what I can manage.

  • <font face="Arial, Helvetica, sans-serif"> Hey, do you have any luck with this??

    I am also trying to figure out how to correctly set up this, but it seems that it will require a LOT of events to handle all the animations required for the rotation. <img src="smileys/smiley5.gif" border="0" align="middle" /> </font>

  • Yes, I've actually made some progress since yesterday thanks to BluePhaze's tips. I don't think I used the best method, but I actually got it working and not with TOO many events.

    Keep in mind I'm using Construct Classic, not Construct2, so my angles and stuff may be different than yours. But basically what I did was make sure the angle is being checked whenever the turret is moving, or not moving, and then I assigned animations to every possible angle. Here's how:

    Turret - Is moving

        Turret: Angle >= 61

        Turret: Angle <= 119     Turret: Set animation to "Down"

        Turret: Angle >= 120

        Turret: Angle <= 150     Turret: Set animation to "DownLeft"

        Turret: Angle >= 151

        Turret: Angle <= 209     Turret: Set animation to "Left"

    And so forth until I'd covered all possible angles. Then I repeated for when the turret's not moving, and it seems to be working ok so far.

    This is the link to what I've got: ppl.ug/gZdoYdSJfxc The turret is the player, you control it with up, down, left, and right. Press "e" to make it acquire target and fire. It should automatically rotate, with animations, towards the "enemies" (red x's).

    But now I'm wondering if I can get some more help. As you can see from my example, I want the player to control the turret. And I want it to aim at enemies and fire, using the animations which I've provided, which seems to be working. However, I want the turret to stay angled towards the target, even when the player is moving the turret. For example, in top down shooters where you control where the player points using the mouse, but he can move freely without aiming all over the place. I want to accomplish that, but with the turret automatically finding targets and keeping aimed at them while the player moves. Any ideas?

  • Sorry I don't know if the link worked in the last post. Let's try agian. Here ppl.ug/gZdoYdSJfxc

    EDIT:

    Nevermind, ignore that. I can't post links yet, apparently. You'll just have to copy/paste ;)

  • SirAwesomeface Great name by the way!

    I have not looked at your example, but something like this should work.

    If you have a reticule sprite use that and have it position itself on to say the nearest enemy to your tank.

    then simply have the turret set its angle to the reticule.

    Enemy dies have the reticule set itself to the next nearest enemy...

  • <font face="Arial, Helvetica, sans-serif"> I'm using Construct 2, and the problem that I'm facing is that the sprites (and animations) are kinda isometric... so, the handle of the angle is somehow tricky... what I was trying yesterday was to have an invisible circle as the turret, and the isometric sprite pinned to the "turret", get the angle of the tower and compare it to the angle of the aniamtion in order to detect if the animation should go clockwise or counter clockwise... But it didn't work.

    </font> <img src="smileys/smiley19.gif" border="0" align="middle" />

    <font face="Arial, Helvetica, sans-serif"> I'll try something different today, and update here if got something useful.</font>

  • welfo , at the place of rotating the object himself ... create an object called *Object-Name*_Angle and put it in a container ...

    Then , add all the events related to the rotation in a such way that the object doesn't have anything and is only an animation ...

    Then , follow sirthingyIdontrememberhisname's tip , don't forget to assign those events to Object_Angle ...

  • I was searching for an answer to the isometric problem myself for a while. I'm not sure if this is exactly what you guys were trying to explain above, but I thought I'd post my solution:

    capx file

    Try it

    I made a simple turret in blender and saved png renders at every 45 degrees to create my animation frames for a total of 8 frames. Note that it would probably look a lot smoother compared to my exmaple saved every 22.5 degrees for 16 frames.

    I then created a sprite with turret behaviour to act as a place holder to acquire and generate my angle towards the target. I created another sprite to hold my turret animation frames and created an image point at the end of the cannon in each frame. You'll want to place them into a container.

    I created 8 events checking the angle of the turret sprite corresponding to 22.5 degrees before and after my turret angle and actions to change the turret animation to the correct frame as seen below.

    I then simply spawn a bullet from the animation (image point 1 created earlier) rather than the turret whenever the turret is able to shoot.

    <img src="http://i.imgur.com/5e0pygr.jpg" border="0">

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