Tank Turret movement w/ mouse or keyboard?

0 favourites
  • 6 posts
From the Asset Store
Try to destroy your enemies in a hard battle! Good luck!
  • My tank is always facing right in my game. I only need a turn radiousof 3 positions on either side of center. How do I turn the turret but not the tank? Should I use mouse or keyboard for movement since it will only turn a few degrees.

    • Every Tick
    • > Set Turret Angle towards Mouse.X Mouse.Y
    • Turret.Angle > 35
    • Turret.Angle <= 180
    • > Set Turret.Angle 35
    • Turret.Angle < 325
    • Turret.Angle > 181
    • > Set Turret.Angle 325

    You can change the 35 and 325 degrees to different numbers for more/less of a turret sight.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Try this, I made for try, move turret with mouse and shoot with left mouse botton <img src="smileys/smiley1.gif" border="0" align="middle" />

    williamjcrow.altervista.org/file/tank.capx

  • Thanks for the replies.

    Sorry for the newb question but do I need to make the turret a seperate sprite from the tank? Also, how do I accomplish that?

    Again, thanks for any help. This is actually my first attempt at game making, except for the 2 beginner game tutorials.

  • Well I'm newbie too, and I do just some tutorial and I still read manual, but I don't have lot of time, anyway, sure if U made 2 different piecesit's better and he take just a few line of blocks, follow my file, use COW lines and I think it going good :D

  • I finally got the turret to stay on the tank and to move along with it. (Yeah for me!) The turret is shooting and the bomb follows the angle of the turret.

    BUT! If I mouse click in quick sucession each bomb will follow the angle of the turret. It looks kinda cool actually. Like they're dancing. But yes, that is not what I want.

    So, how do i get the bombs to follow thier own path after they are created and not diverted by the new angle of the turret.

    Also, my tank drives off screen and I have bound to layout.

    Almost done, How do I get the bomb to bounce off the edge of the layout, like pong or breakout? It will explode after it hits either the enemy base or the enemy tank?

    And again, thanks for all the help.

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