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

#1 2009-03-02 04:58:09

Dark_Guardian
Scratcher
Registered: 2009-02-07
Posts: 7

Controlling a character

Sorry if this is an easy question to most people, but how do you contol a sprite?
At the moment, I don't it to change costumes and I'm still new to this program.

What are the scripts used to make this possible?

Offline

 

#2 2009-03-02 06:01:51

yambanshee
Scratcher
Registered: 2007-11-06
Posts: 500+

Re: Controlling a character

for cotumes: <switch to costume[ ]> <next costume>
movment <change x by( )><change y by( )><set x to( )> <set y to( )> <move(  )steps> <turn cw(  )degrees> <turn cw(  )degrees> etc...

Offline

 

#3 2009-03-02 06:01:57

Mike_W
Scratcher
Registered: 2009-02-05
Posts: 100+

Re: Controlling a character

Downlaod some projects - there are three ways to control a sprite - that I can think off of the top of my head.

Timer based - look at at one of what I call the story scratch projects for this
Broadcast based (this also could be used)
Input based (mouse or keyboard)  anything interactive will use that. My project circle uses keyboard input.

Most importantly Read Manuals, Read code. If you want to program you will have to read - read and read more

Offline

 

#4 2009-05-07 08:32:03

Dark_Guardian
Scratcher
Registered: 2009-02-07
Posts: 7

Re: Controlling a character

I'm asking for a simple set of blocks, i know what blocks does what, but I don't know what blocks to use.

I don't like to consider downloading.

Offline

 

#5 2009-05-07 08:52:52

Test_Guardian
Scratcher
Registered: 2009-02-16
Posts: 30

Re: Controlling a character

I'm looking for almost the same thing. Is it possible if the character faces the directional buttons pressed. I think it's hard to show the blocks here..

Offline

 

#6 2009-05-07 09:15:31

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

Re: Controlling a character

Try looking for the marble sprites that are included with scratch. The sample projects are also good.


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

 

#7 2009-05-08 03:45:03

pokemon_master12
Scratcher
Registered: 2008-09-26
Posts: 100+

Re: Controlling a character

Well to make a sprite move you put this:

[blocks]<when[ right/left arrow ]key pressed>[/blocks]
[blocks]<next costume>[/blocks]
[blocks]<point in direction( whichever degree is right/left[/blocks]
[blocks]<move( 10 )steps>[/blocks]

That way you can make separate costumes to look like it's walking or running by making a walk/run cycle. It will switch to the next part of the cycle every time the arrow key is pressed, and  it will move whichever way you want it to go.


My Dragon Egg! http://dragcave.net/image/5YUA.gif
Visit my blog: http://freyasworld.wordpress.com/

Offline

 

Board footer