Object Attraction: различия между версиями
Patarakin (обсуждение | вклад) |
Patarakin (обсуждение | вклад) |
||
(не показаны 3 промежуточные версии этого же участника) | |||
Строка 9: | Строка 9: | ||
In '''Object Attraction''' two or more objects are attracted to each other; or are pulling on each other. This can also be referred to as gravity. | In '''Object Attraction''' two or more objects are attracted to each other; or are pulling on each other. This can also be referred to as gravity. | ||
== Elliptical Orbit Method == | == Scratch == | ||
=== Elliptical Orbit Method === | |||
One way to make one object attracted to another object is to make a sprite "Orbit" around the other object. This method is always 100% accurate and will automatically move when the object that it is being rotated about moves. Here is a script that creates an elliptical orbit: | One way to make one object attracted to another object is to make a sprite "Orbit" around the other object. This method is always 100% accurate and will automatically move when the object that it is being rotated about moves. Here is a script that creates an elliptical orbit: | ||
Строка 32: | Строка 34: | ||
One example of the elliptical orbit method can be found [http://scratch.mit.edu/projects/dazman/1345968 here]. | One example of the elliptical orbit method can be found [http://scratch.mit.edu/projects/dazman/1345968 here]. | ||
== Velocity Method == | === Velocity Method === | ||
Another method is to have a sprite change its velocity automatically based on its position. This method is very inaccurate however it can be very useful if your creating a game where you have to avoid multiple sprites. The Following scripts will be placed into the item that is "following" another sprite: | Another method is to have a sprite change its velocity automatically based on its position. This method is very inaccurate however it can be very useful if your creating a game where you have to avoid multiple sprites. The Following scripts will be placed into the item that is "following" another sprite: | ||
Строка 60: | Строка 62: | ||
</scratchblocks> | </scratchblocks> | ||
; Пример проекта с притяжением объектов | |||
: http://scratch.mit.edu/projects/dazman/1346019 | |||
= | <scratch project="1346019" /> | ||
=== Trigonometric Method === | |||
== Direct Movement Method == | * Simulating Gravity | ||
==== Direct Movement Method ==== | |||
This method although far more basic than the previous methods, can be very useful in certain situations. This method is very accurate and will move automatically with the sprite. Here is an example script that would be place in the sprite that is "following" the other sprite: | This method although far more basic than the previous methods, can be very useful in certain situations. This method is very accurate and will move automatically with the sprite. Here is an example script that would be place in the sprite that is "following" the other sprite: | ||
Строка 77: | Строка 82: | ||
</scratchblocks> | </scratchblocks> | ||
<scratch project="1346041" /> | |||
: http://scratch.mit.edu/projects/dazman/1346041 | |||
== Wall Method == | ==== Wall Method ==== | ||
This method sort of has a fast wall attraction. | This method sort of has a fast wall attraction. | ||
Строка 90: | Строка 96: | ||
</scratchblocks> | </scratchblocks> | ||
== | |||
== StarLogo Nova== | |||
[[Category:Scripting Tutorials]] | [[Category:Scripting Tutorials]] |
Текущая версия на 10:29, 2 мая 2024
Описание | Как имитировать притяжение объектов друг к другу? |
---|---|
Область знаний | Биология, Информатика, Физика |
Область использования (ISTE) | Computational Thinker |
Возрастная категория | 8
|
Поясняющее видео | |
Близкие рецепту понятия | Преследовать другого агента |
Среды и средства для приготовления рецепта: | Scratch, Snap!, StarLogo Nova |
In Object Attraction two or more objects are attracted to each other; or are pulling on each other. This can also be referred to as gravity.
Scratch
Elliptical Orbit Method
One way to make one object attracted to another object is to make a sprite "Orbit" around the other object. This method is always 100% accurate and will automatically move when the object that it is being rotated about moves. Here is a script that creates an elliptical orbit:
Remember that this script goes in the object that is being rotated.
One example of the elliptical orbit method can be found here.
Velocity Method
Another method is to have a sprite change its velocity automatically based on its position. This method is very inaccurate however it can be very useful if your creating a game where you have to avoid multiple sprites. The Following scripts will be placed into the item that is "following" another sprite:
- Пример проекта с притяжением объектов
- http://scratch.mit.edu/projects/dazman/1346019
Trigonometric Method
- Simulating Gravity
Direct Movement Method
This method although far more basic than the previous methods, can be very useful in certain situations. This method is very accurate and will move automatically with the sprite. Here is an example script that would be place in the sprite that is "following" the other sprite:
Wall Method
This method sort of has a fast wall attraction.