zyps 0.3.1 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. data/bin/zyps +22 -346
  2. data/bin/zyps_demo +116 -188
  3. data/doc/classes/AccelerateAction.html +182 -0
  4. data/doc/classes/{Vector.src/M000006.html → AccelerateAction.src/M000009.html} +5 -5
  5. data/doc/classes/AccelerateAction.src/M000010.html +18 -0
  6. data/doc/classes/Action.html +118 -0
  7. data/doc/classes/AgeCondition.html +181 -0
  8. data/doc/classes/AgeCondition.src/M000039.html +18 -0
  9. data/doc/classes/AgeCondition.src/M000040.html +18 -0
  10. data/doc/classes/ApproachAction.html +189 -0
  11. data/doc/classes/ApproachAction.src/M000048.html +19 -0
  12. data/doc/classes/ApproachAction.src/M000049.html +38 -0
  13. data/doc/classes/Behavior.html +23 -26
  14. data/doc/classes/Behavior.src/{M000003.html → M000001.html} +1 -1
  15. data/doc/classes/Behavior.src/{M000004.html → M000002.html} +2 -2
  16. data/doc/classes/BlendAction.html +181 -0
  17. data/doc/classes/BlendAction.src/M000043.html +18 -0
  18. data/doc/classes/BlendAction.src/M000044.html +18 -0
  19. data/doc/classes/Clock.html +10 -10
  20. data/doc/classes/Clock.src/{M000026.html → M000041.html} +0 -0
  21. data/doc/classes/Clock.src/{M000027.html → M000042.html} +0 -0
  22. data/doc/classes/CollisionCondition.html +148 -0
  23. data/doc/classes/CollisionCondition.src/M000053.html +18 -0
  24. data/doc/classes/Color.html +36 -36
  25. data/doc/classes/Color.src/{M000015.html → M000022.html} +0 -0
  26. data/doc/classes/Color.src/{M000016.html → M000023.html} +0 -0
  27. data/doc/classes/Color.src/{M000017.html → M000024.html} +0 -0
  28. data/doc/classes/Color.src/{M000018.html → M000025.html} +0 -0
  29. data/doc/classes/Color.src/{M000019.html → M000026.html} +0 -0
  30. data/doc/classes/Color.src/{M000020.html → M000027.html} +3 -3
  31. data/doc/classes/Condition.html +118 -0
  32. data/doc/classes/Creature.html +28 -13
  33. data/doc/classes/Creature.src/{M000005.html → M000011.html} +4 -4
  34. data/doc/classes/{Responsive.src/M000030.html → Creature.src/M000012.html} +2 -2
  35. data/doc/classes/DestroyAction.html +181 -0
  36. data/doc/classes/DestroyAction.src/M000030.html +18 -0
  37. data/doc/classes/DestroyAction.src/M000031.html +18 -0
  38. data/doc/classes/EatAction.html +149 -0
  39. data/doc/classes/EatAction.src/M000045.html +21 -0
  40. data/doc/classes/Enclosure.html +206 -0
  41. data/doc/classes/Enclosure.src/M000005.html +18 -0
  42. data/doc/classes/Enclosure.src/M000006.html +31 -0
  43. data/doc/classes/Environment.html +11 -11
  44. data/doc/classes/Environment.src/{M000028.html → M000046.html} +1 -1
  45. data/doc/classes/Environment.src/{M000029.html → M000047.html} +0 -0
  46. data/doc/classes/EnvironmentalFactor.html +2 -51
  47. data/doc/classes/{Responsive.html → FaceAction.html} +21 -16
  48. data/doc/classes/FaceAction.src/M000052.html +18 -0
  49. data/doc/classes/FleeAction.html +189 -0
  50. data/doc/classes/FleeAction.src/M000054.html +19 -0
  51. data/doc/classes/FleeAction.src/M000055.html +38 -0
  52. data/doc/classes/GameObject.html +47 -21
  53. data/doc/classes/GameObject.src/{M000022.html → M000032.html} +3 -4
  54. data/doc/classes/GameObject.src/M000033.html +16 -0
  55. data/doc/classes/GameObject.src/{M000023.html → M000034.html} +1 -1
  56. data/doc/classes/GameObject.src/{M000024.html → M000035.html} +1 -1
  57. data/doc/classes/GameObject.src/{M000025.html → M000036.html} +1 -1
  58. data/doc/classes/Location.html +5 -5
  59. data/doc/classes/Location.src/{M000014.html → M000021.html} +1 -1
  60. data/doc/classes/ProximityCondition.html +182 -0
  61. data/doc/classes/ProximityCondition.src/M000037.html +18 -0
  62. data/doc/classes/ProximityCondition.src/M000038.html +18 -0
  63. data/doc/classes/TagAction.html +181 -0
  64. data/doc/classes/{EnvironmentalFactor.src/M000021.html → TagAction.src/M000028.html} +4 -4
  65. data/doc/classes/TagAction.src/M000029.html +18 -0
  66. data/doc/classes/TagCondition.html +181 -0
  67. data/doc/classes/TagCondition.src/M000007.html +18 -0
  68. data/doc/classes/TagCondition.src/M000008.html +18 -0
  69. data/doc/classes/TrailsView.html +13 -21
  70. data/doc/classes/TrailsView.src/{M000001.html → M000003.html} +3 -3
  71. data/doc/classes/TrailsView.src/{M000002.html → M000004.html} +4 -2
  72. data/doc/classes/TurnAction.html +182 -0
  73. data/doc/classes/TurnAction.src/M000050.html +19 -0
  74. data/doc/classes/TurnAction.src/M000051.html +18 -0
  75. data/doc/classes/Utility.html +48 -48
  76. data/doc/classes/Utility.src/{M000031.html → M000056.html} +0 -0
  77. data/doc/classes/Utility.src/{M000032.html → M000057.html} +0 -0
  78. data/doc/classes/Utility.src/{M000033.html → M000058.html} +0 -0
  79. data/doc/classes/Utility.src/{M000034.html → M000059.html} +0 -0
  80. data/doc/classes/Utility.src/{M000035.html → M000060.html} +0 -0
  81. data/doc/classes/Utility.src/{M000036.html → M000061.html} +0 -0
  82. data/doc/classes/Utility.src/M000062.html +21 -0
  83. data/doc/classes/Vector.html +41 -41
  84. data/doc/classes/Vector.src/M000013.html +5 -11
  85. data/doc/classes/Vector.src/{M000007.html → M000014.html} +0 -0
  86. data/doc/classes/Vector.src/{M000008.html → M000015.html} +0 -0
  87. data/doc/classes/Vector.src/{M000009.html → M000016.html} +0 -0
  88. data/doc/classes/Vector.src/{M000010.html → M000017.html} +0 -0
  89. data/doc/classes/Vector.src/{M000011.html → M000018.html} +0 -0
  90. data/doc/classes/Vector.src/{M000012.html → M000019.html} +0 -0
  91. data/doc/classes/Vector.src/M000020.html +25 -0
  92. data/doc/created.rid +1 -1
  93. data/doc/files/COPYING_LESSER_txt.html +1 -1
  94. data/doc/files/COPYING_txt.html +1 -1
  95. data/doc/files/README_txt.html +1 -1
  96. data/doc/files/lib/zyps/actions_rb.html +134 -0
  97. data/doc/files/lib/zyps/conditions_rb.html +134 -0
  98. data/doc/files/lib/zyps/environmental_factors_rb.html +134 -0
  99. data/doc/files/lib/zyps/views/trails_rb.html +1 -1
  100. data/doc/files/lib/zyps_rb.html +1 -1
  101. data/doc/fr_class_index.html +16 -1
  102. data/doc/fr_file_index.html +3 -0
  103. data/doc/fr_method_index.html +62 -37
  104. data/doc/index.html +2 -2
  105. data/lib/zyps.rb +46 -47
  106. data/lib/zyps/actions.rb +186 -0
  107. data/lib/zyps/conditions.rb +69 -0
  108. data/lib/zyps/environmental_factors.rb +55 -0
  109. data/lib/zyps/views/trails.rb +6 -6
  110. data/test/test_zyps.rb +159 -69
  111. data/test/zyps/test_actions.rb +183 -0
  112. data/test/zyps/test_conditions.rb +83 -0
  113. data/test/zyps/test_environmental_factors.rb +88 -0
  114. metadata +137 -75
  115. data/doc/classes/Utility.src/M000037.html +0 -22
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>do (TagAction)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/zyps/actions.rb, line 169</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">do</span>(<span class="ruby-identifier">actor</span>, <span class="ruby-identifier">target</span>)
15
+ <span class="ruby-identifier">target</span>.<span class="ruby-identifier">tags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">tag</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">target</span>.<span class="ruby-identifier">tags</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">tag</span>)
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,181 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: TagCondition</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">TagCondition</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../files/lib/zyps/conditions_rb.html">
59
+ lib/zyps/conditions.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ <a href="Condition.html">
69
+ Condition
70
+ </a>
71
+ </td>
72
+ </tr>
73
+ </table>
74
+ </div>
75
+ <!-- banner header -->
76
+
77
+ <div id="bodyContent">
78
+
79
+
80
+
81
+ <div id="contextContent">
82
+
83
+ <div id="description">
84
+ <p>
85
+ Act only on objects with the correct tag.
86
+ </p>
87
+
88
+ </div>
89
+
90
+
91
+ </div>
92
+
93
+ <div id="method-list">
94
+ <h3 class="section-bar">Methods</h3>
95
+
96
+ <div class="name-list">
97
+ <a href="#M000007">new</a>&nbsp;&nbsp;
98
+ <a href="#M000008">test</a>&nbsp;&nbsp;
99
+ </div>
100
+ </div>
101
+
102
+ </div>
103
+
104
+
105
+ <!-- if includes -->
106
+
107
+ <div id="section">
108
+
109
+
110
+
111
+
112
+
113
+ <div id="attribute-list">
114
+ <h3 class="section-bar">Attributes</h3>
115
+
116
+ <div class="name-list">
117
+ <table>
118
+ <tr class="top-aligned-row context-row">
119
+ <td class="context-item-name">tag</td>
120
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
121
+ <td class="context-item-desc">
122
+ The tag to look for on the target.
123
+
124
+ </td>
125
+ </tr>
126
+ </table>
127
+ </div>
128
+ </div>
129
+
130
+
131
+
132
+ <!-- if method_list -->
133
+ <div id="methods">
134
+ <h3 class="section-bar">Public Class methods</h3>
135
+
136
+ <div id="method-M000007" class="method-detail">
137
+ <a name="M000007"></a>
138
+
139
+ <div class="method-heading">
140
+ <a href="TagCondition.src/M000007.html" target="Code" class="method-signature"
141
+ onclick="popupCode('TagCondition.src/M000007.html');return false;">
142
+ <span class="method-name">new</span><span class="method-args">(tag)</span>
143
+ </a>
144
+ </div>
145
+
146
+ <div class="method-description">
147
+ </div>
148
+ </div>
149
+
150
+ <h3 class="section-bar">Public Instance methods</h3>
151
+
152
+ <div id="method-M000008" class="method-detail">
153
+ <a name="M000008"></a>
154
+
155
+ <div class="method-heading">
156
+ <a href="TagCondition.src/M000008.html" target="Code" class="method-signature"
157
+ onclick="popupCode('TagCondition.src/M000008.html');return false;">
158
+ <span class="method-name">test</span><span class="method-args">(actor, target)</span>
159
+ </a>
160
+ </div>
161
+
162
+ <div class="method-description">
163
+ <p>
164
+ True if the target has the assigned tag.
165
+ </p>
166
+ </div>
167
+ </div>
168
+
169
+
170
+ </div>
171
+
172
+
173
+ </div>
174
+
175
+
176
+ <div id="validator-badges">
177
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
178
+ </div>
179
+
180
+ </body>
181
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>new (TagCondition)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/zyps/conditions.rb, line 25</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">tag</span>)
15
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">tag</span> = <span class="ruby-identifier">tag</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>test (TagCondition)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/zyps/conditions.rb, line 29</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test</span>(<span class="ruby-identifier">actor</span>, <span class="ruby-identifier">target</span>)
15
+ <span class="ruby-identifier">target</span>.<span class="ruby-identifier">tags</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-ivar">@tag</span>)
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -92,8 +92,8 @@ A view of game objects.
92
92
  <h3 class="section-bar">Methods</h3>
