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

#1 2012-04-19 16:05:42

darif
New Scratcher
Registered: 2012-03-27
Posts: 20

Help with scripts

I need realistic but  simple(I can handle y velocity + x velocity but not much more)
scripts for:
a)good looking left and right movement
b)good looking jumping (with diagonal  jumping included)

Additional information
The game is a side scrolling platformer + shooter.
The game is loosely like Battle Core by fulldroid <free publicity, ur welcome fulldroid>
I have looked through the forum, projects and videos
Thanks for your attention!   smile

Offline

 

#2 2012-04-19 16:09:57

darif
New Scratcher
Registered: 2012-03-27
Posts: 20

Re: Help with scripts

BTW im new. HI EVERYBODY!!!

Offline

 

#3 2012-04-19 16:53:07

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Help with scripts

Hey darif, welcome to Scratch!

Since you asked for velocity, you can find more explanation on how to apply it to Scratch on this wiki page.

To make nice left and right turning you can also make two mirrored costumers and "switch" to them using

switch to costume [x v]
.

--
For jumping, velocity will do the trick. If done correctly, it already includes diagonal jumping without modifying any scripts!

Last edited by LS97 (2012-04-19 16:53:23)

Offline

 

#4 2012-04-19 16:54:51

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Help with scripts

Oh, on a side note, giving a more descriptive topic title instead of "help with scripts" will get you more help on these forums...

Offline

 

#5 2012-04-19 17:00:44

jack123abc4
Scratcher
Registered: 2011-08-14
Posts: 3

Re: Help with scripts

I made a project that might help you out. Just download the project. It explains everything in the comments attached to the scripts. You can download the sprite or just use the scripts for another sprite.
http://scratch.mit.edu/projects/jack123abc4/2481656
Good luck with your game! I'd love to play it when it's finished!

Offline

 

#6 2012-04-19 17:46:32

Prestige
Scratcher
Registered: 2008-12-15
Posts: 100+

Re: Help with scripts

jack123abc4 wrote:

I made a project that might help you out. Just download the project. It explains everything in the comments attached to the scripts. You can download the sprite or just use the scripts for another sprite.
http://scratch.mit.edu/projects/jack123abc4/2481656
Good luck with your game! I'd love to play it when it's finished!

Here is the link for jack123abc4 - http://scratch.mit.edu/projects/jack123abc4/2481656


"Don't insult someone until you've walked a mile in their shoes. That way, if they don't like what you have to say, you'll be a mile away and still have their shoes  smile  "

Offline

 

#7 2012-04-19 18:13:28

chanmanpartyman
Scratcher
Registered: 2011-05-30
Posts: 500+

Re: Help with scripts

Here you go  smile

when gf clicked
forever
 if <key [right arrow v] pressed?>
  change [xvel v] by (1)
 end
 if <key [left arrow v] pressed?>
  change [xvel v] by (-1)
 end
 set [xvel v] to ((xvel) * (.87))
 change x by (xvel)
 if <touching [level v]?>
  change y by (([abs v] of (xvel)) + (1))
  if <touching [level v]?>
   change y by ((0) - (([abs v] of (xvel)) + (1)))
   change x by ((0)-(xvel))
   set [xvel v] to ((xvel) / (2))
  end
 end  
 if <key [up arrow v] pressed?>
  change y by (-1)
  if <touching [level v]?>
   set [yvel v] to (10)
  end
  change y by (1)
 end
 if <(yvel) < [3]>
  change y by (-1)
  if <not<touching [level v]?>>
   change [yvel v] by (-1)
  end
  change y by (1)
 end
 set [yvel v] to ((yvel) * (0.9))
 change y by (yvel)
 if <touching [level v]?>
  change y by ((0) - (yvel))
  set [yvel v] to ((yvel) / (2.5))
 end
end
Welcome to Scratch!

Offline

 

#8 2012-04-20 13:09:16

darif
New Scratcher
Registered: 2012-03-27
Posts: 20

Re: Help with scripts

Thanks everyone!

Offline

 

#9 2012-04-20 13:35:37

darif
New Scratcher
Registered: 2012-03-27
Posts: 20

Re: Help with scripts

NOTE TO ALL: I've got the movement working.

New Topic:
Any ideas to make enemies smart?

PS: How do you change a thread's name?

Offline

 

#10 2012-04-20 15:19:14

pi3
Scratcher
Registered: 2011-12-31
Posts: 500+

Re: Help with scripts

darif wrote:

NOTE TO ALL: I've got the movement working.

New Topic:
Any ideas to make enemies smart?

PS: How do you change a thread's name?

Check out my Ultimate Lazer Tag's scripts to get ideas for AI opponents.


http://i44.tinypic.com/ofdhc4.jpgThanks FreshStudios!

Offline

 

#11 2012-04-23 03:17:59

darif
New Scratcher
Registered: 2012-03-27
Posts: 20

Re: Help with scripts

THREAD CLOSED. Help no longer needed.
Finished Project: Fruit Ninja Resliced (online on/since 26/04/12)

Offline

 

#12 2012-04-23 08:05:54

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

Re: Help with scripts

Hey darif, you were lucky that i happened to see your post, but next time you should click the Report link at the bottom, and ask the mods to close it like that.  smile

Offline

 

Board footer