8 Direction object not working as intended

Get help using Construct 3!

Post » Sun Jun 11, 2017 3:06 pm

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?
B
5
Posts: 8
Reputation: 241

Post » Sun Jun 11, 2017 3:10 pm

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.
B
52
S
22
G
12
Posts: 729
Reputation: 11,724

Post » Tue Jun 20, 2017 7:38 pm

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
B
22
S
12
G
1
Posts: 108
Reputation: 2,774

Post » Fri Jun 30, 2017 5:38 pm

Anonnymitet wrote: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.

the_Shit_hawk wrote: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.
B
5
Posts: 8
Reputation: 241

Post » Fri Jun 30, 2017 10:24 pm

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.
B
33
S
18
G
28
Posts: 2,479
Reputation: 20,922

Post » Wed Jul 05, 2017 2:13 am

the_Shit_hawk wrote: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.[/quote]


Subevent
system - trigger once while true then have action as your sound
B
22
S
12
G
1
Posts: 108
Reputation: 2,774

Post » Wed Jul 05, 2017 2:14 am

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.
B
22
S
12
G
1
Posts: 108
Reputation: 2,774


Return to How do I...?

Who is online

Users browsing this forum: No registered users and 0 guests