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
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
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)
Offline
As above - what you actually need is velocity, not momentum.
Offline
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
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
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
Offline
That's not too bad though.
Offline