Make a turret movement but by arrow keys

0 favourites
  • 4 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I know how to provide control from keyboard keys.

    I have this sprite which consists of a turret base, and a turret head (sort of a pistol barrel) which I want to rotate when shooting at enemy.

    Now I want to rotate the turret head about the point where its base lies in the turret base.

    Please look at the image

    <img src="http://s7.postimage.org/6nq9qstnf/Untitled.jpg" border="0" />

    The circled part is about which I want to rotate the turret head, using left and right arrow keys.

    I tried to add 'Rotate' behaviour to turret head, and I also use 'Pin' and pinned it to turret base, and then I applied keyboard event to make smooth clockwise and anti clockwise rotation of the turret head about the point.

    But what happened wasn't what I expected. The turrethead's end completely goes off the turret base, the rotation isn't smooth (i tried different speeds and acceleration values).

    I just don't know how to do this simple thing.

  • Here is an simple example:

    Rotating turret

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks. I'll look into it and tell you later how useful was it.

  • I have release r119.

    when I open the project, i'm being told that this project was made using r121 version, and can't be opened.

    Could you just tell me what's being done in the project ? What behaviour or settings are being used? I just need to know that little bit.

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