93
93
 
94
94
  <div class="name-list">
95
- <a href="#M000001">new</a>&nbsp;&nbsp;
96
- <a href="#M000002">update</a>&nbsp;&nbsp;
95
+ <a href="#M000003">new</a>&nbsp;&nbsp;
96
+ <a href="#M000004">update</a>&nbsp;&nbsp;
97
97
  </div>
98
98
  </div>
99
99
 
@@ -135,14 +135,6 @@ Dimensions of the view.
135
135
  <td class="context-item-desc">
136
136
  Number of line segments to draw for each object.
137
137
 
138
- </td>
139
- </tr>
140
- <tr class="top-aligned-row context-row">
141
- <td class="context-item-name">trail_width</td>
142
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
143
- <td class="context-item-desc">
144
- Width of the trail behind each object.
145
-
146
138
  </td>
147
139
  </tr>
148
140
  <tr class="top-aligned-row context-row">
@@ -163,13 +155,13 @@ Dimensions of the view.
163
155
  <div id="methods">
164
156
  <h3 class="section-bar">Public Class methods</h3>
165
157
 
166
- <div id="method-M000001" class="method-detail">
167
- <a name="M000001"></a>
158
+ <div id="method-M000003" class="method-detail">
159
+ <a name="M000003"></a>
168
160
 
