Discuss Scratch

Elm0-_-
Scratcher
100+ posts

How to make collisions

I want to have a sprite collide when it touches a certain color, but the coordinates are all messed up. How can I make a collision?
Zippy0426
Scratcher
99 posts

How to make collisions

definemovesteps:stepsrepeatstepssetlast valuetoxpositionchangexbyxspeed/stepsiftouchingcolor?thensetxtolastvaluesetx speedto0setlast valuetoypositionchangeybyyspeed/stepsiftouchingcolor?thensetytolastvaluesety speedto0movesteps:absofxspeed+absofyspeed
Zippy0426
Scratcher
99 posts

How to make collisions

btw the speed variables can be static numbers (single number during certain parts like 10 walk speed while not in water and 4 walk speed while in water) or velocity (increasing and decreasing)
Elm0-_-
Scratcher
100+ posts

How to make collisions

Zippy0426 wrote:

definemovesteps:stepsrepeatstepssetlast valuetoxpositionchangexbyxspeed/stepsiftouchingcolor?thensetxtolastvaluesetx speedto0setlast valuetoypositionchangeybyyspeed/stepsiftouchingcolor?thensetytolastvaluesety speedto0movesteps:absofxspeed+absofyspeed

Zippy0426 wrote:

btw the speed variables can be static numbers (single number during certain parts like 10 walk speed while not in water and 4 walk speed while in water) or velocity (increasing and decreasing)
Thank you so much.
Zippy0426
Scratcher
99 posts

How to make collisions

Elm0-_- wrote:

snip
Thank you so much.
your welcome
8bitrkt
Scratcher
500+ posts

How to make collisions

Zippy0426 wrote:

-snip

Isn't this just griffpatch's classic platformer tutorial? nevertheless, it works wells.
Zippy0426
Scratcher
99 posts

How to make collisions

8bitrkt wrote:

Zippy0426 wrote:

-snip

Isn't this just griffpatch's classic platformer tutorial? nevertheless, it works wells.
yea but it can still be used for multiple other things besides just a simple platformer, im even using it in a undertale engine that im making (for the box that the soul heart is in during a fight )
Elm0-_-
Scratcher
100+ posts

How to make collisions

Zippy0426 wrote:

*snip*
I'm using this for a Hello Neighbor mod I'm working on.
hvjhvlzl
Scratcher
3 posts

How to make collisions

Elm0-_- wrote:

Zippy0426 wrote:

definemovesteps:stepsrepeatstepssetlast valuetoxpositionchangexbyxspeed/stepsiftouchingcolor?thensetxtolastvaluesetx speedto0setlast valuetoypositionchangeybyyspeed/stepsiftouchingcolor?thensetytolastvaluesety speedto0movesteps:absofxspeed+absofyspeed

Zippy0426 wrote:

btw the speed variables can be static numbers (single number during certain parts like 10 walk speed while not in water and 4 walk speed while in water) or velocity (increasing and decreasing)
Thank you so much.

wait so where do i put move steps: (( of (x speed)) + ( of (y speed))) ? if im using w a s d to walk

Last edited by hvjhvlzl (Jan. 27, 2025 18:28:42)

Powered by DjangoBB