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

#1 2012-08-21 20:08:21

gfrino
New Scratcher
Registered: 2012-08-21
Posts: 4

The sprite doesn't obey to the script!

One of my sprite disappeared from the screen, even though in the script is written to go to x,y location when down key is pressed and it just doesn't happen.

I thought maybe I made the whole project too complex? Is a video game with 2 caracters and a bullet.

Offline

 

#2 2012-08-21 20:19:55

cheddargirl
Scratch Team
Registered: 2008-09-15
Posts: 1000+

Re: The sprite doesn't obey to the script!

Hi gfrino, it's hard to figure out the problem if we don's see your scripts. Maybe you can share your project online so other Scratchers can take a look to see what's wrong?  smile


http://i.imgur.com/8QRYx.png
Everything is better when you add a little cheddar, because when you have cheese your life is at ease  smile

Offline

 

#3 2012-08-21 20:53:29

gfrino
New Scratcher
Registered: 2012-08-21
Posts: 4

Re: The sprite doesn't obey to the script!

I thought so, I did upload it on line DRAGON-IN-THE-SKY :-)

Offline

 

#4 2012-08-21 22:31:58

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: The sprite doesn't obey to the script!

I figured out the problem. You have to put "show" on top of all the other blocks, except for the "if key [down arrow] pressed" block.  wink

It's scripts were activated, it just wasn't shown up. You also made it so that it only checks if the fire hits it after it's done going up, then down, giving the player slightly less than a millisecond to get the timing right. I would sugest you use the two gliding scripts under a separate hat block, and keep the score script on it's own, so it's always checking. I would also suggest that you use the "if green flag clicked" block in the controls section for that script so it's always moving, not just when the player moves downward.

Hope it helps!


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

#5 2012-08-22 10:02:15

gfrino
New Scratcher
Registered: 2012-08-21
Posts: 4

Re: The sprite doesn't obey to the script!

Ok! Thanks a million. The black ghost shows up again. I couldn't use the green flags, I did it bit differently. Check it out, it seems to work.

Offline

 

#6 2012-08-22 10:06:00

gfrino
New Scratcher
Registered: 2012-08-21
Posts: 4

Re: The sprite doesn't obey to the script!

The only thing I didn't figure out how to keep the timer at 0 once the game is finish and till the game re-starts, it just starts automatically at the end of the game

Offline

 

#7 2012-08-22 18:14:23

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: The sprite doesn't obey to the script!

There's no way to manipulate the timer, other than resetting it, so if I were you, I would just make it so that the timer resets at the beginning of every game. Or you could go the more advanced way, and use a variable that counts up every second.


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

Board footer