Pages: 1
Topic closed
This is for enginenumber9.
NOTE THAT THIS IS FOR A SQUARE WITH A SIZE OF 20 PIXELS, YOU WILL NEED ALL NEW CODE FOR ONES OTHER THAN 2O PIXELS.
First, you need a list. Go to the variables section and click the [make a list] button. Title the list "turn". Add these values to it:
1
1
2
2
3
3
4
4
4
4
4
4
4
3
3
2
2
1
1
0
You also need variables called:
y
iterator
Here's the code:
[set [y] to (y position)] This sets the variable "y" to the square's y position. [set [iterator] to [0]] This sets "iterator" to 0. [repeat (20)] This repeats the blocks inside of the repeat 20 times. [][change [iterator] by (1)] This changes "iterator" by 1. [][turn ↴ (4.5) degrees] This turns the square 4.5 degrees clockwise. [][change x by (1)] This changes the square's x position by 1. [][set y to ((y) + (item (iterator) of [turn]))] This is the most important part - It elevates the square off the platform exactly the right amount to make it appear as if it is standing on it corner, or side, etc. [ ] [point in direction (90)] This resets it to the right direction.
Offline
and what does this do?
Offline
Topic closed
Pages: 1