8 Direction object not working as intended

0 favourites
  • 7 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • Hello there!

    So right at the moment, I have a title screen with logo and extra stuff, yadda yadda yadda. I have it so that when I press ENTER, two sprite objects, one being stationary and the other having a sine behavior (that gets disabled by pressing ENTER), will move down and out of the layout. However, when I go to run it, the objects only move a pixel or 2 when I press ENTER.

    Can't print screen it for some reason to put as an image on here so I'll just write out the events for the layout

    (Both objects that are having this problem are displayed at the beginning of the project, with the 2nd object's sine behavior active)

    On start of layout:

    * Play looping song and set web font

    * Wait 1 sec

    * Display title logo and "Press ENTER" message

    * Set an instance variable to True. This is to avoid the player from pressing ENTER too early.

    When ENTER pressed and Hi true:

    * Play a sound

    * Disable the 2nd object's sine behavior

    * Simulate both objects pressing down

    Can anyone help me out?

  • Use "when enter is down" and Hi is true simulate pressing down.

    If you use "on enter pressed" then it works as a trigger and it will not move the objects for more than a tick.

  • youre simulating down but only while its pressed. if youre trying for a fade away effect, i suggest just using another variable. when enter pressed set variable to 1, if variable 1 simulate control down

  • Use "when enter is down" and Hi is true simulate pressing down.

    If you use "on enter pressed" then it works as a trigger and it will not move the objects for more than a tick.

    Now it works only when I hold enter down, meaning the objects won't move offscreen with a simple press, and the sound that plays during the press repeatedly plays whenever I hold down the button.

    youre simulating down but only while its pressed. if youre trying for a fade away effect, i suggest just using another variable. when enter pressed set variable to 1, if variable 1 simulate control down

    Now it moves as intended (for the most part, but I can adjust that), but the sound that plays won't stop playing. I've tried making it so that it would only play once, but then it does the same thing as before.

  • Give both objects an instance boolean 'GetTheHellOut', starting state = false

    When ENTER pressed and Hi true:

    * Play a sound

    * Disable the 2nd object's sine behavior

    * Set boolean 'GetTheHellOut' to true for both objects

    Is boolean 'GetTheHellOut' true (for that object)

    * Simulate object pressing down

    Is boolean 'GetTheHellOut' true (for that other object)

    * Simulate object pressing down

    Need some method now to destroy or stop them moving.

    You can also use 1 Global variable instead of an instance boolean. Same method.

  • youre simulating down but only while its pressed. if youre trying for a fade away effect, i suggest just using another variable. when enter pressed set variable to 1, if variable 1 simulate control down

    Now it moves as intended (for the most part, but I can adjust that), but the sound that plays won't stop playing. I've tried making it so that it would only play once, but then it does the same thing as before.

    Subevent

    system - trigger once while true then have action as your sound

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • the sound as a subevent should allow the while down to work proper but may not be needed. just didnt want the trigger once while true to set you back to moving 1 tick.

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