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

#1 2011-02-12 15:38:21

wrongtriangle180
New Scratcher
Registered: 2010-10-21
Posts: 11

Nintendo Physics Problems

I'm making a rip-off of Super Mario Galaxy with Scratch, and I'm confused on some things with physics. I'm not really new to Scratch, I'm just not that good at programming. I'm having 2 main problems:

1.Launch Flowers & Stars- In the SMG games, there are flowers and stars that launch you into the air, but you can still control the movement of the player after you are launched. I want to be able to have some sort of parabolic movement, but I haven't gotten a solution to that yet. I have a temporary launching script in the meantime:
(launch is a variable that tells if you are being launched or not. If you are, launch=1. direction is a variable that is equal to the direction of the launch item touched. It changes as soon as the launch item is touched.)
[blocks]<when green flag clicked>
<set{ launch }to( 0
<set{ direction }to( 0
<forever>
<wait until><( <{ launch }> <=> 1 )>
<glide( 1 )secs to x sad  (( (( <x position> <-> (( (( <{ direction }> <*> 62 )) </> 45 )) )) <+> 187 )) )y sad  (( (( <y position> <+> (( (( <{ direction }> <*> 62 )) </> 45 )) )) <+> 39 ))
<set{ launch }to( 0
<end>
[/blocks]
This script is based on linear motion, and it has a fixed x and y distance. I do have variables for normal gravity, but I can't seem to be able to implement them into the launching script.

2. Sliding on the Ground- My game involves sloped surfaces, and because of two variables that sense whether the player is touching anything on the left or right side, I have to jump to get up them. This isn't as important, so I don't have a script for it. I don't necessarily need this bug to be fixed for any certain levels, but it would be nice if it could be solved. But I definitely need the launch problem solved, so if anybody could help me, I might be able to get the game done faster. Thanks! By the way, the game is called Super Vito Galaxy.

Offline

 

#2 2011-02-13 15:55:32

wrongtriangle180
New Scratcher
Registered: 2010-10-21
Posts: 11

Re: Nintendo Physics Problems

Bump

Offline

 

#3 2011-02-14 22:49:07

wrongtriangle180
New Scratcher
Registered: 2010-10-21
Posts: 11

Re: Nintendo Physics Problems

Bump

Offline

 

#4 2011-02-15 16:30:28

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Nintendo Physics Problems

I made a game like this, though yours sounds more complex.

Are you having trouble moving in mid-air?  You should get rid of the glide block then and replace it with something else; I'm still a little confused of what you are asking, but the glide script will stop you from moving.

For the parabola, use the formula Y =( X)*(X-DistanceToFall) which should set Y to 0 when X is 0 and when it is as far as you want it to be.  Just set X to zero when you jump and add to it whenever your Xposition is added to.  Or just do:

X=XPositionNow-XPositionWhenIJumped

Last edited by MoreGamesNow (2011-02-15 16:30:47)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#5 2011-02-20 14:15:07

wrongtriangle180
New Scratcher
Registered: 2010-10-21
Posts: 11

Re: Nintendo Physics Problems

Yeah, it's about halfway done! I'm just about to finish designing the last level in my notebook, and then I'll be able to start programming all of the levels and menus and stuff like that. I still can't believe I'm on the last level! I'm gonna be lazy and not do anything about the physics problems, though. It's pretty fine where it is.

Offline

 

#6 2011-02-21 12:05:46

puppetadventurer
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: Nintendo Physics Problems

sounds like its gonna be a great game


3

Offline

 

Board footer