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

#1 2007-11-29 17:03:35

YoSup
Scratcher
Registered: 2007-11-18
Posts: 22

I need help!

Need help use up left right down arrow key to move homer. when homer is on the pink jelly doughnut he is suppose to go to next costume and he does but after that he cannot more for some reason. Also when he is on the green doughnut he is supposed to go to costume where is shows homer dead because he ate a vegi doughnut. I need your guys help.

                                              YoSup



Link to my game:
http://scratch.mit.edu/projects/YoSup/60488

Offline

 

#2 2007-11-29 19:41:34

spencech
Scratcher
Registered: 2007-10-06
Posts: 1

Re: I need help!

Hey YoSup, I noticed that you do not have a "forever if" code block for your costume changes. Try putting your costume change in a forever if block inside the "Green Flag pressed" block. This way, your program will keep checking to see if the two sprites are hitting each other.

Chris @ Scratch

Offline

 

#3 2007-11-29 20:18:38

YoSup
Scratcher
Registered: 2007-11-18
Posts: 22

Re: I need help!

hey thanx i did change that now and it still doesn't work

Offline

 

#4 2007-11-29 21:59:48

jay
Scratch Team
Registered: 2007-03-11
Posts: 59

Re: I need help!

Hi Yosup,

Thanks for posting in the forums.

The second script in your homer sprite says this:

[blocks]
<when green flag clicked>
forever if (score = 4)
<hide>
<go to[5][-37]>
<show>
[/blocks]

As soon as you eat the pink donut your score goes to 4 and this forever loop gets activated over and over again until your score isn't 4 anymore. What this means is that homer keeps on getting sent to x:5 y:-37. So when you push the arrows homer moves a little bit, but then he gets sent right back to x:5 y:-37. That's why if you hold down the right arrow for example, homer will vibrate back and forth:

[blocks]
<move( 10 )steps>
<go to[5][-37]>
[/blocks]

over and over again. There are lots of ways to fix this. One way is just to get rid of this whole script (the second script in homer). But the key to fixing it is understanding what is going wrong, so please ask questions if you didn't get my explanation.

Good luck!

Offline

 

#5 2007-11-30 03:34:27

sandkcap
Scratcher
Registered: 2007-11-30
Posts: 1

Re: I need help!

How do you drag objects?<glide(  )secs to x sad   )y sad

Offline

 

#6 2007-11-30 10:20:15

jay
Scratch Team
Registered: 2007-03-11
Posts: 59

Re: I need help!

To have objects move on their own you can use glide. Just click after the x and after the y and type in new numbers like x:100 y:100. If you want the sprites themselves to be dragable  using the mouse, then look in the costume library under "things" and get the "draggable" sprite (purple and red square). This sprite is dragable in presentation mode and on the web.

A new version of scratch is coming out any day now that will have a new feature that lets you "lock" or "unlock" the dragability of sprites...

Offline

 

#7 2007-11-30 13:22:23

YoSup
Scratcher
Registered: 2007-11-18
Posts: 22

Re: I need help!

Thanx Jay. I have another question. When I write this scrpit under my sprite 8 scripts why doesn't it switch my backround:

<when green flag clicked>
<forever if><touching[ sprite 8]>
<switch to costume[ homerdead]>
<hide>

Offline

 

#8 2007-11-30 14:44:26

YoSup
Scratcher
Registered: 2007-11-18
Posts: 22

Re: I need help!

Hey jay can you downlaod my game and see if you can change it so it works.

Offline

 

#9 2007-11-30 14:55:04

YoSup
Scratcher
Registered: 2007-11-18
Posts: 22

Re: I need help!

Hey jay how do you make the varibale (mine is score) change by subtracting five from it?

P.S. Thanx for all your help your an awesome member of the scratch team member. :]

Offline

 

#10 2007-11-30 18:14:52

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: I need help!

Changing variables is easy

[blocks]
<change{ v     }by(  -5
[/blocks]

Offline

 

#11 2007-12-01 08:27:45

YoSup
Scratcher
Registered: 2007-11-18
Posts: 22

Re: I need help!

thanx kevin

Offline

 

#12 2007-12-01 11:41:50

planetX
Scratcher
Registered: 2007-11-08
Posts: 100+

Re: I need help!

YoSup wrote:

Thanx Jay. I have another question. When I write this scrpit under my sprite 8 scripts why doesn't it switch my backround:

<when green flag clicked>
<forever if><touching[ sprite 8]>
<switch to costume[ homerdead]>
<hide>

i think its because you told it to hide.


If you have unknown projects, don't give up hope! Go to Project Unkown!
If you are being cyber-bullied, don't give up hope! Go to Project Bullied

Offline

 

#13 2007-12-02 10:26:00

BestFriend10
Scratcher
Registered: 2007-11-30
Posts: 3

Re: I need help!

<when green flag clicked>
  <if>                         you need to put if instead of FOREVER if
<color[yellow or something ]is over[green]
<switch to costume[homer dead]    put all this is stage scripts

Offline

 

Board footer