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

#1 2011-03-15 19:31:07

thebuilderdd
Scratcher
Registered: 2008-01-26
Posts: 1000+

How to make a game?

I forgot the script for arrow keys. What is it? Thanks. (I mean like in the games with Green flag, forever, ect.)

Last edited by thebuilderdd (2011-03-15 19:31:43)

Offline

 

#2 2011-03-15 19:33:47

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: How to make a game?

You mean like... this?

Code:

when green flag clicked
forever
    if key <right arrow> pressed
        change x by 5
    end if
    if key <left arrow> pressed
        change x by -5
    end if
    if key <up arrow> pressed
        change y by 5
    end if
    if key <down arrow> pressed
        change y by -5
    end if
end forever

http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#3 2011-03-15 19:37:30

thebuilderdd
Scratcher
Registered: 2008-01-26
Posts: 1000+

Re: How to make a game?

Harakou wrote:

You mean like... this?

Code:

when green flag clicked
forever
    if key <right arrow> pressed
        change x by 5
    end if
    if key <left arrow> pressed
        change x by -5
    end if
    if key <up arrow> pressed
        change y by 5
    end if
    if key <down arrow> pressed
        change y by -5
    end if
end forever

Yes!

Offline

 

#4 2011-03-15 20:02:41

demosthenes
Retired Community Moderator
Registered: 2008-02-19
Posts: 1000+

Re: How to make a game?

Closed by request of topic owner.


I've taken a long hiatus, but I still visit sometimes. Give me some time to answer any messages you post on my projects!

Offline

 

Board footer