Discuss Scratch

RT_Borg
Scratcher
1000+ posts

Other Places/Methods to Receive Scripting Help (Updated)

TinyWasBored wrote:

Hello. I dont know if im using this correctly. just recently learned about the forums. Im having trouble coding wall collision. My game is a shooter up top based game. https://scratch-mit-edu.ezproxyberklee.flo.org/projects/712486356 . cant find any way to do wall collision. i tried making a custom block. If you could help that would be great

Hi TinyWasBored, welcome to Scratch!

In the future, it's best to make a “New Topic”in Help with Scripts to ask your question.

But since I happened to spot your message, I'll answer here:

Try this instead:

// define with "Run Without Screen Refresh" checked on
define Move
change x by (Speed x)
change y by (Speed y)
if <touching [Wall v] ?> then
change x by ((0) - (Speed x)) // undo the moves
change y by ((0) - (Speed y))
set [Speed x v] to (0) // see note below
set [Speed y v] to (0)
end

when green flag clicked
forever
... // pointing and keyboard
set [Speed x v] to ((Speed x) * (0.8))
set [Speed x v] to ((Speed x) * (0.8))
Move::custom // This instead of the way your script ended
end

In the define, I set the speeds to 0 if touching the wall. This will cause the sprite to stop flat. You can get a little bit of a bouncy effect if you use
set [Speed x v] to ((0) - (Speed x)) // bouncier
set [Speed y v] to ((0) - (Speed y))

I hope this helps. I think most people who regularly help in this forum look for new posts they can help with (by their titles) so if you need more help on this or anything else, create a new topic.

– RT_Borg
jfmpatrick
Scratcher
48 posts

Other Places/Methods to Receive Scripting Help (Updated)

I made a scrolling engine and got it to work, but it became extremely laggy, almost crashing my chromebook! I added a game loop and made all the custom blocks run without screen refresh, but it didn't fix the lag and now the level clones won't show. I have no idea what to do.

Last edited by jfmpatrick (Nov. 9, 2022 17:48:36)

jfmpatrick
Scratcher
48 posts

Other Places/Methods to Receive Scripting Help (Updated)

I can't get this scrolling engine to work. When I first made it, I got it to work, but it became extremely laggy, almost crashing my PC! I made a game loop, and modified the other code to make it work with the game loop, but it didn't fix the lagg problem and the level clones stopped appearing. The project is here: https://scratch-mit-edu.ezproxyberklee.flo.org/projects/704075693
Danil_R00
Scratcher
4 posts

Other Places/Methods to Receive Scripting Help (Updated)

привет пишу на форуме чтобы стать скретчером
play sound [ pop] until done
SteffenChu
Scratcher
28 posts

Other Places/Methods to Receive Scripting Help (Updated)

when green flag clicked
if <touching [Youv]> then
end
SteffenChu
Scratcher
28 posts

Other Places/Methods to Receive Scripting Help (Updated)

Meow
BrianGao892
Scratcher
5 posts

Other Places/Methods to Receive Scripting Help (Updated)

This is like stack overflow, but with scratch.
Miggy6695
Scratcher
100+ posts

Other Places/Methods to Receive Scripting Help (Updated)

But true
Miggy6695
Scratcher
100+ posts

Other Places/Methods to Receive Scripting Help (Updated)

when green flag clicked
mightyjebus
Scratcher
2 posts

Other Places/Methods to Receive Scripting Help (Updated)

change [wideness] effect by (25)
mightyjebus
Scratcher
2 posts

Other Places/Methods to Receive Scripting Help (Updated)

don't know why but there
rafapablos4791
Scratcher
97 posts

Other Places/Methods to Receive Scripting Help (Updated)

I changed the block colors into Tynker's. But the Tynker Blocks' shape not.
triton888
Scratcher
44 posts

Other Places/Methods to Receive Scripting Help (Updated)

mendelz wrote:

how do you get the Distance to a clown?
Use the distance block in Sensing
ruby-sparkles
Scratcher
24 posts

Other Places/Methods to Receive Scripting Help (Updated)

Anyone have any good tips?
jaycool112233
Scratcher
100+ posts

Other Places/Methods to Receive Scripting Help (Updated)

yes
rafapablos4791
Scratcher
97 posts

Other Places/Methods to Receive Scripting Help (Updated)


rafapablos4791
Scratcher
97 posts

Other Places/Methods to Receive Scripting Help (Updated)

Mod Share
proscratchplayer2012
Scratcher
17 posts

Other Places/Methods to Receive Scripting Help (Updated)

hi



when green flag clicked
set [clicks v] to [o]
newscratchalli
Scratcher
87 posts

Other Places/Methods to Receive Scripting Help (Updated)

crashbandicootsthe1
Scratcher
34 posts

Other Places/Methods to Receive Scripting Help (Updated)

the project that needs to be fixed

I need help.

Can anyone remix and fix the (definitely) unfixable bugs in this game. Remixes with the fixed bugs will be In the original game.

Bug-squishers will be in the end credits of the game.

Let's get the project to What the Community is Remixing! (mostly bug-squishers)

Also the topic's here if you want to help:

https://scratch-mit-edu.ezproxyberklee.flo.org/discuss/topic/631979/?page=1#post-6632600

Edit 2 : post #420 how

Last edited by crashbandicootsthe1 (Sept. 29, 2022 04:53:54)

Powered by DjangoBB