0 Favourites

[r112] Problem with diagonal movement + shooting

  • I want to be able to shoot diagonally (using the space key to fire) while also moving diagonally. Up + right diagonal movement works (while holding down the space key to fire), but up + left, down + right, and down + left diagonal movement doesn't work (while also holding down the space key to fire).

    Also, if you're already moving up + left, down + right, or down + left, and then start pressing the space key to shoot (while still moving diagonally), it won't shoot, but if you do the exact same thing while moving up + right, it will shoot.

    I don't think it's something that I'm doing wrong (event-wise and etc), since I've also seen this very same problem happening in other people's tutorials, and capx files with their events and etc, set up in both similar, and different ways. It seems to be an actual bug with the interaction between the keyboard controls, and the bullet behavior. Diagonal shooting while also moving diagonally works fine if you're using mouse buttons to shoot, but not if you're using the keyboard controls/keys to shoot.

    Here's a modified version of the default top-down shooter template with the diagonal movement + diagonal shooting problem using keyboard controls:

    Diagonal Movement + Shooting Bug Version 1

    Here's another capx file that doesn't use the 8 direction movement plugin like the first capx file uses, but instead uses custom made movement using instance variables, and events. In this capx file, you can only shoot forward, which is intentional, but it still has the same problem that I described in the second paragraph. Also, in this capx file, you're suppose to be able to shoot forward no matter what diagonal movement you're using (up+left, down+right, etc), shooting and moving up + right works fine, but up + left, down + right, and down + left doesn't.

    Diagonal Movement + Shooting Bug Version 2

    I'm using:

    Construct 2 beta release r112

    Windows 7 (64-bit)

    NVIDIA GeForce GTX 560 Ti with the latest driver (306.97)

    Browsers tested in:

    Chrome (Version: 23.0.1271.97 m)

    Firefox (Version: 17.0.1)

    Internet Explorer 10 (Version: 10.0.9200.16439)

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Closing as not a bug: most keyboards cannot reliably detect three keys held down simultaneously. This is due to the hardware design and it is not possible for any software to fix this. It also varies depending on the keyboard: mine can shoot while going top-right, bottom-right and bottom-left, but not top-left!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
233 22,251
TiAm's avatar
TiAm
Unread hot topic
0 Favourites
Path Movement Behavior
98 52,472
R0J0hound's avatar
R0J0hound
Unread hot topic
98 7,597
norum82's avatar
norum82