Discuss Scratch
- Discussion Forums
- » Questions about Scratch
- » Less Lag?
- turkey3
-
Scratcher
1000+ posts
Less Lag?
If I was Bill Gates, I would hire you to bug test Windows 9 and suggest improvements on how to reduce lagYou just did for mouse over, my sprites also change if the mouse if HELD DOWN but not yet let go, because of that, it did not work.
Do you mean in the example project I just made? -If so, yes, sure, that only has an example for mouse-over.
But that project wasn't directed specifically at your project (I've made… several… posts… in the forums for other Scratchers, as well as some… project… comments -it's probably the most common lag issue Scratchers run into).
The demo project was more a general demonstration of the issue, along with a conceptual solution (waiting for something, rather than looping) that would hopefully be taken and used in a more specific way as needed. -And something I could link in future when posting again on the same topic…
But for your case, I did outline a solution in the scratchblocks of an earlier post in this topic.
The mouseover was done in one script (very similar to the example project), but the click-and-hold case is dealt with in the second script (“when this sprite clicked”).
Actually, if you look at the scripts for the button at top-right of that demo project, you'll see I did implement very much the kind of thing you're after (if you hold down the mouse button and drag on/off the sprite, it also changes).
I think that should be pretty much the same as what you're after, so go take a look at that, too!
I really don't know a single person who knows as much about lag as you.- Kyle2Death
-
Scratcher
100+ posts
Less Lag?
You just did for mouse over, my sprites also change if the mouse if HELD DOWN but not yet let go, because of that, it did not work.
Do you mean in the example project I just made? -If so, yes, sure, that only has an example for mouse-over.
But that project wasn't directed specifically at your project (I've made… several… posts… in the forums for other Scratchers, as well as some… project… comments -it's probably the most common lag issue Scratchers run into).
The demo project was more a general demonstration of the issue, along with a conceptual solution (waiting for something, rather than looping) that would hopefully be taken and used in a more specific way as needed. -And something I could link in future when posting again on the same topic…
But for your case, I did outline a solution in the scratchblocks of an earlier post in this topic.
The mouseover was done in one script (very similar to the example project), but the click-and-hold case is dealt with in the second script (“when this sprite clicked”).
Actually, if you look at the scripts for the button at top-right of that demo project, you'll see I did implement very much the kind of thing you're after (if you hold down the mouse button and drag on/off the sprite, it also changes).
I think that should be pretty much the same as what you're after, so go take a look at that, too!
I can't make it work.

- Swampert11
-
Scratcher
1000+ posts
Less Lag?
The project might lag because you are using Flash 11.8 which if a project uses the color effect block, it will lag,but Scratch team is working on a fix,or the project might use a lot of scripts.
Last edited by Swampert11 (Sept. 18, 2013 03:14:10)
- Kyle2Death
-
Scratcher
100+ posts
Less Lag?
Ok, I frond out that I run 11.8 of Adobe Flash and it still works for me.
- DadOfMrLog
-
Scratcher
1000+ posts
Less Lag?
Ok, I frond out that I run 11.8 of Adobe Flash and it still works for me.Wow, I'm amazed it manages! What spec computer do you have?
[EDIT: Ah, silly me… yes, of course, your colour effects are all zero unless the answer button is pressed, so you're not applying any effects most of the time! Does it lock up your browser if you hold down your mouse button for a few secs on one of the answer buttons? Though if the script below doesn't lock up, then it means you've not got the really bad problem with your flash player anyway, so most of the lag we get in your project is mainly down to all the costume switching…]
If you start from a new project (only the cat costumes) and add the following script:
when green flag clicked…what happens?
forever
change [color v] effect by (1)
Anyway, you said it's not working - can you be more specific about what's not working (is it the answer button mouseover while holding button down? Is the normal mouseover working fine?) And can you show an example of what you've done to the scripts? (I didn't see any changes when I checked the project, so are you working on a copy, or offline?)
We should be able to get there, so don't give up!
Last edited by DadOfMrLog (Sept. 18, 2013 12:00:49)
- DadOfMrLog
-
Scratcher
1000+ posts
Less Lag?
If I was Bill Gates, I would hire you to bug test Windows 9 and suggest improvements on how to reduce lagI really don't know a single person who knows as much about lag as you.
I normally try my best to avoid Windows, so that's rather unlikely to happen

Actually, concerning the unnecessary computation done by Scratch when it switches costume to the same costume (i.e. when it shouldn't really need to do anything, but does), it's not the sort of thing I was that likely to discover from the kind of projects I've been making (mainly pen-rendered 3d - so no costumes required…)
It was griffpatch who first made it clear that continual costume-switching (even to the same costume) was A Bad Thing. I was rather surprised by this, so did some further checking for myself and found the same was true of other ‘non-changes’ (i.e. effects, resizing, rotating). Of course, he found those out for himself too…
Having that knowledge was key to him making his Scratchnapped game able to run as smoothly and efficiently as it does.
It's really key to getting any reasonably large game, with lots of sprites/clones, to run smoothly!
- Kyle2Death
-
Scratcher
100+ posts
Less Lag?
After poking around a little, it's not the repeats that makes my game lag (for me,) but the effects, and repeating the “set color and brightness to 0” does not lag the game, it's intill I move my mouse over it when it starts to lag because of the effect change.
Does it lock up your browser if you hold down your mouse button for a few secs on one of the answer buttons? No, it does not.
Does it lock up your browser if you hold down your mouse button for a few secs on one of the answer buttons? No, it does not.
Last edited by Kyle2Death (Sept. 18, 2013 20:55:52)
- DadOfMrLog
-
Scratcher
1000+ posts
Less Lag?
Does it lock up your browser if you hold down your mouse button for a few secs on one of the answer buttons? No, it does not.Yet you have Flash 11.8? That's curious… I would have thought continual setting of colour like this would cause pretty severe problems.
How about if you run the simple script I mentioned above?
Anyway, have you got anywhere rescripting your mouse-over-while-holding-button? If not, can you post a snippet of your revised scripts (or else put it into one of the sprites of your project so we can see it)?
Thanks!
Last edited by DadOfMrLog (Sept. 19, 2013 14:56:29)
- derpmeup
-
Scratcher
1000+ posts
Less Lag?
Good thing Scratch 1.4 is still availablePlease don't necropost. Thanks!

- CobraCommand3r
-
New Scratcher
2 posts
Less Lag?
I am new to scratch and everyone keeps talking about using screen refresh to reduce lag. Please tell me how to program screen refresh as I can't find the command.
- THEBUTT849
-
Scratcher
12 posts
Less Lag?
Thanks! Can you provide a link? Or is it unshared? And are you using graphic effects?What are your computer specifications?
-RAM
-processor
Are you using graphic effects? Those cause a lot of lag.
I have 4GB of RAM
Intel(R) Pentium(R) CPU B980 @ 2.40GHz
No I am not.
Link? Do you mean the project? It's one of my Projects, http://scratch.mit.edu/projects/12392662/
However, when I play it in the 1.4 Offline Editer, It does not lag in full screen.
Intel graphics are horrible
- Discussion Forums
- » Questions about Scratch
-
» Less Lag?




I really don't know a single person who knows as much about lag as you.