169
161
  <div class="method-heading">
170
- <a href="TrailsView.src/M000001.html" target="Code" class="method-signature"
171
- onclick="popupCode('TrailsView.src/M000001.html');return false;">
172
- <span class="method-name">new</span><span class="method-args">(width = 600, height = 400, trail_length = 5, trail_width = trail_length)</span>
162
+ <a href="TrailsView.src/M000003.html" target="Code" class="method-signature"
163
+ onclick="popupCode('TrailsView.src/M000003.html');return false;">
164
+ <span class="method-name">new</span><span class="method-args">(width = 600, height = 400, trail_length = 5)</span>
173
165
  </a>
174
166
  </div>
175
167
 
@@ -179,12 +171,12 @@ Dimensions of the view.
179
171
 
180
172
  <h3 class="section-bar">Public Instance methods</h3>
181
173
 
182
- <div id="method-M000002" class="method-detail">
183
- <a name="M000002"></a>
174
+ <div id="method-M000004" class="method-detail">
175
+ <a name="M000004"></a>
184
176
 
185
177
  <div class="method-heading">
186
- <a href="TrailsView.src/M000002.html" target="Code" class="method-signature"
187
- onclick="popupCode('TrailsView.src/M000002.html');return false;">
178
+ <a href="TrailsView.src/M000004.html" target="Code" class="method-signature"
179
+ onclick="popupCode('TrailsView.src/M000004.html');return false;">
188
180
  <span class="method-name">update</span><span class="method-args">(environment)</span>
