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

#1 2010-07-09 16:37:27

bob6
Scratcher
Registered: 2010-07-01
Posts: 100+

help with programming?

http://scratch.mit.edu/projects/bob6/1181896
help? I got the tutorial down, but when I go to the first level, the ball your controlling freezes!
Everything seems right to me...


http://i46.tinypic.com/3148ksz.gif

Offline

 

#2 2010-07-09 16:45:17

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: help with programming?

Well, I'm not so sure about that part, but I see you've programmed it quite oddly - might I suggest using these blocks for your movement instead of what you have?

[blocks]<change y by(
<change x by(
[/blocks]
It's a lot simpler that way.

EDIT: I figured it out - it's the bottom script on the ball. What you have is this:

Code:

When Green Flag clicked
forever
  if <level = 1>
    Go to x: -205 y: 50
  else
    if <level = 2>

    else

and so on. Essentially, it just won't let the ball go anywhere buy -205, 50 at this point.

What you want is this:

Code:

When Green Flag clicked
forever
  if <level = 1>
    Go to x: -205 y: 50
    wait until <not <level = 1>>
  else
    if <level = 2>

    else

And so on - just keep putting "wait until" for each level, and it should work like a charm!

Last edited by coolstuff (2010-07-09 16:50:40)

Offline

 

#3 2010-07-09 17:04:04

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: help with programming?

Oh, I nearly forgot - this would probably be better suited for the All About Scratch forum - so I'll move it there for you.

Offline

 

#4 2010-07-29 19:25:19

kaplooeyRaRa
Scratcher
Registered: 2009-08-05
Posts: 27

Re: help with programming?

OK... very odd...   Like the first guy I recomend the
[blocks]
<change x by(
<change y by(
[/blocks]
bricks... oh and make sure NONE of the sprites are touching the ball at the start...
if you are using gravity with variables you should be EXTRA careful!!  Sorry if this doesn't help...


ComposAnimationsComposGames

Offline

 

#5 2010-07-29 20:45:36

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

Re: help with programming?

coolstuff wrote:

Code:

When Green Flag clicked
forever
  if <level = 1>
    Go to x: -205 y: 50
    wait until <not <level = 1>>
  else
    if <level = 2>

    else

Why not just use this instead?

Code:

 When Green Flag Clicked
Wait until <level = 1>
Go to x: -205 y: 50
Wait until <level = 2>
Go to x: -45 y: 10

Et cetera.

Or, you could make a list of x postions and y postions, and do this:

Code:

When I receive (Next Level)
change level by 1
Go to x: (item (level) of [x positions]) y: (item (level) of [y positions])

The second one is shorter and easier to add levels with, but might be a little harder to understand.


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

 

#6 2010-08-03 21:44:51

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: help with programming?

Harakou wrote:

coolstuff wrote:

Code:

When Green Flag clicked
forever
  if <level = 1>
    Go to x: -205 y: 50
    wait until <not <level = 1>>
  else
    if <level = 2>

    else

Why not just use this instead?

Code:

 When Green Flag Clicked
Wait until <level = 1>
Go to x: -205 y: 50
Wait until <level = 2>
Go to x: -45 y: 10

Et cetera.

Or, you could make a list of x postions and y postions, and do this:

Code:

When I receive (Next Level)
change level by 1
Go to x: (item (level) of [x positions]) y: (item (level) of [y positions])

The second one is shorter and easier to add levels with, but might be a little harder to understand.

Both of which work quite well! Turns out I made some serious misevaluations on what would be easy to snap together  big_smile

Offline

 

#7 2010-08-03 22:12:56

JeanTheFox
Scratcher
Registered: 2010-06-14
Posts: 1000+

Re: help with programming?

The link is broken. Error 404...

Why was it deleted?  hmm


http://i51.tinypic.com/20gcn5j.png

Offline

 

Board footer