ghostaustin's Forum Posts

  • 5 posts
  • I'm trying to make a system where the player can pick up blocks, then throw them left, right, up, or down. What's happening right now is the first time the player lets go of a block, it gets thrown to the right, regardless of what direction the player is facing/aiming. The second time the player lets go of the block, it seems to work as intended.

    Can anyone tell me why the first throw is always to the right, but subsequent throws can be aimed as intended?

    Here's a screenshot of the events in question:

    And here's a playable example:

    construct.net/en/free-online-games/block-example-87657/play

    Note that I only have gamepad controls for picking up/throwing at the moment. I'll try to incorporate the keyboard in the future.

  • The event configuration in the screenshot I posted above works pretty well. I'm considering this problem solved, so thank you all for your help! Here's an example of what I was trying to accomplish, if anyone is interested. Note that I only have gamepad controls for picking up/throwing at the moment. I'll try to incorporate the keyboard in the future.

    construct.net/en/free-online-games/block-example-87657/play

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You should put the foreach condition at the bottom of the event block. At the moment construct will pick all blocks then evaluate them, rather than only looping over blocks whos conditions return true.

    You way will still work correctly, but if you have lots of blocks it wont be as efficient.

    I gave that a shot, but it ended up grabbing all the blocks in the stage, then catapulted them out of the player at all angles. Not the desired effect, but it did look cool!

  • Perfect, thank you!

    Here's what I ended up going with, for anyone else following:

  • Hi, newbie here. I've searched the forums, tutorials, and FAQs, and tinkered with all kinds of different events and configurations, but I can't seem to find a fix for my problem that I understand.

    I'm making a platformer where the player can pick up and throw blocks. This works great if I only have one block on the screen, but it doesn't work for two blocks. When two blocks (2 separate instances of the same object) are spawned, and the second block is picked up, the "throw" action only affects the first block that was created regardless of the distance from the player, leaving the player holding the second block without being able to throw it.

    Any help would be much appreciated! Thanks!

  • 5 posts