Discuss Scratch

--ThatCrownedKing--
Scratcher
100+ posts

I need help! Urgently!

So, I am trying to finish this game today, but I have caught on a new problem.
Whenever the snail is on screen, the game literally lags! It literally crashes, but only if you are not in the editor!
Please! I need help fixing the enemy collision and some suggestions too!…….



Thanks, if you helped!

when green flag clicked
if (game is fixed) then
wait (.8) secs
say [hoooorrraaay!!!!!] for (Forever) secs
end





Hello! I am –ThatCrownedKing–!!!
I create amazing projects for people to enjoy!!!!

See my amazing projects here!!

All my projects!!!

I'm definitely a professional scratcher
deck26
Scratcher
1000+ posts

I need help! Urgently!

So which project is this?
--ThatCrownedKing--
Scratcher
100+ posts

I need help! Urgently!

https://turbowarp.org/582768187/

I'm definitely a professional scratcher
--ThatCrownedKing--
Scratcher
100+ posts

I need help! Urgently!

The snail's collision is acting a bit funky

I'm definitely a professional scratcher
--ThatCrownedKing--
Scratcher
100+ posts

I need help! Urgently!

Please play this instead! https://turbowarp.org/582768187/editor?interpolate

I'm definitely a professional scratcher
deck26
Scratcher
1000+ posts

I need help! Urgently!

Your snail has custom blocks set to run with no screen refresh and these MUST complete within a limited time or they'll lag badly. So any wait blocks should be excluded but any loops must also complete quickly. You have a repeat until that changes x by a calculated value but you then change the variable that means any further calculations will change x by 0 and your repeat until boolean can never be true. You do this for x and for y. Disable the ‘no screen refresh’ or fix these.

Last edited by deck26 (Oct. 16, 2021 19:14:51)

--ThatCrownedKing--
Scratcher
100+ posts

I need help! Urgently!

Can you please remix the project to show me what you mean?

I'm definitely a professional scratcher
deck26
Scratcher
1000+ posts

I need help! Urgently!

You have something like this

repeat until <not <touching [something v]  ?>>
change x by (( ([abs v] of (myval)) / (myval) ) * [-1])
set [myval v] to [0]
end
so what do you think will happen on the second pass through the repeat? The value is 0 so x won't change so if the sprite was touching before that pass of the loop nothing will change. No other scripts can change that if the script is running with no screen refresh so you have an infinite loop. The custom block can't complete and the project is stuck until it times out.

Haven't time to remix but this shouldn't be hard to understand.
Mark50infinityking
Scratcher
22 posts

I need help! Urgently!

--ThatCrownedKing-- wrote:

So, I am trying to finish this game today, but I have caught on a new problem.
Whenever the snail is on screen, the game literally lags! It literally crashes, but only if you are not in the editor!
Please! I need help fixing the enemy collision and some suggestions too!…….



Thanks, if you helped!

when green flag clicked
if (game is fixed) then
wait (.8) secs
say [hoooorrraaay!!!!!] for (Forever) secs
end





Hello! I am –ThatCrownedKing–!!!
I create amazing projects for people to enjoy!!!!

See my amazing projects here!!

All my projects!!!


Set snail custom block by right clicking the “Define (your snail custom block name)” then, click edit and undo the run without screen refresh.

Powered by DjangoBB