This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2008-03-27 00:16:44

hooh71
Scratcher
Registered: 2007-08-11
Posts: 1

Gaining Momentum

I am currently making a Portal game. I have rudimentary gravity, but I would like to know how I can make my character gain momentum as she is falling, and maintain it when going through another portal. Any tips?

Last edited by hooh71 (2008-03-27 00:17:02)

Offline

 

#2 2008-03-29 14:56:51

thecooltodd
Scratcher
Registered: 2008-03-08
Posts: 75

Re: Gaining Momentum

http://scratch.mit.edu/projects/thecooltodd/115398

You have to download the program for it to work properly.  And as your character goes through a portal, just use the same velocity it was initially traveling before she goes through.

Offline

 

#3 2008-03-29 15:31:34

heybrian1
Scratcher
Registered: 2008-03-02
Posts: 100+

Re: Gaining Momentum

just do


<when green flag clicked>
<forever if><<  <not><touching[ground   >>
<change{velocity  }by(-1



<when green flag clicked>
<forever>
<change x by( <{velocity}>


<when green flag clicked>
<forever if><touching[ ground
<set{velocity  }to( 0

Last edited by heybrian1 (2008-03-29 15:32:11)


I am Heybrian. Yes, the "Ask me anything, for i am a pro scratcher" Thread IS mine.

Offline

 

#4 2008-03-29 15:49:15

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: Gaining Momentum

As above - what you actually need is velocity, not momentum.


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#5 2008-03-29 15:51:23

heybrian1
Scratcher
Registered: 2008-03-02
Posts: 100+

Re: Gaining Momentum

Pretty much same thing. Speed and... whatever synonym Momentum has.


I am Heybrian. Yes, the "Ask me anything, for i am a pro scratcher" Thread IS mine.

Offline

 

#6 2008-03-30 20:41:57

thecooltodd
Scratcher
Registered: 2008-03-08
Posts: 75

Re: Gaining Momentum

Mayhem wrote:

As above - what you actually need is velocity, not momentum.

Agree.  But assuming constant mass (especially if mass can be disregarded) then the terms velocity and momentum can be used interchangeably.  But I still agree velocity is a better term.

Offline

 

#7 2008-04-04 01:48:11

chalkmarrow
Scratcher
Registered: 2007-05-18
Posts: 100+

Re: Gaining Momentum

hooh71: When you enter a portal, what happens, of course, is that your speed (how fast you're going) stays constant, but your velocity (the speed AND direction that you're going) changes depending upon the orientation of the portals. When you go from portal a to portal b, you can keep the speed variable the same, but change its direction variable by whatever angle's appropriate. The physics you've built in re gravity, etc. will take care of the rest. Same with the weighted companion cube, and the same with the cake, if there really is some cake, which I doubt...

Offline

 

#8 2008-04-04 09:14:53

Dibbo222
Scratcher
Registered: 2007-11-03
Posts: 100+

Re: Gaining Momentum

PORTAL GAME ON SCRATCH:

this is my friend's portal game made on scratch - it's really REALLY good and has heaps of levels with cool gravity and momentum building. he is in the middle of making a much improved version but i can't see much that needs improving! have a look here:

http://scratch.mit.edu/projects/Colkadome/105936

there are several parts to it, that's part one


The biggest tower defense game on Scratch?
http://scratch.mit.edu/projects/Dibbo222/929092

Offline

 

#9 2008-04-04 10:45:00

heybrian1
Scratcher
Registered: 2008-03-02
Posts: 100+

Re: Gaining Momentum

Chalkmarrow is right. If your trying to make it just like portal the person gonna have to face the way the portal is.


I am Heybrian. Yes, the "Ask me anything, for i am a pro scratcher" Thread IS mine.

Offline

 

#10 2008-04-05 02:15:17

thecooltodd
Scratcher
Registered: 2008-03-08
Posts: 75

Re: Gaining Momentum

That's not too bad though.

Offline

 

Board footer