dop2000's Forum Posts

  • You can combine all objects into a hierarchy, and then move them all with a single action.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • After you re-enable the behavior (or immediately before disabling it), set its vector X and Y to 0.

  • Here you go:

    dropbox.com/scl/fi/ll81tlpy14kxmaqcn43qn/GamepadAim.c3p

    See events #9 and #10

  • There are two problems with events 9-12 in your project: they run on every tick, and they don't update unoccupied bases. That's why I suggested using debug mode - you could've spotted this sooner.

    When you have "PS Overlapping Base ... Else ...", "Else" condition in this case doesn't mean "all instances that are not overlapping". It means "if the previous condition did not pick anything". So as long as PS is overlapping at least one base, the Else condition won't work.

    Ideally you need to update bases once only after the object has arrived.

    You also need to pick the right PS instance. Picking the nearest is not always correct. When a button is clicked, pick the bases connected to it, and then pick PS instance overlapping these bases.

  • You can run the game in debug mode and check if the occupied variable is set correctly.

  • however, they do not return to the previous base when I click the same button.

    Maybe you are not clearing the occupied status of the base?

    Maybe this is the solution, but how do you specify which bases are connected to the buttons in the code?

    There are several ways. Since every button is connected to one or two bases, you can define two instance variables: connectionA, connectionB. Manually configure them for every button. When a button is clicked, pick bases with ID=Button.connectionA or ID=Button.connectionB

    But the solution with the overlapping paths is probably easier.

  • First, you need to move "Base is not occupied" condition above "Pick nearest". But that won't fix the problem completely, because the nearest base will not always be the correct one. For example here the nearest unoccupied base for blue sprite is the one with the green circle:

    You need to pick only the bases which are connected to this button. You can use the Path sprite if you extend it slightly so that it overlaps Base sprites.

    Button is overlapping Path
    Path is overlapping Base
    Base is NOT occupied
    Pick nearest Base
    

    Or you can give unique IDs to each base and specify on the button which bases it's connected to.

  • I use the current layer numbers to spawn objects in event sheets, so they will be on the wrong layer if I dont manually change all of them

    That's why you should always name your layers properly and use layer names (not numbers) in all events.

  • You need to configure templates.

    And then create object Text_tx with the desired template name:

  • You can't compare Text_tx.text while it doesn't exist on this layout.

    The feature you are probably looking for is templates. Configure each text as a template, give them different template names. Then you will be able to create a particular text instance by specifying template name.

  • Just make sure to add "For each button" if there are multiple buttons, otherwise they may get stuck in enlarged state.

    For each Button
    Button Tween is NOT playing
    ... Mouse Cursor is over Button : Tween to larger size
    ... Else: Tween to Default size 
    
  • You can add an invisible sprite, add ScrollTo behavior to it and it will be your camera.

  • I believe instances are ordered and processed by their z-index. So A with the lowest z-index will be moved to B with the lowest z-index, and so on.

  • I'm using scripting when I need to call a function by name, it's much easier than setting up mapped functions.