Discuss Scratch

AudstarDiamond
Scratcher
32 posts

How to make a sprite slide down a slope?

I want to let this sprite be able to slide down a slope, but can't figure out how this would be done.
petme
Scratcher
100+ posts

How to make a sprite slide down a slope?

me too
drmcw
Scratcher
1000+ posts

How to make a sprite slide down a slope?

Depends what you mean by slide. Most games will cheat and just glide a sprite along a path otherwise you're talking about physics simulations and then how far down the modelling route you want to take it. It'll get complicated pretty quickly. e.g https://scratch.mit.edu/projects/140751896/
lolad
Scratcher
54 posts

How to make a sprite slide down a slope?

Which way does the slope slide?
If right, do something like:

pointindirection90repeat5move5stepschangeyby-5

or left do something like:

pointindirection-90repeat5move5stepschangeyby-5

Or, just do -
You could have a sprite at the end called endSlope and do:
glide1secstox:0y:0
replacing 0 and 0 with the end coordinates.
Like drmcw said
“Most games will cheat and just glide a sprite along a path”

Hope you found this helpful
AshFyre
Scratcher
1 post

How to make a sprite slide down a slope?

I'm trying to do this as well… i can't figure it out!!
hSaif111
Scratcher
2 posts

How to make a sprite slide down a slope?

guys check out my first scratch two games.
deck26
Scratcher
1000+ posts

How to make a sprite slide down a slope?

hSaif111 wrote:

guys check out my first scratch two games.
Please don't advertise here - use the Show and Tell forum.
gtoal
Scratcher
1000+ posts

How to make a sprite slide down a slope?

1) use the usual formula for gravity
2) adjust the y component by sin or cos of the angle of the slope. determine the x from the y is the easiest way
paul0708
Scratcher
27 posts

How to make a sprite slide down a slope?

use a glide1 sec to block
AudstarDiamond
Scratcher
32 posts

How to make a sprite slide down a slope?

Thanks for all of the suggestions. I'll try them out and see how I go.
toonizz
Scratcher
9 posts

How to make a sprite slide down a slope?

I know a very simple way of making a sprite slide down a slope! First of all, you wanna click on the sprite you wanna make slide down the slope. Next, you wanna grab
whenclickedandplaceitinthesprite.Then,youwannagrabaforeverorarepeatdependsonifuwanturspritetokeeponslidingdownorstopslidingatacertainpointandplaceitinthatsprite.Afterthat,youwannagrabachangexby10andachangeyby10thenyouwannachangethechangexby10changeyby10intochangexby-10andchangeyby-10forbothofthetwoblocksputthoseblocksintheforeverblockorrepeatblock.Finally,clickthegreenflagandthereyougo,aspriteslidingdownaslope.OhyeahandIalmostforgot,youhavetomaketheslopefirst,butyoudon'thavetoaddanycodetotheslope.Hopethishelpedandgoodluckonyourfutureprojects:):P:D

Last edited by toonizz (Nov. 28, 2017 17:20:15)

deck26
Scratcher
1000+ posts

How to make a sprite slide down a slope?

toonizz wrote:

I know a very simple way of making a sprite slide down a slope! First of all, you wanna click on the sprite you wanna make slide down the slope. Next, you wanna grab

…. snip ….

I think they mean they want it to detect the slope and slide according to how the slope is. What you posted makes a sprtie move in a particular direction and if you add a slope that matches that movement it will give the effect of the sprite sliding. But change the slope in any way and it will no longer work so not really what's required.

But you did say it was a simple way.

Last edited by deck26 (Nov. 28, 2017 17:25:42)

paul0708
Scratcher
27 posts

How to make a sprite slide down a slope?

doesthismakescratchblocks
deck26
Scratcher
1000+ posts

How to make a sprite slide down a slope?

paul0708 wrote:

doesthismakescratchblocks
Please don't blockspam. If you want to experiment with Scratchblocks there's a sticky topic for that.
ScriptedAwesome
Scratcher
1000+ posts

How to make a sprite slide down a slope?

Eh,I would try modifying Griffpatch's platformer's Touching Ground <>
menitoine
Scratcher
28 posts

How to make a sprite slide down a slope?

but how to create a slope with a scrolling ( for my project cat bros)
codeman1044
Scratcher
1000+ posts

How to make a sprite slide down a slope?

menitoine wrote:

but how to create a slope with a scrolling ( for my project cat bros)
Please do not necropost. This topic is old and does not need any additional posts. If you want a question to be answered, create your own topic dedicated to the question.

Powered by DjangoBB