Change from bullet back to 8-way

Get help using Construct 2

Post » Sat Feb 08, 2014 1:56 am

I'm trying to change my player character from a bullet to an 8 direction behavior... only problem is, it 'remembers' the angle I had going into the bullet, and puts it back when I disable the bullet behavior... which makes it look ridiculous.

So what I did, was before re-enabling the 8-direction, I put:

Player : Set Angle -> Player.Bullet.AngleOfMotion

Yet that does nothing, and continues to act wierd. What am I doing wrong?

Thanks guys.
B
47
S
15
G
3
Posts: 201
Reputation: 4,625

Post » Sat Feb 08, 2014 4:11 am

I think you should use the angle of the object instead. So I would imagine that right before you change it to 8 direction behavior you can just save the angle of the player character and just do what you did already with that angle.

Player: Set Angle -> Angle_as_Bullet
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,828

Post » Sat Feb 08, 2014 5:28 am

The problem is, the angle of the player changes after I'm done making the player a bullet. Hard to explain, so just check out the example... you'll see what I mean.

Capx file

If you go up, you'll see the 'player' jump into the gravity zone... once it's in there, it falls back into the gravity free zone... upon re-entry, it decides "I'm going to look back up" instead of continuing to face down.

I've left the "angle" code out, mainly to keep it simple... no matter what I have tried, it does the same behavior.

Any ideas?
B
47
S
15
G
3
Posts: 201
Reputation: 4,625

Post » Sat Feb 08, 2014 6:07 am

It appears that there is some sort of 8-direction key press buffer that is active even when the behavior is turned off. If I just tap the arrow up key very briefly so that the sprite moves into the gravity zone then it works ok, but if I long-press the up arrow key when the sprite is already above the line then the duration of that key press seems to have some impact on whether or not the sprite will misbehave.

Not sure what the answer to the problem might be, though. If you just want to simulate falling due to gravity then using custom movement or taking more control of the default 8-direction behavior might be a better option (I've found that mixing movement behaviors like this is often more trouble than it's worth).


Edit - link deleted: the solution is posted below...Colludium2014-02-08 15:57:08
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
73
S
19
G
66
Posts: 2,198
Reputation: 42,188

Post » Sat Feb 08, 2014 6:18 am

[QUOTE]Not really a fix but certainly a work-around. Just my 2 pence...[/QUOTE]

Thanks for the effort, but it just doesn't seem as fluid as it should this way. Also to note, that it's not acting like an object would if it were to jump... almost seems like it hits a wall, then fall straight down.

I don't know what else I can do though. :(
B
47
S
15
G
3
Posts: 201
Reputation: 4,625

Post » Sat Feb 08, 2014 6:24 am

Yeah, I know. It's late and I could have put more time to it - I'll have a look to tomorrow. The custom movements are great but if you want more or a different effect I don't think they play nicely together..
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
73
S
19
G
66
Posts: 2,198
Reputation: 42,188

Post » Sat Feb 08, 2014 7:31 am

Hopefully you, or someone else can come up with a solution. :) It's late.. I probably should go to bed. Here's hoping that there is an answer in the morning! :D
B
47
S
15
G
3
Posts: 201
Reputation: 4,625

Post » Sat Feb 08, 2014 2:44 pm

Anyone?
B
47
S
15
G
3
Posts: 201
Reputation: 4,625

Post » Sat Feb 08, 2014 3:55 pm

@Nitro187,

Apologies for the delay, I was busy tinkering with my all-absorbing project.

This should do it:

capx

The changes from version 1 that I couldn't think of doing after some beer and the hour of midnight were to transfer the speed values between the behaviors. Now works a treat!

Ed

PS I just saw the bug report - there might not be a need for it as it might be deliberate and it's easily managed....Colludium2014-02-08 15:55:33
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
73
S
19
G
66
Posts: 2,198
Reputation: 42,188

Post » Sat Feb 08, 2014 4:05 pm

[QUOTE=Colludium]The changes from version 1 that I couldn't think of doing after some beer and the hour of midnight were to transfer the speed values between the behaviors. Now works a treat!

Ed

PS I just saw the bug report - there might not be a need for it as it might be deliberate and it's easily managed....[/QUOTE]

Wow... dude... amazing. This is exactly what I want and need. Thank you so much!! :D Beer eh? I owe you one on me! :D

As for the bug report, you could be right, I just figured maybe they should know about it, in case it's not.   Thanks again so much! :)
B
47
S
15
G
3
Posts: 201
Reputation: 4,625

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 16 guests