Keyboard and Gamepad problems - Shooting

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.
  • Hey guys,

    So I have this really, really bizarre problem.

    I have an OR event, On Key Pressed "OR" On Gamepad Key Pressed - spawn object at image point.

    Here's the thing, if I trigger the event with the keyboard, the object is spawned ahead of the image point, if I use the gamepad, the object is spawned at the image point.

    Any reason this would happen?

  • Never observed that ( doesn't mean it didn't happen ), but I'd guess it might have something to do with latency compensation.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Can't think what would cause this, but I'd be very interested to see it in action. Could you share a capx?

  • I can't share the .capx because it's my full game, but I can put a link to download an outdated exported NW.js version. ... sp=sharing ... sp=sharing

    Anyone of these should do, I think.

    (FYI, the font isn't pixel because I'm using a custom font and I used text boxes instead of spritefont, I tried a program that was

    Basically, when you shoot using the controller, it spawns at the image point properly, when you run however, the spawns a little behind the image point.

    When you shoot using the keyboard, it shoots ahead of the image point, and never changes its spawn point relative to the character, so there's no spawning behind where it normally would while running like the controller version does.

    The sad thing is, I can't reproduce this so Ashley won't really give a y'know what. (Kind of impossible to distil 374 events into less than 40).

    I've tried a number of possible solutions, like deleting the object that's supposed to spawn in Construct 2 and replacing it with another made from scratch, doing the same with the object that spawns it.

    I tried a unique fix that worked for me before when events weren't working properly which was to delete the object and events, recreate it, and then recreate it's events all from scratch, which didn't work.

    I ended up settling for making a separate event tree specifically for the keyboard firing, which used a different image point about 8 pixels behind the proper image point (this is on a 256x224 in-game screen, so it's pretty huge visual difference) and now it spawns nearly at the exact same spot when you're not moving, otherwise the gamepad shots spawn behind where they're supposed to. The only problem with this is that now the keyboard shots have slightly reduced range, by the difference in distance from the two image points, so the gamepad shots go further than the keyboard shots (until you get Long Beam, then this becomes a moot point).

    I thought this might be due to JavaScript being a garbage collecting language as I think Ashley(?) put it, also I heard that C2 writes using JavaScript, so yeah.

    Also, I tried disabling literally all my events except for the events needed to shoot to try to confirm what is triggering the bug and it still appears even with everything else turned off. Still appeared even after doing the same thing with a new set of events after deleting the old ones.

  • C2 is buggy!

    On a layer below i have objects. I spawn bullets above but the bullets fly below these objects. Shooting with mouse.

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