frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register

I think I've a bug, can someone have a look?

I think i've a bug because no matter what I do I cannot get my enemies to turn on collision. Please see below - I have collision set to only left and right and Toggle as the response.

bug 1

just in case something here is causing it.
bug 2

My problem is on level 2 and unfortunately i can't seem to directly link to it.
http://flowlab.io/game/view/220443

Comments

  • Hey Laura,

    I took a look at your game, and I think that the flowlab behaviors are working correctly in this case. Here's what is happening:

    1) the x velocity is always set to "4" which means that the cat will always move to the right
    2) the collision trigger causes the sprite to "flip", but it still has a velocity of "4", so it doesn't change direction.

    I think what you want instead is to set the "Forward" velocity to "4", so that the cat will begin moving the opposite direction when it touches something.

    This is a really simple fix, but depending on the speed and bounce of the cat, it may still get "stuck" occasionally if it doesn't move away from the object it touches quickly enough, since the collision will continue to trigger, and the cat will flip back and forth. To prevent this problem, you can a switch and a timer to your collision, so that it can't fire any faster than a second or so.

    Here is an example of everything I explained above, let me know if you have any questions:


    Screen Shot 2015-10-17 at 9.39.10 PM
  • @grazer That's brilliant! Thank you for your help it's really appreciated!
Sign In or Register to comment.

flowlab.io

| make games in your browser
@ 2017 Flowlab.io, All rights reserved.

Contact us

Get In Touch