Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Problem with trying to wait for a single part of the code
- wolfbomb
- Scratcher
14 posts
Problem with trying to wait for a single part of the code
I'm trying to make a flappy bird-like game. I want the pipes to only move after waiting for a couple of seconds, allowing the player to be situated and ready. If I use a wait block it stops everything. Is there a way to make the pipe movement script wait, but allow the player to still move?
The project:
https://scratch.mit.edu/projects/632673097/
The project:
https://scratch.mit.edu/projects/632673097/
Last edited by wolfbomb (Jan. 24, 2022 19:50:51)
Infinity is more a concept or idea. Infinity is the idea of a non-finite amount.
Basically, so big that we don't actually have a specific number for it.
Infinity is one of the coolest things in hypothetical mathematics.
The question I'm asking is, is infinity irrational?
VVVVV New Game I made myself VVVVV
https://scratch.mit.edu/projects/632673097/
^^^^^^^^^ Game I made myself ^^^^^^^^^
- Jack2888
- Scratcher
100+ posts
Problem with trying to wait for a single part of the code
What you can do is set a varible to time the movement like this(You might need to change the code a little to support your project)
You can also make this change the speed after time like this:
I hope that helped!
forever
move (movement) steps
forever
if <player ready?> then
set [movement v] to [-10 or what ever speed it goes]
else
set [movement v] to [0]
end
end
end
You can also make this change the speed after time like this:
foreverYou want to keep them negative so that the pipes move left.
if <[pipes passed] > [4]> then
change [movement v] by (-5)
end
end
I hope that helped!
SALMON
HIGHLIGHT & (CTRL)* + SHIFT + DOWN FOR MORE WEIRD STUFF
*Only if you don't have chrome.
This is my signature! I can put whatever I want on it! This does not have any thing to do with my posts.
(^:: list) [ Dino Hat ](foo :: pen) :: hat :: operators//This is a hat wearing dino that eats all the evil kumquats!
( :: #067a3a) { ⸧ :: cap } :: :: cap :: #a4523a
Sorry, you have to wait 60 seconds between posts.
Fact time! I have eaten a kumquat before! It was not good :P
Generation 6: the first time you see this copy and paste it on top of your sig in the scratch forums and increase generation by 1. Social experiment.
Shhh, you did not hear this from me but Comment:"coconut" on my profile for a free follow!
- Jack2888
- Scratcher
100+ posts
Problem with trying to wait for a single part of the code
SALMON
HIGHLIGHT & (CTRL)* + SHIFT + DOWN FOR MORE WEIRD STUFF
*Only if you don't have chrome.
This is my signature! I can put whatever I want on it! This does not have any thing to do with my posts.
(^:: list) [ Dino Hat ](foo :: pen) :: hat :: operators//This is a hat wearing dino that eats all the evil kumquats!
( :: #067a3a) { ⸧ :: cap } :: :: cap :: #a4523a
Sorry, you have to wait 60 seconds between posts.
Fact time! I have eaten a kumquat before! It was not good :P
Generation 6: the first time you see this copy and paste it on top of your sig in the scratch forums and increase generation by 1. Social experiment.
Shhh, you did not hear this from me but Comment:"coconut" on my profile for a free follow!
- wolfbomb
- Scratcher
14 posts
Problem with trying to wait for a single part of the code
What you can do is set a varible to time the movement like this(You might need to change the code a little to support your project)forever
move (movement) steps
forever
if <player ready?> then
set [movement v] to [-10 or what ever speed it goes]
else
set [movement v] to [0]
end
end
end
You can also make this change the speed after time like this:foreverYou want to keep them negative so that the pipes move left.
if <[pipes passed] > [4]> then
change [movement v] by (-5)
end
end
I hope that helped!
Thanks for the help. That solution seems obvious now that I think about it. hindsight is 20/20 lmao.
Infinity is more a concept or idea. Infinity is the idea of a non-finite amount.
Basically, so big that we don't actually have a specific number for it.
Infinity is one of the coolest things in hypothetical mathematics.
The question I'm asking is, is infinity irrational?
VVVVV New Game I made myself VVVVV
https://scratch.mit.edu/projects/632673097/
^^^^^^^^^ Game I made myself ^^^^^^^^^
- Discussion Forums
- » Help with Scripts
- » Problem with trying to wait for a single part of the code