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

#1 2010-07-30 00:01:41

croatoan
Scratcher
Registered: 2008-01-25
Posts: 12

Help with programming this please!

So I'm making a game, not going into detail, but the point is is that you're underwater and i have a fish swim back and forth on the screen, in this water room, there are 3 doors, you enter them by pressing 1, 2, or 3, you don't have to touch the doors, which is what i want. anyways, when i leave the water room, the fish won't disappear. I've tried lots of stuff to get it to disappear when i press 1, 2, or 3. One time i actually got the fish to disappear when i left the room, but sadly, it wouldn't come back when i pressed 4 to return to the water room. Here is how i had the coding before i deleted the fish, i really want to bring the fish back:

<when I receive[ Lvl 8
<repeat until> <( <{ Lvl }> <=> 9 )>
<if> <<  <not>  <( <{ Room }> <=> <<  4 )> >>
<show>
<repeat until> <( <{ Room }> <=> 4 )>
<glide( 5 )secs to x sad  ? )y sad  ?
<switch to costume[ 2
<glide( 5 )secs to x sad  blah )y sad  blah
<switch to costume[ 1
<else>
<hide>
<end>

Last edited by croatoan (2010-07-30 00:09:51)

Offline

 

#2 2010-07-30 00:06:22

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Help with programming this please!

I still don't get what exactly you want...do you want to make it so you have to choose the correct door or something? But then, what's the point of the fish?

I'll help if you give me a little more detail about what you want the game to be like.


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#3 2010-07-30 00:08:44

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

Re: Help with programming this please!

Hmm, I think it's just a case of the scripts being not quite right. Let me see if I can make it work. I'll post blocks in a minute.


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

 

#4 2010-07-30 00:09:28

croatoan
Scratcher
Registered: 2008-01-25
Posts: 12

Re: Help with programming this please!

ok, so there are four rooms, you start in room 1 with 3 doors, these doors lead to 2, 3, and 4. in roon 4, it is flooded and i want to show it by having a fish in it that moves. When i go to room 4, it appears like i want it to, but when i leave back to any of the other rooms, it's still swimming across the screen...

Offline

 

#5 2010-07-30 00:12:37

croatoan
Scratcher
Registered: 2008-01-25
Posts: 12

Re: Help with programming this please!

croatoan wrote:

ok, so there are four rooms, you start in room 1 with 3 doors, these doors lead to 2, 3, and 4. in roon 4, it is flooded and i want to show it by having a fish in it that moves. When i go to room 4, it appears like i want it to, but when i leave back to any of the other rooms, it's still swimming across the screen...

u switch rooms with the corresponding number key

Offline

 

#6 2010-07-30 00:21:17

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

Re: Help with programming this please!

This should work, assuming you want it to show and move while the room is 4. The only problem is that it won't hide immediately once the room switches; it will finish moving, then hide. I can fix that if you want, but it will involve a slightly more complex script.

http://i32.tinypic.com/20u4ow7.gif

Does that work? Tell me if it does!


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

 

#7 2010-07-30 00:24:18

croatoan
Scratcher
Registered: 2008-01-25
Posts: 12

Re: Help with programming this please!

Harakou wrote:

This should work, assuming you want it to show and move while the room is 4. The only problem is that it won't hide immediately once the room switches; it will finish moving, then hide. I can fix that if you want, but it will involve a slightly more complex script.

http://i32.tinypic.com/20u4ow7.gif

Does that work? Tell me if it does!

Yeah, thats been my problem actually, it finishes its swim before it disappears, could you please fix that?

Offline

 

#8 2010-07-30 00:46:50

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

Re: Help with programming this please!

croatoan wrote:

Harakou wrote:

This should work, assuming you want it to show and move while the room is 4. The only problem is that it won't hide immediately once the room switches; it will finish moving, then hide. I can fix that if you want, but it will involve a slightly more complex script.

http://i32.tinypic.com/20u4ow7.gif

Does that work? Tell me if it does!

Yeah, thats been my problem actually, it finishes its swim before it disappears, could you please fix that?

Oh, okay! I guess I didn't understand your problem at first. I was confused, actually, because I didn't really change anything... I'll post the script in a minute. Just let me get it working...

Last edited by Harakou (2010-07-30 00:59:32)


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

 

#9 2010-07-30 00:55:25

croatoan
Scratcher
Registered: 2008-01-25
Posts: 12

Re: Help with programming this please!

Harakou wrote:

croatoan wrote:

Harakou wrote:

This should work, assuming you want it to show and move while the room is 4. The only problem is that it won't hide immediately once the room switches; it will finish moving, then hide. I can fix that if you want, but it will involve a slightly more complex script.

http://i32.tinypic.com/20u4ow7.gif

Does that work? Tell me if it does!

Yeah, thats been my problem actually, it finishes its swim before it disappears, could you please fix that?

Oh, okay! I guess I didn't understand your problem at first. I was confused, actually, because I didn't really change anything... I'll post the script in a minute. Just let me get it working...

awesome. thank you.  smile

Offline

 

#10 2010-07-30 00:59:41

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

Re: Help with programming this please!

Oh, one question, do you want the sprite to point at the destination, or just slide? (I can get it working either way. I just way to know your preference, because it needs to work differently depending on what you want.)

Last edited by Harakou (2010-07-30 01:02:01)


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

 

#11 2010-07-30 01:07:29

croatoan
Scratcher
Registered: 2008-01-25
Posts: 12

Re: Help with programming this please!

Harakou wrote:

Oh, one question, do you want the sprite to point at the destination, or just slide? (I can get it working either way. I just way to know your preference, because it needs to work differently depending on what you want.)

its costumes are the directions that it points

Offline

 

#12 2010-07-30 01:24:58

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

Re: Help with programming this please!

croatoan wrote:

Harakou wrote:

Oh, one question, do you want the sprite to point at the destination, or just slide? (I can get it working either way. I just way to know your preference, because it needs to work differently depending on what you want.)

its costumes are the directions that it points

Ok. I think I see. So I can make I point in a direction?


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

 

#13 2010-07-30 01:38:15

croatoan
Scratcher
Registered: 2008-01-25
Posts: 12

Re: Help with programming this please!

Harakou wrote:

croatoan wrote:

Harakou wrote:

Oh, one question, do you want the sprite to point at the destination, or just slide? (I can get it working either way. I just way to know your preference, because it needs to work differently depending on what you want.)

its costumes are the directions that it points

Ok. I think I see. So I can make I point in a direction?

whenever i make it point in to the left the fish is upsidedown facing that way, so i just made a second costume of him facing that way instead of using directions

Offline

 

#14 2010-07-30 22:35:56

croatoan
Scratcher
Registered: 2008-01-25
Posts: 12

Re: Help with programming this please!

could someone help please?

Offline

 

#15 2010-07-30 22:58:59

murpho
Scratcher
Registered: 2010-07-01
Posts: 1000+

Re: Help with programming this please!

press the third button next to the sprite. the one that looks like: - to have it not turn upside down. and it would be like what  harakou said only you would have a second script for the disappearing


https://lh6.googleusercontent.com/-l-rgCPiQ9pY/Tp32n1MRUEI/AAAAAAAADoA/HNQWbO8OOaA/s510/soccerleague.gif

Offline

 

#16 2010-07-31 09:01:12

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

Re: Help with programming this please!

<when[ 1 ]key pressed>     <Make three of these, for 1, 2, and 3
<broadcast[ something ]>   


<when[ 4 ]key pressed>                <These scripts go to the stage
<broadcast[ something else ]>





<when I receive[ something ]>     <This script goes to the fish.
<hide>

<when I receive[ something else ]>
<show>




Hope this helps  big_smile


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

Offline

 

Board footer