Making a spinning effect with the new width and height blocks

howto

#1

How to make a spinning effect using the new set width and height blocks.
The outcome:



First, make sure you have the new update. This has the winter charaters and the set width and height blocks.
Then, go into the code.
Use a repeat forever block to make this last forever.
First, set a repeat block for 100.
Make sure to have made a variable, make it increase by one in this.
Then, make put the new set width and height block.
Make it so the width is set to the variable. The height is set to 100.
This code is in the repeat block
Then put a repeat block under it. Make it repeat times 200
Put the code just like above in it
Below it, put another reapeat block set for 100. Again, the code is the same.


If you want it bigger, just tweak these set and width blocks, so it adds the amount you want with the variable under width, and increase the height to match the desired shape.


Now you have made a text, shape or character spin!
Wait, the spinning effect works for one charater, unless you made other variables for it.
@pomtl


Should we add a remix tab to Hopscotch? -Yusamac's GT :man_technologist:t5:
๐•„๐•–๐•จ๐•ฅ๐•จ๐• โ„‚๐•ฃ๐•–๐•’๐•ฅ๐• ๐•ฃ'๐•ค ๐”พ๐•–๐•Ÿ๐•–๐•ฃ๐•’๐• ๐•‹๐• ๐•ก๐•š๐•”! (โœฟโ—•แ—œโ—•)โ”โ™ซ.*๏ฝฅ๏ฝก๏พŸ(ใฃโ—”โ—กโ—”)ใฃ(How's Your day? Hope its good :D) (Everyone's Awesome!) Mewtwo is amazing!-CoM
#2

Just found reason why they stretched
I forgot to make seperate variables for them


#3

I did something similar to this. Itโ€™s really cool! Btw, there are now object variables width and height.


#4

I know, but you canโ€™t change those


#5

You did yours different thatโ€™s why
Just checked the code for yours to see if they were different


#6

What about
Repeat times (n)
Set width ((Self) Width) - 1) height ((Self) Height) + 1)
End
There is a (Self) Height plus 1 because for some reason, when you stretch the width, the height goes down so it compensates.


#7

yep


#8

I didnโ€™t think of that honestly


#9

ok


#10

I saw your yeti one and itโ€™s really cool!


#11

That is a really good and pretty simple use case for the new blocks! I definitely see several use cases for this.


#12

Great topic! For those who havenโ€™t already figured this out, this will be very useful! Keep it up! :+1:


#13

Hey @MewtwoCreator, you can do this easier with sine, check!


#14

Just a note:
Topic Tutorials belong in Open Source Code (like this topic)

Coding Schools, which have multiple tutorials, belong in Hopscotch Academy (unlike this topic)


#15

It would make more sense as x130 instead of x200 because it ends up kinda stretched.


#16

Yeah but you should always have the double amount of the size in the multiplier so it actually turns