Discuss Scratch

jak988
New to Scratch
6 posts

Switching background after all sprites disapperas !!!!!!

Yo guys

I got this https://scratch.mit.edu/projects/195863180/ and I want to make sth like when u make all blocks dissapear then switching to another background and starts new level (“poziom” means level). So can u help me define new argument and make it possible because I don't have any ideas how I can do this.

In first level I have one line of blocks to destroy, on second I want two, on third 3 lines etc. But it hard when I destroy line in first level and don't know how switch to the second. You know what I mean
Silencer59
Scratcher
26 posts

Switching background after all sprites disapperas !!!!!!

ooooh nice, I've played this game on my phone before. what you've done so far is spectacular.

“Would it save you a lot of time if I just gave up and went mad now?” - Douglas Adams, The Hitchhiker's Guide to the Galaxy

https://scratch.mit.edu/projects/195230834/
mstone326
Scratcher
1000+ posts

Switching background after all sprites disapperas !!!!!!

I made a remix for you using clones. Since the blocks are all looking for the same thing, getting hit by the ball or moving downwards we can use a single sprite and then the clones can look for the condition.

I set up a variable called level, blocksToBreak, blockPerRow, points(which I ended up not using but left in case). Each row has 8 blocks, so I set blocksPerRow to 8. I set blocksToBreak to blocksPerRow * level.

Every time we hit a block it changes blocksToBreak by -1. When all the blocks are gone that will = 0, then will call for a new level. I took out all the other scipts so I could just focus on showing you level generation. Good luck ope this helps

https://scratch.mit.edu/projects/195895344/

(Edit: I also took out all controls, just hit space and the ball will go. Then you can see how blocksToBreak counts down. When it =0 then it will generate another line. So just watch the ball bounce, then if it helps you can work into your project. You can also add in a broadcast to move down for them to move down like you had originally in your project. Clones will all respond to a single broadcast).

Also, one last note. It is never a good idea to label your backdrops or sprites as just a single number. Causes issues

Last edited by mstone326 (Jan. 3, 2018 00:44:25)


Technology Director / Teacher Grades K-8
Head High School Baseball Coach

Jeopardy Board for Teacher Review (import your own .txt file of questions and answers)
https://scratch.mit.edu/projects/200955428/
Most Recent - Meltman
https://scratch.mit.edu/projects/144049407/
Studio - My Best Projects
https://scratch.mit.edu/studios/4125978/
Haz-_-
Scratcher
500+ posts

Switching background after all sprites disapperas !!!!!!

Try this script:
when green flag clicked
if <(backdrop #) = [1]> then
broadcast [game over v]
end
when I receive [Game over v]  
hide
OR
when I receive [ game over v]
stop [all scripts in other sprites v]
hope this helped!

Last edited by Haz-_- (Jan. 3, 2018 03:00:44)



 continue this hashtag if you live in australia [img]http://u.cubeupload.com/rabbitcarrots/FEDB1435D41540BFB9FB.jpeg[/img] is the image code xD oh and btw this siggy is from @Hellounicorns2    :cool:
Haz-_-
Scratcher
500+ posts

Switching background after all sprites disapperas !!!!!!

+the link didn't work


 continue this hashtag if you live in australia [img]http://u.cubeupload.com/rabbitcarrots/FEDB1435D41540BFB9FB.jpeg[/img] is the image code xD oh and btw this siggy is from @Hellounicorns2    :cool:

Powered by DjangoBB

Standard | Mobile