Discuss Scratch

EggDOG_MyNAME--Jeff
Scratcher
100+ posts

Run Without Screen Refresh Confusion

Hi! I'm making my science project on scratch (Well turbowarp), but I figured I could still get help on the forums about this. One of the sections in the project is a board game, and I have everything working except for one thing: the board isn't generated instantly. I decided to go on and continue to work, but this just keeps bugging me. If you look in the “Grid” sprite under the custom block named “Draw Grid: Limit” you should see the scripts for the board creation. Here' the link https://turbowarp.org/?clones=Infinity&size=960x720
I've tried making the custom block run without screen refresh but it just breaks the whole generation process. The clones are just generated on top of eachother. Please help, I don't have much time. I'm especially looking for help from @deck26

Last edited by EggDOG_MyNAME--Jeff (Aug. 22, 2022 02:00:20)

legendary34678
Scratcher
1000+ posts

Run Without Screen Refresh Confusion

Hello! I think you linked the wrong project.
EggDOG_MyNAME--Jeff
Scratcher
100+ posts

Run Without Screen Refresh Confusion

Oh, sorry. I guess since it's not shared on scratch it doesn't show up on turbowarp. I'm not sure how to share it
I put the save file on this scratch project, https://scratch.mit.edu/projects/722093932/ , you can download the file and open it on turbowarp, i set the custom stage size to 960x720

legendary34678
Scratcher
1000+ posts

Run Without Screen Refresh Confusion

Actually, unshared projects can show up on turbowarp (or at least I think they still do). When I clicked the link you provided, I was taken to a project that only had a single sprite with no code anywhere. That's why I said you linked the wrong project.
Alberknyis
Scratcher
1000+ posts

Run Without Screen Refresh Confusion

The problem you're facing is i guess a downside of running without screen refresh; Since the screen doesn't refresh, none of the clones are actually placed on the screen yet, so it doesn't have any black colour to detect. This doesn't matter too much as you're working with tiles. The amount you need to move sideways after each clone is always the same. Just find that amount and move that distance instead of repeatedly moving 1 pixel.
deck26
Scratcher
1000+ posts

Run Without Screen Refresh Confusion

What is the Draw Grid custom block actually trying to do? Describe in words, not in code please.
EggDOG_MyNAME--Jeff
Scratcher
100+ posts

Run Without Screen Refresh Confusion

Wow, that's smart. But as for @deck26, It's drawing the grid. It creates a clone, and then it uses a custom run without screen refresh block to move over 1 pixel until it's not touching the color black, or the edge of the tile. Then it creates another clone. This is repeated until the grid consists of 599 squares, although I wanted this to be a smaller number.

You see, my project requires 20 tiles and 25 question cards, but even after looking at your project with pen grid creation, I couldn't find out how to implement it into my project, as some variables weren't changing when the tiles were being generated.
deck26
Scratcher
1000+ posts

Run Without Screen Refresh Confusion

But why does it do the bit regarding not touching black or the tile edge? If the grid and tiles are known size you shouldn't need to check.
EggDOG_MyNAME--Jeff
Scratcher
100+ posts

Run Without Screen Refresh Confusion

That's true, I changed it to where it has a fixed with and height change like you both said. But it still doesn't generate instantly for some reason. I didn't put the x axis reset block (for making a new row) in the block that makes it move across. I'm unsure if this will help, as I read on the wiki that motion blocks have a delay.

Powered by DjangoBB