Slopes - Updated 3.14.12

Install Java to view this project right on your browser!

user_icon amcerbu shared it 4 months, 1 week ago
user_icon Based on amcerbu's project
972 views, 3 taggers, 107 people love it, 193 downloads, in 7 galleries
Add to my favorites?
Flag as inappropriate?

Comments

You need to be logged in to post comments

Add a Comment

 
Zparx Zparx 5 days, 16 hours ago

Neat! You really are an advanced scratcher! Thank you soooo much for your help with my project.

amcerbu amcerbu 5 days, 14 hours ago

I'm glad to hear that! Leave me a message when you've finished, I'd like to see the complete project when it's ready.

(view all replies)
amcerbu amcerbu 5 days, 16 hours ago

No problem. I hope it works the way you want it to.

(view all replies)
AtomicBawm3 AtomicBawm3 1 week, 6 days ago

It does work better...maybe I'll try your formula for bouncing instead of mine...and maybe I'll have it find all the slopes previous to the actual simulation. Oh well, this is great!

amcerbu amcerbu 1 week, 6 days ago

Thanks! If you add that wonderful detection system for the point of contact, it'll work a lot better than this. Are you checking distance between the ball and every single "line" making up that function?

(view all replies)
Markyparky Markyparky 1 week, 6 days ago

Amazing!

Jman1111 Jman1111 2 weeks, 2 days ago

I downloaded it to see how you did all this in one script and when I opened it my mind started hurting. You are very smart : ) love it!

amcerbu amcerbu 2 weeks, 2 days ago

Haha, thanks!

Ritasstudent Ritasstudent 1 month, 1 week ago

You're good at math, aren't you? :P

amcerbu amcerbu 1 month, 1 week ago

It's really nice to use Scratch for math projects, especially because of the integrated coordinate system. It's not great for algebra because of the limits of Scratch functions, but geometry works well!

(view all replies)
amcerbu amcerbu 1 month, 1 week ago

I suppose it is my favorite subject... haha :)

(view all replies)
EMlNEM EMlNEM 2 months ago

░░░░░░░░▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓░░░░░░░░░░░░░░░ ░░░░░░░░▓░░░░░░░░▓░░░░░░▓░░▓░░░░░░▓░░▓▓░░░░░░░░░░░░░░░ ░░░░░░░░▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓░░░░░░░░░░

bizzib bizzib 2 months, 2 weeks ago

How does this thing calculate the angle and bounce?

amcerbu amcerbu 2 months, 2 weeks ago

The projection of the velocity vector onto the slope vector gives us a new vector that resembles the effect of the slope's absorbing all impact. If we want the ball to bounce, we use the vector rejection. It's perpendicular to the projection and the sum of the two yields the original vector (vector addition is <a,b> + <c,d> = <a+c,b+d>). The vector rejection is multiplied by -1 to create bounce, and added to the projection. http://en.wikipedia.org/wiki/Vector_projection

(view all replies)
amcerbu amcerbu 2 months, 2 weeks ago

It uses vector math. I'll try to explain as well as I can in 500 characters. Velocity is a vector; it has two components, x and y (for vectors, you write <x,y>). The surface's slope is also a vector. We can perform an operation called vector projection that finds out how long one is along another one (projecting <a,b> onto <b,c>). The slope vector can be calculated using the points generated by the terrain generator. (continued in above comment)

bizzib bizzib 2 months, 2 weeks ago

off depending on the angle it is?

happy99 happy99 2 months, 4 weeks ago

i belive i can... OW!!!

EmpressCygnus EmpressCygnus 2 months, 4 weeks ago

Wow I love this!!!!!

amcerbu amcerbu 2 months, 4 weeks ago

Thanks! :)

EmpressCygnus EmpressCygnus 2 months, 4 weeks ago

Its sooo.....bouncy

noobydoobydoo noobydoobydoo 2 months, 4 weeks ago

Uhhhh. Why can you float? BTW, couldn't you make it adjust to slope depending on two sprites that went to the visible sprite and moved to the top? Then you could get the slope of the segment you were on by finding the difference of the y-coordinates, and using some formula for direction, have it turn to match the slope.

amcerbu amcerbu 2 months, 3 weeks ago

I could, but it wouldn't look good. The ball would appear to "jump" whenever it touched a slope. Thanks, though!

amcerbu amcerbu 2 months, 4 weeks ago

This project is a physics simulation, not a platforming game. It's a demonstration of accurate interactions between a round object and a sloped surface, so it is intended that the player can continuously hold the up arrow key (much like (link to project) Using "two additional sprites" approach would be slow, since "repeat" blocks in Scratch have built in wait times.

(view all replies)
happy99 happy99 3 months ago

