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

#1 2008-12-06 03:57:49

bart9032
Scratcher
Registered: 2008-06-16
Posts: 100+

New way to move

I have finally figured a good way to move without sliding but with math.(I'm not that smart but I am smart for a kid)
Here are the scripts:
[blocks]
<when green flag clicked>
<forever>
<if><key[ right arrow ]pressed?>
<change x by( sin of 30
<end>
<if><key[ left arrow ]pressed?>
<change x by( sin of -30
<end>
<if><key[ space ]pressed?>
<repeat( 20
<if><key[right arrow  ]pressed?>
<change x by( sin of 30
<end>
<if><key[left arrow  ]pressed?>
<change x by( sin of -30
<end>
<change y by( sin of 30
<wait( 0.001 )secs>
<end>
<wait( 0.1 )secs>
<repeat( 20
<if><key[ right arrow ]pressed?>
<change x by( sin of 30
<end>
<if><key[ left arrow  ]pressed?>
<change x by( sin of -30
<end>
<change y by( sin of -30
<end>
<end>
<end>[/blocks]
pretty good hey?

Last edited by bart9032 (2008-12-06 03:59:28)


Hi, my name is Bartholomew JoJo 'Bart' Simpson. Nice to meet you,
Actually, no I am not Bart Simpson. I am bart9032  cool

Offline

 

#2 2008-12-06 05:10:31

Dan01
Scratcher
Registered: 2008-06-11
Posts: 100+

Re: New way to move

It's Ok, but not the best.


http://img3.imageshack.us/img3/4743/ubd6522wp8.png
http://img3.imageshack.us/img3/4667/ubd3758ox2.png

Offline

 

#3 2008-12-06 07:14:49

jasb
Scratcher
Registered: 2007-11-10
Posts: 100+

Re: New way to move

You should use it in a game to show us how it works.

Offline

 

#4 2008-12-06 10:33:14

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: New way to move

There is not point in using trig for this. Just put numbers in the x and y blocks.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#5 2008-12-06 16:54:40

bart9032
Scratcher
Registered: 2008-06-16
Posts: 100+

Re: New way to move

jasb wrote:

You should use it in a game to show us how it works.

I have


Hi, my name is Bartholomew JoJo 'Bart' Simpson. Nice to meet you,
Actually, no I am not Bart Simpson. I am bart9032  cool

Offline

 

#6 2008-12-06 17:00:56

bart9032
Scratcher
Registered: 2008-06-16
Posts: 100+

Re: New way to move

archmage wrote:

There is not point in using trig for this. Just put numbers in the x and y blocks.

archmage, it doesn't matter if you use trig or not. I was experimenting with trig and my dad helped me out a bit


Hi, my name is Bartholomew JoJo 'Bart' Simpson. Nice to meet you,
Actually, no I am not Bart Simpson. I am bart9032  cool

Offline

 

Board footer