<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>http://digida.mgpu.ru/index.php?action=history&amp;feed=atom&amp;title=Pen_Particles</id>
	<title>Pen Particles - История изменений</title>
	<link rel="self" type="application/atom+xml" href="http://digida.mgpu.ru/index.php?action=history&amp;feed=atom&amp;title=Pen_Particles"/>
	<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Pen_Particles&amp;action=history"/>
	<updated>2026-05-02T09:17:46Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>http://digida.mgpu.ru/index.php?title=Pen_Particles&amp;diff=1764&amp;oldid=prev</id>
		<title>Patarakin: 1 версия импортирована</title>
		<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Pen_Particles&amp;diff=1764&amp;oldid=prev"/>
		<updated>2022-07-21T08:33:16Z</updated>

		<summary type="html">&lt;p&gt;1 версия импортирована&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая версия&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия от 11:33, 21 июля 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Patarakin</name></author>
	</entry>
	<entry>
		<id>http://digida.mgpu.ru/index.php?title=Pen_Particles&amp;diff=1763&amp;oldid=prev</id>
		<title>scratch&gt;TheTrillion: Minor thing.</title>
		<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Pen_Particles&amp;diff=1763&amp;oldid=prev"/>
		<updated>2021-05-10T06:04:17Z</updated>

		<summary type="html">&lt;p&gt;Minor thing.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{stub|date=November 2019}}&lt;br /&gt;
&lt;br /&gt;
This tutorial will show how to make &amp;#039;&amp;#039;&amp;#039;pen particles&amp;#039;&amp;#039;&amp;#039;. These are often used as background or death effects in many games.&lt;br /&gt;
&lt;br /&gt;
==Adding Particles to a List==&lt;br /&gt;
The first step to making pen particles is making a list of particles as a 2D array, each particle will have more than one item on the particles list.&lt;br /&gt;
First, a list needs to be created, called particles:&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;(particles::list)&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
Now, a script that adds a particle at a certain x and y position with a certain x and y velocity.&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;define Add particle | Position:(x), (y) | Velocities: (X Vel) (Y Vel) Color: (color) Size (size::custom)&lt;br /&gt;
add (x::custom) to [particles v] // The starting X position of the particle&lt;br /&gt;
add (y::custom) to [particles v] // The starting Y position of the particle&lt;br /&gt;
add (X vel::custom) to [particles v] // The starting X velocity of the particle&lt;br /&gt;
add (Y vel::custom) to [particles v] // The starting Y velocity of the particle&lt;br /&gt;
add (color::custom) to [particles v] // The color of the particle&lt;br /&gt;
add (size::custom) to [particles v] // The size of the particle&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Deleting Particles==&lt;br /&gt;
Now a script needs to be created to delete a particle at a certain item on the particles list:&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
define Delete particle (i)&lt;br /&gt;
delete ((i)+(5)) of [particles v] // starts at the particle&amp;#039;s last item in the list&lt;br /&gt;
delete ((i)+(4)) of [particles v] // and moves back until all items on the list that belong to that particle are deleted&lt;br /&gt;
delete ((i)+(3)) of [particles v]&lt;br /&gt;
delete ((i)+(2)) of [particles v]&lt;br /&gt;
delete ((i)+(1)) of [particles v]&lt;br /&gt;
delete (i) of [particles v]&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Rendering Particles==&lt;br /&gt;
A script will also be needed to render the particles that are already stored in the particles list:&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;define Render&lt;br /&gt;
erase all // erasing all of the drawing made previously&lt;br /&gt;
set [i v] to (1)&lt;br /&gt;
repeat ((length of [particles v]::list)/(6)) // The amount of particles in the list because each particle takes up 6 items&lt;br /&gt;
   go to x: (item (i) of [particles v]) y: (item ((i)+(1)) of [particles v]) // This tutorial uses the particle&amp;#039;s items on the list to set the properties of the sprite&lt;br /&gt;
    set pen size to (item ((i)+(5)) of [particles v]::list)&lt;br /&gt;
    set pen color to (item ((i)+(4)) of [particles v]::list)&lt;br /&gt;
    pen down // Making a dot&lt;br /&gt;
    pen up&lt;br /&gt;
    change [i v] by (6)&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Updating the Particles&amp;#039; Positions==&lt;br /&gt;
This script moves the particles around:&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;define Update&lt;br /&gt;
set [i v] to (1)&lt;br /&gt;
repeat ((length of [paticles v])/(6)&lt;br /&gt;
    replace item (i) of [particles v] with ((item (i) of [particles v])+(item ((i) + (2)) of [particles v]))::list // Changing the x position by the x velocity&lt;br /&gt;
    replace item ((i)+(1)) of [particles v] with ((item ((i)+(1)) of [particles v])+(item ((i) + (3)) of [particles v])) // Changing the y position of the particle by its y velocity&lt;br /&gt;
    replace item ((i)+(2)) of [particles v] with (((item ((i)+(2)) of [particles v])::list)-(1))//Optional gravity, change the Y velocity by -1&lt;br /&gt;
    if&amp;lt;&amp;lt;([abs v](item (i) of [particles v])::operators)&amp;gt;(240)&amp;gt; or&amp;lt;([abs v](item ((i)+(1)) of [particles v])::operators)&amp;gt;(180)&amp;gt;&amp;gt;then&lt;br /&gt;
        Delete particle (i)::custom // if the particle if off the screen, delete it.&lt;br /&gt;
    end&lt;br /&gt;
    change [i v] by (6)&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementing The Code==&lt;br /&gt;
Now that all the scripts are made, they must be used. Depending on the type of program wished to make,  one may want to make mouse effects:&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
When green flag clicked&lt;br /&gt;
delete all of [particles v]&lt;br /&gt;
forever&lt;br /&gt;
    Add particle | Position:(mouse x), (mouse y) | Velocities: (pick a random (-10) to (10)::operators) (pick a random (-10) to (10)::operators) Color: (pick a random (0) to (100)::operators) Size (pick a random (-10) to (10)::operators)::custom&lt;br /&gt;
    Update::custom&lt;br /&gt;
    Render::custom&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
Or one can make background effects:&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
When green flag clicked//If  background effects are made, make sure that they do not have gravity by removing the change y velocity block in the update script.&lt;br /&gt;
delete all of [particles v]&lt;br /&gt;
forever&lt;br /&gt;
    Add particle | Position:(pick a random (-240) to (240)::operators), (pick a random (-180) to (180)::operators) | Velocities: (pick a random (-10) to (10)::operators) (pick a random (-10) to (10)::operators) Color: (pick a random (0) to (100)::operators) Size (pick a random (-10) to (10)::operators)::custom&lt;br /&gt;
    Update::custom&lt;br /&gt;
    Render::custom&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
[[Category:Math Tutorials]][[Category:Scripting Tutorials]]&lt;/div&gt;</summary>
		<author><name>scratch&gt;TheTrillion</name></author>
	</entry>
</feed>