░░░░░░░░▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓░░░░░░░░░░░░░░░ ░░░░░░░░▓░░░░░░░░▓░░░░░░▓░░▓░░░░░░▓░░▓▓░░░░░░░░░░░░░░░ ░░░░░░░░▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓░░░░░░░░░░

noobydoobydoo noobydoobydoo 2 months, 3 weeks ago

How do you do that?

(view all replies)
amcerbu amcerbu 2 months, 4 weeks ago

I guess you got it eventually.

happy99 happy99 3 months ago

░░░░░░░░█░░█░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░▀▄▄▀░░░░░░░░░░░░░░░░░░░░

happy99 happy99 3 months ago

░▓░░░░░░▓░░▓▓░░░░░░░░░░░░░░░ ░░░░░░░░▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓░░░░

happy99 happy99 3 months ago

▓▓▓▓▓▓▓

happy99 happy99 3 months ago

▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓░░░░░░░░░░░░░░░ ░░░░░░░░▓░░░░░░░░▓░░░░░░▓░░▓░░░░░░▓░░▓▓░░░░░░░░░░░░░░░ ░░░░░░░░▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓

happy99 happy99 3 months ago

░░░░░░░░▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓░░░░░░░░░░░░░░░ ░░░░░░░░▓░░░░░░░░▓░░░░░░▓░░▓░░░░░░▓░░▓▓░░░░░░░░░░░░░░░ ░░░░░░░░▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓░░░░░░░░░░

Herbie0602 Herbie0602 3 months ago

AWESOME

WO997 WO997 3 months ago

░░░░░░░░▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓░░░░░░░░░░░░░░░ ░░░░░░░░▓░░░░░░░░▓░░░░░░▓░░▓░░░░░░▓░░▓▓░░░░░░░░░░░░░░░ ░░░░░░░░▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓░░░░░░░░░░

noobydoobydoo noobydoobydoo 2 months, 3 weeks ago

How do you do that? happy99 won't tell me.

joletole joletole 3 months ago

Wow, everybody is doing that now because of me.

(view all replies)
Mr_sprite Mr_sprite 3 months ago

How did you type that?

WO997 WO997 3 months ago

look at my game Monster Car (link to project) I acted at the your' program Thank's!!!

Happy_echiniscus Happy_echinis… 3 months ago

nice.. but wot is turbo mode???

amcerbu amcerbu 3 months ago

In the Flash player, hold shift + click the green flag.

(view all replies)
dapontes dapontes 3 months ago

Excellent project!

amcerbu amcerbu 3 months ago

Thank you!

cianbroderick01 cianbroderick01 3 months ago

So cool!!!

Williamis3 Williamis3 3 months ago

Please can you check out my project (link to project)

mooh56 mooh56 3 months ago

I love it

EpicScratchMan EpicScratchMan 3 months ago

Whoa cool

Aesculus3 Aesculus3 3 months ago

good job

applejack applejack 3 months ago

This was curated! I saw it on the front page!!! (I was wondering why it had so many views) Congradgulations!

amcerbu amcerbu 3 months ago

Thanks! It's my first curated project.

(view all replies)
werdna123 werdna123 3 months ago

Really cool, nice physics. And guys, seriously, quit doing the COOL thing.

amcerbu amcerbu 3 months ago

Lol. Thanks!

prokohtu prokohtu 3 months ago

really smooth, good job. just one thing: if you press the up arrow it will keep jumping forever

DarthPickley DarthPickley 3 months ago

glad this got curated :D

amcerbu amcerbu 3 months ago

Thanks! Glad you liked it.

DarthPickley DarthPickley 3 months ago

ok i made a remix: (link to project)

Bricklink101 Bricklink101 3 months ago

AWESOME! Can I use these physics?

amcerbu amcerbu 2 months, 1 week ago

I implemented a "drawable" feature. Tell me what you think!

amcerbu amcerbu 3 months ago

The terrain generator is a necessary part of the physics. The terrain is stored in a list (YPositions) as a sequence of y-values over the x-coordinates -240 through 240. If you want to modify the terrain, delete the "Repeat 480" section that is labeled "Land Generation" and replace it with something else. As long as the list is full, the rest will work. Maybe I'll add a "draw it yourself" feature.

(view all replies)
amcerbu amcerbu 3 months ago

Sure, go ahead! Leave me a link when you're done, I'll post it in the project notes.

(view all replies)
tiki22 tiki22 3 months ago

░░░░░░░░▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓░░░░░░░░░░░░░░░ ░░░░░░░░▓░░░░░░░░▓░░░░░░▓░░▓░░░░░░▓░░▓▓░░░░░░░░░░░░░░░ ░░░░░░░░▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓░░░░░░░░░░

laxattak laxattak 3 months ago

How long did it take you to make this.

(view all replies)
FlamingNinjaCoops FlamingNinjaC… 3 months ago

700th view!

