Help me with my first time using (null) is touching (null)

hopscotch
helpwithcode

#1

Ok so what I want to happen is that the entire time of the project a heart is trying to move back. When the heart is touching a border that is 99% invisible I want it to move forward. So, when the heart is touching the border, it stays still. When it's not touching the border, it slowly moves back. Well, at least that's what I want it to do. So, I put these two codes:


Instead of doing what I want it to do, it just scoots back and forth until it's not touching the border and it goes to the end of the screen. I forgot to say, the heart starts on the border. Please help me!


#2

Well, because Move Forward -5 is in a Repeat Forever, it will keep moving -5 no matter what. When it touches the border, it tries to move 5. That means it moves 5, moves -5, moves 5, etc. forever.

You need to use values to tell it when it is not touching the border. I'll get back to you to tell you how to do this. I don't remember exactly..


#3

Here's some code ideas.

WHEN (Heart) x position is greater than( Border) x position
Change x By -5

Hope this helps. It's a bit difficult to understand what you are trying to do.
Are you wanting the heart to bounce off the wall, or to hit the wall and stop?
Or you can code FLIP when touching boarder while using a move forward -?


#4

No, @Stradyvarious. I'll put it this way. It's like, you will have to do something repeatedly for it to move somewhere, at the same time, it tries to move to the beginning again. (The border)