Discuss Scratch

ClickerCreator123
Scratcher
25 posts

I'm making a Punch Out game but need some help

I'm making a Punch Out game, but I don't know how to work with the duck. I want it to either go up after 3 seconds, or if you release the down arrow. Any ideas?

pickrandom-InfinitytoInfinity
gor-dee
Scratcher
1000+ posts

I'm making a Punch Out game but need some help

Without seeing your script it's hard to know but if you are using the
when downkeypressed
then you could do this I think
when downkeypressedswitchcostumetoduckor however you do itsetduck timeto0repeatuntilnotkeydownpressed?orducktime>90changeduck timeby1wait0secsyou may need this block if it runs too fast90 = 3 seconds at 30 fpsswitchcostumetostand
ClickerCreator123
Scratcher
25 posts

I'm making a Punch Out game but need some help

gor-dee wrote:

Without seeing your script it's hard to know but if you are using the
when downkeypressed
then you could do this I think
when downkeypressedswitchcostumetoduckor however you do itsetduck timeto0repeatuntilnotkeydownpressed?orducktime>90changeduck timeby1wait0secsyou may need this block if it runs too fast90 = 3 seconds at 30 fpsswitchcostumetostand
Will it work if I change the 90 to 3 and the wait 0 to wait 3?
ClickerCreator123
Scratcher
25 posts

I'm making a Punch Out game but need some help

gor-dee wrote:

Without seeing your script it's hard to know but if you are using the
when downkeypressed
then you could do this I think
when downkeypressedswitchcostumetoduckor however you do itsetduck timeto0repeatuntilnotkeydownpressed?orducktime>90changeduck timeby1wait0secsyou may need this block if it runs too fast90 = 3 seconds at 30 fpsswitchcostumetostand
Thx it helps
gor-dee
Scratcher
1000+ posts

I'm making a Punch Out game but need some help

ClickerCreator123 wrote:

Will it work if I change the 90 to 3 and the wait 0 to wait 3?
No! Just to explain, a repeat loop should run at 30 times per second but sometimes they run faster if they are only changing a variable so I put the ‘wait 0 secs’ block to force it to run properly. It will check if the down key has been released OR if the time is over 3secs every loop i.e. every 1/30secs and if either of these things happen it stops looping and goes onto the next block.

Powered by DjangoBB