MeDead2 MeDead2 3 months ago

Yay I did it!......Lol not really

MeDead2 MeDead2 3 months ago

░░░░░░░░▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓░░░░░░░░░░░░░░░ ░░░░░░░░▓░░░░░░░░▓░░░░░░▓░░▓░░░░░░▓░░▓▓░░░░░░░░░░░░░░░ ░░░░░░░░▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓░░░░░░░░░░

evilraven evilraven 3 months ago

░░░░░░░░▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓░░░░░░░░░░░░░░░ ░░░░░░░░▓░░░░░░░░▓░░░░░░▓░░▓░░░░░░▓░░▓▓░░░░░░░░░░░░░░░ ░░░░░░░░▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓░░░░░░░░░░

evilraven evilraven 3 months ago

jk i know

evilraven evilraven 3 months ago

how do u move

yoshidude56 yoshidude56 3 months ago

think this could scroll?

amcerbu amcerbu 3 months ago

Probably not. It takes way too long to regenerate the terrain. Maybe in turbo, and with a bit of fancy list programming (where it doesn't recalculate all the values each time).

cool_kid cool_kid 3 months ago

epic man!

thebriculator thebriculator 3 months ago

nice! I love the realistic motion and how it generates random 'levels'. one thing you could change is the ability to 'keep jumping'. great project!

amcerbu amcerbu 3 months ago

Okay, thanks. The "jumping" isn't really jumping, it's reverse gravity. More like flying.

zoli98 zoli98 3 months ago

good :D

Olloqui Olloqui 3 months ago

░░░░░░░░▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓░░░░░░░░░░░░░░░ ░░░░░░░░▓░░░░░░░░▓░░░░░░▓░░▓░░░░░░▓░░▓▓░░░░░░░░░░░░░░░ ░░░░░░░░▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓░░░░░░░░░░

DOOMANDDEATH DOOMANDDEATH 3 months ago

◔_◔

(view all replies)
poisonarrow poisonarrow 3 months ago

that game is cool

nyansonic nyansonic 3 months ago

░░░░░░░░▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓░░░░░░░░░░░░░░░ ░░░░░░░░▓░░░░░░░░▓░░░░░░▓░░▓░░░░░░▓░░▓▓░░░░░░░░░░░░░░░ ░░░░░░░░▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓░░░░░░░░░░

DOOMANDDEATH DOOMANDDEATH 3 months ago

ಠ_ಠ

prani22 prani22 3 months ago

nice!

matty333 matty333 3 months ago

good gravity physics on scratch, i find this type of thing really hard.

fireaction2001 fireaction2001 3 months ago

wow!

KROOOE KROOOE 3 months ago

You sir, deserve a medal. You have now won Scratch.

pinkbat5 pinkbat5 3 months ago

yay works! :) :D cool!

pinkbat5 pinkbat5 3 months ago

won't open :(

CaptainDow CaptainDow 3 months ago

1e-14 = 0.0000000000001

amcerbu amcerbu 3 months ago

Yeah. I don't know why that's the upper limit. I had set it to 0 within Scratch.

(view all replies)
joletole joletole 3 months ago

░░░░░░░░▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓░░░░░░░░░░░░░░░ ░░░░░░░░▓░░░░░░░░▓░░░░░░▓░░▓░░░░░░▓░░▓▓░░░░░░░░░░░░░░░ ░░░░░░░░▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓▓▓▓░░░░░░░░░░

Mokat Mokat 3 months ago

░░░░░░░░█░░█░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░▀▄▄▀░░░░░░░░░░░░░░░░░░░░

(view all replies)
NarwhalKing NarwhalKing 3 months ago

um. wow. joletole, how did you do that?

(view all replies)
Thrystor Thrystor 3 months ago

Awesome game! ♥-it!

Thrystor Thrystor 3 months ago

Not really a game... Still!

coppearlix coppearlix 3 months ago

Reminds me of truck driving games. :3 Feels real.

kitkatkittycat kitkatkittycat 3 months ago

amazing!!! =D can I use the scripts as a reference? I might want to make a game sometime

amcerbu amcerbu 3 months ago

Sure, go ahead.

cbp105 cbp105 3 months ago

nice

coolhogs coolhogs 3 months ago

you should add gravity! Still, great simulation!

jr-r2-d2 jr-r2-d2 3 months ago

maybe he wanted to make the jumping like that, that way you can't get stuck on a really steep slope.

nyansonic nyansonic 3 months ago

press up :)

amcerbu amcerbu 3 months ago

It does have gravity...?

(view all replies)
Nathanator1416J Nathanator1416J 3 months ago

soooo real! I love it!!!!!!

msfan98 msfan98 3 months ago

Beautiful. Love the userpic by the way.

amcerbu amcerbu 3 months ago

Haha, thanks.

Please Wait...