189
181
  </a>
190
182
  </div>
@@ -196,8 +188,8 @@ canvas. Tracks the position of each <a
196
188
  href="GameObject.html">GameObject</a> over time so it can draw a trail
197
189
  behind it. The head will match the object&#8216;s <a
198
190
  href="Color.html">Color</a> exactly, fading to black at the tail.
199
- trail_width will be used as the line thickness at the object&#8216;s head,
200
- diminishing to 1 at the tail.
191
+ GameObject.size will be used as the line thickness at the object&#8216;s
192
+ head, diminishing to 1 at the tail.
201
193
  </p>
202
194
  </div>
203
195
  </div>
@@ -10,10 +10,10 @@
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/zyps/views/trails.rb, line 34</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> (<span class="ruby-identifier">width</span> = <span class="ruby-value">600</span>, <span class="ruby-identifier">height</span> = <span class="ruby-value">400</span>, <span class="ruby-identifier">trail_length</span> = <span class="ruby-value">5</span>, <span class="ruby-identifier">trail_width</span> = <span class="ruby-identifier">trail_length</span>)
13
+ <pre><span class="ruby-comment cmt"># File lib/zyps/views/trails.rb, line 32</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> (<span class="ruby-identifier">width</span> = <span class="ruby-value">600</span>, <span class="ruby-identifier">height</span> = <span class="ruby-value">400</span>, <span class="ruby-identifier">trail_length</span> = <span class="ruby-value">5</span>)
15
15
 
