Need some help on some code - please look


So, if you have a series of large rectangles organised across the screen, and have them moving left (

Repeat Forever
Change X by -1024
Set position X 1024, Y 404

It is moving left and resetting its position beautifully! But, once its position reaches 0 the whole large rectangle will disappear and go to 1024 X. This is supposed to happen, but you can see it reset its position, so at 0 and 1024 there is a gap, and then the rectangle suddenly appears!

The objective of my question:
"Is there a way that large blocks can move across the screen with the illusion that it is coming from the "outer screen" and NOT showing when the large object reaches 0 it disappears and appears at the position 1024"

(A rectangle isn't the shape I'm using, that's just an example.)

Please help


List (127 tags)
Get the latest list here:

I need some help, on a game

@ThinBuffalo? @Stradyvarious?


You can make it set it's position outside of the screen, so you can't see it. Then you let it move across the screen until it reaches a position outside the screen where you can't see it. There you reset it.
@t1_hopscotch has invented a nice technique for making "Repeat until" blocks.


Ok. Thanks.

How would "repeat until" blocks be relevant to this? I looked at @t1_hopscotch's code for this before.


That doesn't exactly work.


Actually it doesn't work at all



It sounds like you may be using Move Forward or Change X/Y. Those blocks only result in objects being displayed on the screen. Don't ask why, that's just the way THT decided to make the blocks work.

To position an object off of the screen, just use Set Position. Make sure X position is < 0 or > 1024, or that Y position is < 0


Use Set Position and Wait in a repeat block to move your shapes off the screen.


Yes, that's what I mean. Use set position until (repeat until) it reaches outside of the screen.


Tag me again if you haven't figured out how yet.


Ok, here's what you do:

What happens is, the block starts at -1124, 100 off the screen, it moves to 0 by removing 1124 from its X position. Then, it sets its position to [its position- 10 ] 10 times so that it is once again, 100 off the screen (10x10=100) this should make a smooth transition into it starting again. Play with the numbers if you like.


Sorry that I don't have much time to add more things to others

it is true in relation to what you brought up with 'Move Forward vs Set Position' from ThinBuffalo and what Jojo and CreationsOfANoob added

More on repeat until in a project here though I don't use it for this later on.

Now that you say that, COAN, I didnt even really think of myself as inventing it or anything :thinking: until I searched up that project (wow, it looks pretty old from the date). it was partially inspired I guess by Emily from THT's projects (Dr. Em) using abilities inside each other for fractals.

I dont really claim credit for it though, hehe it just seems as natural in Hopscotch as when people used to use Repeat 9999999 when there was no Repeat Forever — using this in replacement of a Repeat Until)

I think a quick way for you BlastFusion might be to try replacing Change X by -1024 to:

Repeat times 1200
    Set Position X: (x position - 1) Y: 404

and then see how it goes (does it pop off the screen at the end?) and then you can change the other Set Position to an X coordinate that is further to the right of the screen

this doesn't explain much at all right now sorry :joy: I will add more in addition to any comments on this later on. (I am heading off the forum at the moment :upside_down:)


Adding an extra column?


Try using variables to work around the problem.


A Do While Loop, while completely valid, isn't necessary here since the number of loops required for the movement is known in advance.

2 nested loops (one for the number of "steps" in each pass across the screen & one for the number of times to move across the screen) is likely a simpler approach for most to understand since Do While Loops are not a native Hopscotch functionality.

Similar to other's suggestions I'd use this. I just added the Speed variable to demonstrate how to easily change that characteristic of the movement since the Speed property doesn't apply here. Note: 55 is just the min distance to get my particular object off the screen. 110 is 2x since the full movement is into view, across the screen, & out of view.


Everyone besides ThinBuffalo, I have tried the set position method, and it isn't suitable for my scenario. I have cloned objects which need to be a certain distance apart and a laggy iPad will have a positional difference compared to a fast iPad.


Oh yeah, this is a old draft since I have been working on this for ages. I don't think I have self.


Im screwed eh?


You could try edit the JSON files and hack Self into your project


What? Ha? Hack? How?


I can't restart. And use self. I've done so much.