[BEHAVIOR] Sonic Physics

Post your work in progress addons and get feedback

Post » Sun Nov 12, 2017 5:46 pm

hey @pixelmonkey,can you give me a copy of the sonic physics behavior but instead of the jumo button being the up arrow can be the the letter z from the keyboard?
B
5
S
2
Posts: 5
Reputation: 435

Post » Tue Nov 14, 2017 8:00 am

@XtremeBlueTronic
You can do this by using the "Simulate Control" action.
B
78
S
28
G
12
Posts: 130
Reputation: 11,946

Post » Tue Nov 14, 2017 4:21 pm

@pixelmonkey but the problem with the simulate control is when you hold the key with the simulate control, the character keep jumping instead of stopping
B
5
S
2
Posts: 5
Reputation: 435

Post » Sat Nov 18, 2017 12:02 am

@XtremeBlueTronic
Right, I see what you mean. Definitely a bug, but I'm not really sure how specifically I broke it, and with the mess that the code is in I don't really have the time to dive in and try to fix it, sorry.
B
78
S
28
G
12
Posts: 130
Reputation: 11,946

Post » Thu Nov 23, 2017 4:30 pm

XtremeBlueTronic wrote:@pixelmonkey but the problem with the simulate control is when you hold the key with the simulate control, the character keep jumping instead of stopping


I use a workaround myself involving custom controls. I have an <Input>Pressed boolean that turns false at the end of each tick after all other events have run in that tick (so it only registers true once) and an <Input>Held variable that adds 1*dt to itself depending upon how long the control is held. Then I use the "on floor" and "is jumping" conditionals of the Sonic Physics in the Player object for further control.

Image

Works really well, not a whole ton of set up.

This behavior is really great, but if you want to use it you're going to have to find some creative workarounds, and possibly modify the behavior's runtime javascript to get it to work how you want.
B
104
S
37
G
9
Posts: 319
Reputation: 12,259

Post » Sun Jan 07, 2018 10:00 pm

@TL22
do you have the download of your <Input>Pressed boolean plugin,or it is pure coding in construct 2
B
5
S
2
Posts: 5
Reputation: 435

Post » Mon Jan 08, 2018 11:04 am

XtremeBlueTronic wrote:@TL22
do you have the download of your <Input>Pressed boolean plugin,or it is pure coding in construct 2


A boolean is just a variable.

In C2, the only available boolean is via an Instance variable.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
138
S
31
G
88
Posts: 5,638
Reputation: 61,207

Post » Tue Jan 09, 2018 4:04 am

XtremeBlueTronic wrote:@TL22
do you have the download of your <Input>Pressed boolean plugin,or it is pure coding in construct 2


I use a plugin called Global Variables. You can find it in the addons subforum, I think under completed. As Zenox just said though, a boolean is just a variable. Specifically a variable that only has a true/false or on/off state, effectively 0 and 1. You can achieve the same effect with "If JumpPressed = 1". I like the Global Variables plugin a lot though because it helps me keep things organized with larger projects.
B
104
S
37
G
9
Posts: 319
Reputation: 12,259

Previous

Return to Work in Progress Addons

Who is online

Users browsing this forum: No registered users and 0 guests