16
- <span class="ruby-ivar">@width</span>, <span class="ruby-ivar">@height</span>, <span class="ruby-ivar">@trail_length</span>, <span class="ruby-ivar">@trail_width</span> = <span class="ruby-identifier">width</span>, <span class="ruby-identifier">height</span>, <span class="ruby-identifier">trail_length</span>, <span class="ruby-identifier">trail_width</span>
16
+ <span class="ruby-ivar">@width</span>, <span class="ruby-ivar">@height</span>, <span class="ruby-ivar">@trail_length</span>, = <span class="ruby-identifier">width</span>, <span class="ruby-identifier">height</span>, <span class="ruby-identifier">trail_length</span>
17
17
 
18
18
  <span class="ruby-comment cmt">#Create a drawing area.</span>
19
19
  <span class="ruby-ivar">@canvas</span> = <span class="ruby-constant">Gtk</span><span class="ruby-operator">::</span><span class="ruby-constant">DrawingArea</span>.<span class="ruby-identifier">new</span>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/zyps/views/trails.rb, line 73</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/zyps/views/trails.rb, line 71</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">update</span>(<span class="ruby-identifier">environment</span>)
15
15
 
16
16
  <span class="ruby-comment cmt">#Clear the background on the buffer.</span>
@@ -26,6 +26,8 @@
26
26
  <span class="ruby-comment cmt">#For each GameObject in the environment:</span>
27
27
  <span class="ruby-identifier">environment</span>.<span class="ruby-identifier">objects</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">object</span><span class="ruby-operator">|</span>
28
28
 
