Change from bullet back to 8-way

0 favourites
  • 10 posts
From the Asset Store
Change the size and position of everything without calculating anything!
  • 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.

  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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?

  • 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...

  • ot really a fix but certainly a work-around. Just my 2 pence...

    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. :(

  • 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.. �

  • 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

  • Anyone?

  • 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! <img src="smileys/smiley1.gif" border="0" align="middle">

    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....

  • 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! <img src="smileys/smiley1.gif" border="0" align="middle" />

    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....

    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! :)

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