Discuss Scratch

alberto85
Scratcher
14 posts

Sprites not disappearing off the screen

Hi!

I got a weird problem with a project. I am going to share it if necessary, but for now I don't think it's needed.

There are objects moving on the screen, and they are not sprites moving with the standard moving blocks. I just have one sprite, and the positions of the objects are recorded inside lists, and then a script renders them by moving to the stored position, changing the costume appropriately, and leaving a stamp. A different script makes all the changes to the lists of positions. This way I can have an accurate simulation, even when the objects are off the screen.

Now the problem is: some of these objects appear to leave the screen completely, some stay on the border as normally sprites do in scratch. And I don't understand why. I noticed that when I have three objects (this is how I used it the most up to now), the second on the list goes off the screen, and the third doesn't, so I thought it was the last that was always showing, and I tried some solutions, like adding another one that was not stamped, but this doesn't seem to change anything. Also, when I have more objects, they are all (or many at least) behaving as expected, so why does this number two disappear??

Note: this is not too important, I am going to add a border or something, I just don't understand why the different behavior.
footsocktoe
Scratcher
1000+ posts

Sprites not disappearing off the screen

Costume center determines whether a sprite moves off screen.

If costume center is in the center of the sprite, sprite will still show half of itself.

If costume center is on left side of sprite, sprite can move off screen stage right but not stage left.

If costume center is on right side of sprite, sprite can move off screen stage left but not stage right.
alberto85
Scratcher
14 posts

Sprites not disappearing off the screen

These are all circles with the center in the center (I did it by hand of course, but…) and then I duplicated and changed color, so the centers should all be in the same place. The sizes are different, but I checked, if I exchange the positions on the list, it's the smaller one that disappears, and the bigger one that remains… Always the one in the second place… ??
footsocktoe
Scratcher
1000+ posts

Sprites not disappearing off the screen

That's the only idea I have about it.
asivi
Scratcher
1000+ posts

Sprites not disappearing off the screen

Try with something like this https://scratch.mit.edu/projects/94359628/

Greetings.
alberto85
Scratcher
14 posts

Sprites not disappearing off the screen

That's interesting… I don't really understand why it works, but thanks for sharing! It still doesn't explain what's going on with my sprites, since I don't think I made them artificially bigger.. Anyway, this is not extremely important, as I said, I was just curious!

Thanks!
alberto85
Scratcher
14 posts

Sprites not disappearing off the screen

I have now shared the project, if you want to have a look it's here.

Now when they get too far off they just disappear, so you can't see the problem. Even if you change that part, I don't seem to be able to reproduce the problem.. maybe it was just some weird bug.. I am quite sure I did not imagined it!

Powered by DjangoBB