29
+ <span class="ruby-identifier">object_radius</span> = <span class="ruby-constant">Math</span>.<span class="ruby-identifier">sqrt</span>(<span class="ruby-identifier">object</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">/</span> <span class="ruby-constant">Math</span><span class="ruby-operator">::</span><span class="ruby-constant">PI</span>)
30
+
29
31
  <span class="ruby-comment cmt">#Add the object's current location to the list.</span>
30
32
  <span class="ruby-ivar">@locations</span>[<span class="ruby-identifier">object</span>.<span class="ruby-identifier">identifier</span>] <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">object</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">x</span>, <span class="ruby-identifier">object</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">y</span>]
31
33
  <span class="ruby-comment cmt">#If the list is larger than the number of tail segments, delete the first position.</span>
@@ -49,7 +51,7 @@
49
51
 
50
52
  <span class="ruby-comment cmt">#Multiply the actual drawing width by the current multiplier to get the current drawing width.</span>
51
53
  <span class="ruby-identifier">graphics_context</span>.<span class="ruby-identifier">set_line_attributes</span>(
52
- (<span class="ruby-ivar">@trail_width</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">multiplier</span>).<span class="ruby-identifier">ceil</span>,
54
+ (<span class="ruby-identifier">object_radius</span> <span class="ruby-operator">*</span> <span class="ruby-value">2</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">multiplier</span>).<span class="ruby-identifier">ceil</span>,
53
55
  <span class="ruby-constant">Gdk</span><span class="ruby-operator">::</span><span class="ruby-constant">GC</span><span class="ruby-operator">::</span><span class="ruby-constant">LINE_SOLID</span>,
54
56
  <span class="ruby-constant">Gdk</span><span class="ruby-operator">::</span><span class="ruby-constant">GC</span><span class="ruby-operator">::</span><span class="ruby-constant">CAP_ROUND</span>, <span class="ruby-comment cmt">#Line ends drawn as semicircles.</span>
55
57
  <span class="ruby-constant">Gdk</span><span class="ruby-operator">::</span><span class="ruby-constant">GC</span><span class="ruby-operator">::</span><span class="ruby-constant">JOIN_MITER</span> <span class="ruby-comment cmt">#Only used for polygons.</span>
@@ -0,0 +1,182 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: TurnAction</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">TurnAction</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../files/lib/zyps/actions_rb.html">
59
+ lib/zyps/actions.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ <a href="Action.html">
69
+ Action
70
+ </a>
71
+ </td>
72
+ </tr>
73
+ </table>
74
+ </div>
75
+ <!-- banner header -->
76
+
77
+ <div id="bodyContent">
78
+
79
+
80
+
81
+ <div id="contextContent">
82
+
83
+ <div id="description">
84
+ <p>
85
+ Turn over time.
86
+ </p>
87
+
88
+ </div>
89
+
90
+
91
+ </div>
92
+
93
+ <div id="method-list">
94
+ <h3 class="section-bar">Methods</h3>
95
+
96
+ <div class="name-list">
97
+ <a href="#M000051">do</a>&nbsp;&nbsp;
98
+ <a href="#M000050">new</a>&nbsp;&nbsp;
99
+ </div>
100
+ </div>
101
+
102
+ </div>
103
+
104
+
105
+ <!-- if includes -->
106
+
107
+ <div id="section">
108
+
109
+
110
+
111
+
112
+
113
+ <div id="attribute-list">
114
+ <h3 class="section-bar">Attributes</h3>
115
+
116
+ <div class="name-list">
117
+ <table>
118
+ <tr class="top-aligned-row context-row">
119
+ <td class="context-item-name">rate</td>
120
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
121
+ <td class="context-item-desc">
122
+ Degrees per second to turn. Positive turns clockwise, negative turns
123
+ counter-clockwise.
124
+
125
+ </td>
126
+ </tr>
127
+ </table>
128
+ </div>
129
+ </div>
130
+
131
+
132
+
133
+ <!-- if method_list -->
134
+ <div id="methods">
135
+ <h3 class="section-bar">Public Class methods</h3>
136
+
137
+ <div id="method-M000050" class="method-detail">
138
+ <a name="M000050"></a>
139
+
140
+ <div class="method-heading">
141
+ <a href="TurnAction.src/M000050.html" target="Code" class="method-signature"
142
+ onclick="popupCode('TurnAction.src/M000050.html');return false;">
143
+ <span class="method-name">new</span><span class="method-args">(rate = 0)</span>
144
+ </a>
145
+ </div>
146
+
147
+ <div class="method-description">
148
+ </div>
149
+ </div>
150
+
151
+ <h3 class="section-bar">Public Instance methods</h3>
152
+
153
+ <div id="method-M000051" class="method-detail">
154
+ <a name="M000051"></a>
155
+
156
+ <div class="method-heading">
157
+ <a href="TurnAction.src/M000051.html" target="Code" class="method-signature"
158
+ onclick="popupCode('TurnAction.src/M000051.html');return false;">
159
+ <span class="method-name">do</span><span class="method-args">(actor, target)</span>
160
+ </a>
161
+ </div>
162
+
163
+ <div class="method-description">
164
+ <p>
165
+ Turn according to elapsed time.
166
+ </p>
167
+ </div>
168
+ </div>
169
+
170
+
171
+ </div>
172
+
173
+
174
+ </div>
175
+
176
+
177
+ <div id="validator-badges">
178
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
179
+ </div>
180
+
181
+ </body>
182
+ </html>