help with script for Physics and Collisions with a scrolling project

id: 726972

category: Help with Scripts

posts: 6

There is this project im trying to make. I need help with four way collision scripts that build of the collision scripts already there (link to the project below) and allow for going up hills and being hit by moving objects.




link: https://scratch.mit.edu/projects/933869482/
All collision detection scripts can be reduced down to the basics - initiating incremental movement, then running a conditional to check for contact with any platforms/objects and reverting back to the previous coordinates if needed. The project already utilises this using colour detection so it’s a simple matter of replicating it for movement on the x-axis.

This article provides a more in-depth tutorial if needed.
1Milj 1Milj loading
Have you tried making the game check if touching the level runs a custom block without screen refresh to bring it up immediatly? I don't know if it will work and if you use a touching sprite block then you might want to search for a tutorial on how to detect certan collisions.
mhhsg mhhsg loading
scratch message pls add block physics and throwing physics
mhhsg mhhsg loading
define (physics)
go to [ block and push]
56-s 56-s loading
A very simple way of doing it is this

when green flag clicked
forever
change y by (-10)
if <touching [ ground] ?> then
change y by (10)
end

or you could replace it with a change x by code so you don't go thourgh walls.