Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How to get collisions?
- kung-fu-fighter23
-
Scratcher
49 posts
How to get collisions?
Well I am using stamped objects instead of clones and need to know how they detect collisions with each other and no I cannot use a
<color [#cbdbf5] is touching [#49e84b] ?>since The two objects are gradients pls help!
- Dami2464
-
Scratcher
52 posts
How to get collisions?
You can solve it with something like this…
when green flag clicked
forever
if <<key [... v] pressed?> and <not <touching [Barrier v] ?>>> then
move (...) steps //Or change x, or y... whatever
end
end
- NMario84
-
Scratcher
1000+ posts
How to get collisions?
They're saying that they are using stamps instead of clones here. However, you can still use the (touching) block with a 2nd sprite, which would not be a clone.
Though If you prefer all stamps, you could make the sprite invisible via ghost effect and still detect as another sprite1 touching sprite2, I guess, before you do your stamping process.
maybe something like this, as an example.
Though If you prefer all stamps, you could make the sprite invisible via ghost effect and still detect as another sprite1 touching sprite2, I guess, before you do your stamping process.
maybe something like this, as an example.
when green flag clicked
forever
clear all stamps
move objects
check collisions
do stamping process
... // Etc...
end
Last edited by NMario84 (Yesterday 20:23:35)
- HAL95131
-
Scratcher
500+ posts
How to get collisions?
… I am using stamped objects instead of clones …
you have to predict if the player is going to move into a tile/sprite spot using lists and then set the x or y velocity to 0 accordingly
Last edited by HAL95131 (Yesterday 20:23:49)
- Discussion Forums
- » Help with Scripts
-
» How to get collisions?