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

#1 2011-03-08 15:33:02

julesttropfort
New Scratcher
Registered: 2011-03-08
Posts: 7

How to make one kind which a character jumps in a realistic way?

Français :
Je suis français, donc ce sera plus clair comme ça  wink
J’essaie de faire un jeu de plateforme, avec Dark Vador mais je n'arrive pas ale faire sauter de façon réaliste. Je peux le faire sauter, mais c'est comme si il se téléportait un peu plus haut, puis revenait. Pouvez vous m'aider?
Encore une chose, imaginez qu'un monstre l'attaque. Il utilise Barre d'espace pour attaquer mais si le monstre le touche quand il ne fait pas barre d'espace, alors Dark Vador perd une vie. Comment faire en sorte qu'il perde quand il est sous un certain costume et qu'il gagne quand il est sous un autre costume? Merci!

English :
I try to make a platformer game, with Dark Vador but I do not manage ale to blow up in a realistic way. I can blow up him, but it is as if he teleports a little higher, then returned. Can you help me? Another thing, imagine that a monster attacks him. He uses Space Bar  to attack but if the monster touches him when it does not make Space Bar, then Dark Vador loses a life. How to make so that he loses when he is under a certain costume and when he wins when he is under another costume? Thank you !

Offline

 

#2 2011-03-08 15:50:13

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: How to make one kind which a character jumps in a realistic way?

For jumping, make a variable called "y velocity" or "yvel" or something and make a script like this:
http://i55.tinypic.com/2rfphj5.gif
When you do this, instead of him teleporting up a bit he'll smoothly move up then down.

Change the "If touching Ground" block to however he touches the ground, like "if color touching ground color" or however you're doing it.

Also, you can play around with the numbers (except the 0, leave that), changing the -1 to a larger number like -2 makes him fall faster, making it -0.5 or something makes him fall slower.  The 10 can be changed to any number to affect how high he jumps, a larger number  makes him jump higher, a lower number makes him jump lower.


For the attacking thing, you can use something like this:
http://i55.tinypic.com/f0uhq0.gif
I don't know how your attack script runs, but put your current attacking script into the empty spot.

Last edited by Kileymeister (2011-03-08 16:24:57)


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

#3 2011-03-08 16:13:36

julesttropfort
New Scratcher
Registered: 2011-03-08
Posts: 7

Re: How to make one kind which a character jumps in a realistic way?

Je m'incline devant toi  smile
Merci énormément tu m'a beaucoup aidé!
Merci encore!

Offline

 

#4 2011-03-08 16:47:00

julesttropfort
New Scratcher
Registered: 2011-03-08
Posts: 7

Re: How to make one kind which a character jumps in a realistic way?

Another thing, how is that the enemy attacks in an automatic way?

Offline

 

#5 2011-03-08 18:53:30

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: How to make one kind which a character jumps in a realistic way?

Hm... there are several ways to do that, this might be the easiest and most effective:
http://i52.tinypic.com/25k0f12.gif
Basically if you are close, the enemy attacks.
Or if you want to make the enemy hesitate for a split-second and attack slightly randomly, just put in a random block like this:
http://i56.tinypic.com/a3iohx.gif
(As always, the numbers can be changed)
Hope that helps!  smile

Last edited by Kileymeister (2011-03-08 18:53:43)


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

#6 2011-03-09 03:47:11

julesttropfort
New Scratcher
Registered: 2011-03-08
Posts: 7

Re: How to make one kind which a character jumps in a realistic way?

Thank you very much^^
A little more complicated, (I know I always have are questions), I explain, the droïde has a costume " to fire a laser beam " and a costume " uppercut". The command < 30 pleases me for the laser but can we make the same thing with the uppercut when the enemy is close? Thank you!

Offline

 

#7 2011-03-09 04:08:10

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: How to make one kind which a character jumps in a realistic way?

julesttropfort wrote:

Thank you very much^^
A little more complicated, (I know I always have are questions), I explain, the droïde has a costume " to fire a laser beam " and a costume " uppercut". The command < 30 pleases me for the laser but can we make the same thing with the uppercut when the enemy is close? Thank you!

Just to the same thing.  smile

Offline

 

#8 2011-03-09 06:02:20

julesttropfort
New Scratcher
Registered: 2011-03-08
Posts: 7

Re: How to make one kind which a character jumps in a realistic way?

Yes, but how may I make so that when the droïde strikes the pose "laser1", if it looks in the direction of dark at Vador, he loses a life? And then distance < 30 do not work even if I approach close, he don't attacks me!:'(
Can you say me if it's possible?

Offline

 

#9 2011-03-09 06:15:47

julesttropfort
New Scratcher
Registered: 2011-03-08
Posts: 7

Re: How to make one kind which a character jumps in a realistic way?

I am going to show you the prototype, you fast go to understand:
http://scratch.mit.edu/projects/julesttropfort/1645176
the droïd don't attaks..

Offline

 

Board footer