Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » I'm trying to make a game with falling objects
- UltraMinecraftMan
-
Scratcher
45 posts
I'm trying to make a game with falling objects
I'm trying to make a game where you have to avoid falling objects. The objects are supposed to fall faster and more as you progress in the game and I want high scores via cloud data. I cannot understand how to script any of the things I have just mentioned.
- 1234abcdcba4321
-
Scratcher
1000+ posts
I'm trying to make a game with falling objects
This goes into the block sprite.
when I receive [game over v]This goes into the player sprite.
if <(high score) < (score)> then
set [high score v] to (score) // high score is a cloud var
end
delete this clone
when I receive [play v]
set [playing? v] to [1]
set [speed v] to [12] // change values as needed
set [wait v] to [4] // this one also needs to be changed
set [score v] to [0]
repeat until <(playing?) = [0]>
wait (wait) secs
create clone of [myself v]
set [speed v] to ((speed) * (0.98)) // adjust this one, too
set [wait v] to ((wait) * (0.975)) // as well as this one
end
when I start as a clone
go to x: (pick random (-239) to (239)) y: (180)
glide (speed) secs to x: (x position) y: (-180)
change [score v] by (1)
delete this clone
when I start as a clone
wait until <touching [player v]?>
broadcast [game over v]
set [playing? v] to [0]
when I receive [play v]
go to x: (0) y: (-165) // example value!
forever
if <key [left arrow v] pressed?> then
change x by (-6) // you may want to adjust these a bit
end
if <key [right arrow v] pressed?> then
change x by (6) // and this one too
end
Last edited by 1234abcdcba4321 (Feb. 17, 2014 16:55:56)
- UltraMinecraftMan
-
Scratcher
45 posts
I'm trying to make a game with falling objects
Thanks! I really need help with making the game work first though. You see, you have to avoid boxes falling from the sky. I need them to clone themselves, Fall, If they hit the player you lose, they gradually get faster throughout the game, if the player avoids one it increases his score.
- 1234abcdcba4321
-
Scratcher
1000+ posts
I'm trying to make a game with falling objects
I edited the post. It should have about everything you need.
- UltraMinecraftMan
-
Scratcher
45 posts
I'm trying to make a game with falling objects
I couldn't make the box fall
- UltraMinecraftMan
-
Scratcher
45 posts
I'm trying to make a game with falling objects
This is so hard!
- 1234abcdcba4321
-
Scratcher
1000+ posts
I'm trying to make a game with falling objects
The scripts in my post make it work. (The glide block below the “when i start as a clone”)
- UltraMinecraftMan
-
Scratcher
45 posts
I'm trying to make a game with falling objects
It's done! http://scratch.mit.edu/projects/18060872/
- MH02146
-
Scratcher
1 post
I'm trying to make a game with falling objects
i have tried it but i just can't do it. i was trying to make stars fall from the top of the backdrop but instead of what i wanted to happen something else happend all the stars started to come out of nowhere and glide across the page.
- amateurradiogeek15
-
Scratcher
1000+ posts
I'm trying to make a game with falling objects
i have tried it but i just can't do it. i was trying to make stars fall from the top of the backdrop but instead of what i wanted to happen something else happend all the stars started to come out of nowhere and glide across the page.Please don't necropost!!!
- laithrocks
-
Scratcher
100+ posts
I'm trying to make a game with falling objects
What if I want a game where in which “they're JUST falling down.
(and of course, ”GAME OVER")
Forget the score, and everything, I might have a simple insert process, I just want to know what's what.
I mean, I'm just trying to depict this code right now…
I really don't know…
(and of course, ”GAME OVER")
Forget the score, and everything, I might have a simple insert process, I just want to know what's what.
I mean, I'm just trying to depict this code right now…
I really don't know…
- Warriorcat11202
-
Scratcher
22 posts
I'm trying to make a game with falling objects
The easiest way to do this: When clicked button, attack the forever button to it, and inside the forever button put in change y by -10. Hope that helps!!!!!!!!!!!!
- Warriorcat11202
-
Scratcher
22 posts
I'm trying to make a game with falling objects
oops I meant attack not attack, Sorry.
- 273Explorer
-
Scratcher
1 post
I'm trying to make a game with falling objects
Did the game atchully work
- Scratchy_the_Caty
-
Scratcher
36 posts
I'm trying to make a game with falling objects
There seems to be a little bit of necroposting going on here. This topic was resolved over a year ago, and therefore is considered “dead”.
If you have the same problem, you can use the solution, or if it doesn't work, try making a new topic.
But, if a topic in this forum hasn't gotten a new post in over a month, then it is safe to assume that you shouldn't make any new posts because the thread creator doesn't need any more help.
If you have the same problem, you can use the solution, or if it doesn't work, try making a new topic.
But, if a topic in this forum hasn't gotten a new post in over a month, then it is safe to assume that you shouldn't make any new posts because the thread creator doesn't need any more help.
- Penguin07850
-
Scratcher
17 posts
I'm trying to make a game with falling objects
when green flag clicked
set [high sore v] to [0 ]
if <touching sprite1> then
end
- Discussion Forums
- » Help with Scripts
-
» I'm trying to make a game with falling objects







