How can I fix this?



I am making like this story thing, I want to make star girl move right 100 and then flip like someone barges in and she looks at the person and moves back kind of. But, instead what happens is she redoes it over and over again, quickly moving across the screen flipping back and forth, why is this happening? This is the very simple code I put in:


By the way, I tried switching the blocks but the same thing happened. HELP


You Have To Do Negative 100 Like This -100 :wink:


I Think... Hmmmmmmmmmmm


No, she goes to the right, and I believe that would make her go left. But I'll try it anyways!


Nope, she does the same thing, just going to the left. I want her to turn and back up. As in go to the right. NOT the left.


I can help with this @Hoppertoscotch! The Change X by and Change Y by blocks do not work with the flip block, as flipping does not affect what increasing or decreasing the X or Y position of a character means, and that is exactly what the Change X by and Change Y blocks do. However, the Move Forward block does work with the flip block, so if you replace your Change X by block with a Move Forward block, it should work. :blush:


Will star girl still go to the right when she flips?


@Mathgirl I tried doing that, it still doesn't work. Star girl just kind runs back and forth. Left, right, left, right. HEEEELLLLPPP!!!!


Oops, I thought that was what you wanted it to do, but I must have misread your post. I reread it, but I don't see what went wrong, your code looks fine to me.


@Hoppertoscotch this is a great question and great description of the problem. And @Electronixguy and @Mathgirl good points with the -100 and Move Forward block and I was thinking the same thing.

Let's look at it in more detail and plan it step-by-step :smiley: This makes it easier for us to know what we have to code and see what could be going wrong.

I just have one question though: What is the When at the top of the rule? e.g. When the play button is tapped, When iPad is tapped, When __ equals __ etc. It looks like you've got something that keeps repeating and keeps getting triggered, and that's why the code keeps repeating.

So is this what you want Star Girl to do:

Star Girl starts facing right
She moves forward to the right 100
She flips and faces the left, to where someone has barged in
She moves backwards to the right, but still faces left to the person


When a value equals 1


No, I don't mean that, I meant in to discriptions. #1: star girl is facing right and moves right then flips #2 star girl flips and moves right, as in, walking backwards. There was a typo in my first question.


So pretty much want her to do what anyone would do if they were suddenly interrupted, or some barged in. Sorry about the typo.


Oops, meant to say someone, not some.


@t1_hopscotch here is a better picture of the code:


That's okay, that's why I wanted to make clear :smile:

So the code for that would be:

Change X by 100

And the next step:

Change X by 100

And ah yes I thought it would be something like When ___ equals ____. It's because the whole time while the Value equals 1, Star Girk will repeat this code. If you only want her to run this code once, add this to the bottom of the rule:

Repeat Forever

That means Star Girl will run the code once and wait forever, and she won't run it again.

Let me know if you need to clarify something


thanks so much! Let me see if that works....


Ok it works, thanks again, @t1_hopscotch! You're such a big help! Now I can finally continue this!


For Star Girl to move to the right make a rule that does what the screenshot does