I am confusion now.
Try it. What position does on the square does it go to?
If I do a āSet Position to x (((Square)Width) / 2))ā then it is across to the left side of the screen
What if you add that to the squareās x position? THen what?
If I am on the right side, then if it bumps it would just back the player out of the block which is what I want. If I go to the left side, it just teleportās me to the right side of the square, but not touching it.
How would you make it bump you out the left side, if adding the width goes to the right?
Subtracting makes the more sense. But if I subtract it it will just go off screen to the left side of the screen.
Why will it do that?
If the block is gonna be āSet position to x, (((Square) Width / 2) - (Self) X Position)ā. Then this is my prediction why it could do that.
When it is The frogs set position, we will be looking at the ā(Square) Width / 2ā, that will make it go to the center of the block(Iām pretty sure/most likely), but with the subtraction of the x position it would go all the way to the left position of the screen. Because of the āX Positionā of the frog being subtracted from the squares width. So if Frogs X position is 490, then it would be something like 37.5(half of the squareās width) - 490, making it go all the way to the left side. Donāt know if Iām right but itās the best I can think of it going that way.
But āSet position to x, (((Square) Width / 2) + (Self) X positionā works so that is what I am questioning right now. It should go to the right side of the screen because of that, but instead hits the right side of the blockā¦
OH, wait I think itās because it makes the number negative going to the other side of the screen making the equation negative, instead of positive SO⦠I have to use a Absolute value. oH my gosh i finally accomplished somethingā¦
Now since I have completed the side bumps, I need to create a āCheck Once Ifā block so once it hits the right or left side of the block it will do that function. Iāma try finding it myself for now⦠if I canāt then Iāma need some assist points from you.
Also, Iām surprised this is the only Topic on āDebug my Codeā that is actually still a kinda alive.
what!? wow.