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.
- data/bin/zyps +22 -346
- data/bin/zyps_demo +116 -188
- data/doc/classes/AccelerateAction.html +182 -0
- data/doc/classes/{Vector.src/M000006.html → AccelerateAction.src/M000009.html} +5 -5
- data/doc/classes/AccelerateAction.src/M000010.html +18 -0
- data/doc/classes/Action.html +118 -0
- data/doc/classes/AgeCondition.html +181 -0
- data/doc/classes/AgeCondition.src/M000039.html +18 -0
- data/doc/classes/AgeCondition.src/M000040.html +18 -0
- data/doc/classes/ApproachAction.html +189 -0
- data/doc/classes/ApproachAction.src/M000048.html +19 -0
- data/doc/classes/ApproachAction.src/M000049.html +38 -0
- data/doc/classes/Behavior.html +23 -26
- data/doc/classes/Behavior.src/{M000003.html → M000001.html} +1 -1
- data/doc/classes/Behavior.src/{M000004.html → M000002.html} +2 -2
- data/doc/classes/BlendAction.html +181 -0
- data/doc/classes/BlendAction.src/M000043.html +18 -0
- data/doc/classes/BlendAction.src/M000044.html +18 -0
- data/doc/classes/Clock.html +10 -10
- data/doc/classes/Clock.src/{M000026.html → M000041.html} +0 -0
- data/doc/classes/Clock.src/{M000027.html → M000042.html} +0 -0
- data/doc/classes/CollisionCondition.html +148 -0
- data/doc/classes/CollisionCondition.src/M000053.html +18 -0
- data/doc/classes/Color.html +36 -36
- data/doc/classes/Color.src/{M000015.html → M000022.html} +0 -0
- data/doc/classes/Color.src/{M000016.html → M000023.html} +0 -0
- data/doc/classes/Color.src/{M000017.html → M000024.html} +0 -0
- data/doc/classes/Color.src/{M000018.html → M000025.html} +0 -0
- data/doc/classes/Color.src/{M000019.html → M000026.html} +0 -0
- data/doc/classes/Color.src/{M000020.html → M000027.html} +3 -3
- data/doc/classes/Condition.html +118 -0
- data/doc/classes/Creature.html +28 -13
- data/doc/classes/Creature.src/{M000005.html → M000011.html} +4 -4
- data/doc/classes/{Responsive.src/M000030.html → Creature.src/M000012.html} +2 -2
- data/doc/classes/DestroyAction.html +181 -0
- data/doc/classes/DestroyAction.src/M000030.html +18 -0
- data/doc/classes/DestroyAction.src/M000031.html +18 -0
- data/doc/classes/EatAction.html +149 -0
- data/doc/classes/EatAction.src/M000045.html +21 -0
- data/doc/classes/Enclosure.html +206 -0
- data/doc/classes/Enclosure.src/M000005.html +18 -0
- data/doc/classes/Enclosure.src/M000006.html +31 -0
- data/doc/classes/Environment.html +11 -11
- data/doc/classes/Environment.src/{M000028.html → M000046.html} +1 -1
- data/doc/classes/Environment.src/{M000029.html → M000047.html} +0 -0
- data/doc/classes/EnvironmentalFactor.html +2 -51
- data/doc/classes/{Responsive.html → FaceAction.html} +21 -16
- data/doc/classes/FaceAction.src/M000052.html +18 -0
- data/doc/classes/FleeAction.html +189 -0
- data/doc/classes/FleeAction.src/M000054.html +19 -0
- data/doc/classes/FleeAction.src/M000055.html +38 -0
- data/doc/classes/GameObject.html +47 -21
- data/doc/classes/GameObject.src/{M000022.html → M000032.html} +3 -4
- data/doc/classes/GameObject.src/M000033.html +16 -0
- data/doc/classes/GameObject.src/{M000023.html → M000034.html} +1 -1
- data/doc/classes/GameObject.src/{M000024.html → M000035.html} +1 -1
- data/doc/classes/GameObject.src/{M000025.html → M000036.html} +1 -1
- data/doc/classes/Location.html +5 -5
- data/doc/classes/Location.src/{M000014.html → M000021.html} +1 -1
- data/doc/classes/ProximityCondition.html +182 -0
- data/doc/classes/ProximityCondition.src/M000037.html +18 -0
- data/doc/classes/ProximityCondition.src/M000038.html +18 -0
- data/doc/classes/TagAction.html +181 -0
- data/doc/classes/{EnvironmentalFactor.src/M000021.html → TagAction.src/M000028.html} +4 -4
- data/doc/classes/TagAction.src/M000029.html +18 -0
- data/doc/classes/TagCondition.html +181 -0
- data/doc/classes/TagCondition.src/M000007.html +18 -0
- data/doc/classes/TagCondition.src/M000008.html +18 -0
- data/doc/classes/TrailsView.html +13 -21
- data/doc/classes/TrailsView.src/{M000001.html → M000003.html} +3 -3
- data/doc/classes/TrailsView.src/{M000002.html → M000004.html} +4 -2
- data/doc/classes/TurnAction.html +182 -0
- data/doc/classes/TurnAction.src/M000050.html +19 -0
- data/doc/classes/TurnAction.src/M000051.html +18 -0
- data/doc/classes/Utility.html +48 -48
- data/doc/classes/Utility.src/{M000031.html → M000056.html} +0 -0
- data/doc/classes/Utility.src/{M000032.html → M000057.html} +0 -0
- data/doc/classes/Utility.src/{M000033.html → M000058.html} +0 -0
- data/doc/classes/Utility.src/{M000034.html → M000059.html} +0 -0
- data/doc/classes/Utility.src/{M000035.html → M000060.html} +0 -0
- data/doc/classes/Utility.src/{M000036.html → M000061.html} +0 -0
- data/doc/classes/Utility.src/M000062.html +21 -0
- data/doc/classes/Vector.html +41 -41
- data/doc/classes/Vector.src/M000013.html +5 -11
- data/doc/classes/Vector.src/{M000007.html → M000014.html} +0 -0
- data/doc/classes/Vector.src/{M000008.html → M000015.html} +0 -0
- data/doc/classes/Vector.src/{M000009.html → M000016.html} +0 -0
- data/doc/classes/Vector.src/{M000010.html → M000017.html} +0 -0
- data/doc/classes/Vector.src/{M000011.html → M000018.html} +0 -0
- data/doc/classes/Vector.src/{M000012.html → M000019.html} +0 -0
- data/doc/classes/Vector.src/M000020.html +25 -0
- data/doc/created.rid +1 -1
- data/doc/files/COPYING_LESSER_txt.html +1 -1
- data/doc/files/COPYING_txt.html +1 -1
- data/doc/files/README_txt.html +1 -1
- data/doc/files/lib/zyps/actions_rb.html +134 -0
- data/doc/files/lib/zyps/conditions_rb.html +134 -0
- data/doc/files/lib/zyps/environmental_factors_rb.html +134 -0
- data/doc/files/lib/zyps/views/trails_rb.html +1 -1
- data/doc/files/lib/zyps_rb.html +1 -1
- data/doc/fr_class_index.html +16 -1
- data/doc/fr_file_index.html +3 -0
- data/doc/fr_method_index.html +62 -37
- data/doc/index.html +2 -2
- data/lib/zyps.rb +46 -47
- data/lib/zyps/actions.rb +186 -0
- data/lib/zyps/conditions.rb +69 -0
- data/lib/zyps/environmental_factors.rb +55 -0
- data/lib/zyps/views/trails.rb +6 -6
- data/test/test_zyps.rb +159 -69
- data/test/zyps/test_actions.rb +183 -0
- data/test/zyps/test_conditions.rb +83 -0
- data/test/zyps/test_environmental_factors.rb +88 -0
- metadata +137 -75
- data/doc/classes/Utility.src/M000037.html +0 -22
|
@@ -0,0 +1,21 @@
|
|
|
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 (EatAction)</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 152</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-comment cmt">#Remove the target from the environment.</span>
|
|
16
|
+
<span class="ruby-keyword kw">super</span>
|
|
17
|
+
<span class="ruby-comment cmt">#Grow in size.</span>
|
|
18
|
+
<span class="ruby-identifier">actor</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">target</span>.<span class="ruby-identifier">size</span>
|
|
19
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
20
|
+
</body>
|
|
21
|
+
</html>
|
|
@@ -0,0 +1,206 @@
|
|
|
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: Enclosure</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">Enclosure</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../files/lib/zyps/environmental_factors_rb.html">
|
|
59
|
+
lib/zyps/environmental_factors.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="EnvironmentalFactor.html">
|
|
69
|
+
EnvironmentalFactor
|
|
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
|
+
Keeps all objects within a set of walls.
|
|
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="#M000006">act</a>
|
|
98
|
+
<a href="#M000005">new</a>
|
|
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">bottom</td>
|
|
120
|
+
<td class="context-item-value"> [RW] </td>
|
|
121
|
+
<td class="context-item-desc">
|
|
122
|
+
Y coordinate of bottom boundary.
|
|
123
|
+
|
|
124
|
+
</td>
|
|
125
|
+
</tr>
|
|
126
|
+
<tr class="top-aligned-row context-row">
|
|
127
|
+
<td class="context-item-name">left</td>
|
|
128
|
+
<td class="context-item-value"> [RW] </td>
|
|
129
|
+
<td class="context-item-desc">
|
|
130
|
+
X coordinate of left boundary.
|
|
131
|
+
|
|
132
|
+
</td>
|
|
133
|
+
</tr>
|
|
134
|
+
<tr class="top-aligned-row context-row">
|
|
135
|
+
<td class="context-item-name">right</td>
|
|
136
|
+
<td class="context-item-value"> [RW] </td>
|
|
137
|
+
<td class="context-item-desc">
|
|
138
|
+
X coordinate of right boundary.
|
|
139
|
+
|
|
140
|
+
</td>
|
|
141
|
+
</tr>
|
|
142
|
+
<tr class="top-aligned-row context-row">
|
|
143
|
+
<td class="context-item-name">top</td>
|
|
144
|
+
<td class="context-item-value"> [RW] </td>
|
|
145
|
+
<td class="context-item-desc">
|
|
146
|
+
Y coordinate of top boundary.
|
|
147
|
+
|
|
148
|
+
</td>
|
|
149
|
+
</tr>
|
|
150
|
+
</table>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
<!-- if method_list -->
|
|
157
|
+
<div id="methods">
|
|
158
|
+
<h3 class="section-bar">Public Class methods</h3>
|
|
159
|
+
|
|
160
|
+
<div id="method-M000005" class="method-detail">
|
|
161
|
+
<a name="M000005"></a>
|
|
162
|
+
|
|
163
|
+
<div class="method-heading">
|
|
164
|
+
<a href="Enclosure.src/M000005.html" target="Code" class="method-signature"
|
|
165
|
+
onclick="popupCode('Enclosure.src/M000005.html');return false;">
|
|
166
|
+
<span class="method-name">new</span><span class="method-args">(left = 0, top = 0, right = 0, bottom = 0)</span>
|
|
167
|
+
</a>
|
|
168
|
+
</div>
|
|
169
|
+
|
|
170
|
+
<div class="method-description">
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
|
|
174
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
|
175
|
+
|
|
176
|
+
<div id="method-M000006" class="method-detail">
|
|
177
|
+
<a name="M000006"></a>
|
|
178
|
+
|
|
179
|
+
<div class="method-heading">
|
|
180
|
+
<a href="Enclosure.src/M000006.html" target="Code" class="method-signature"
|
|
181
|
+
onclick="popupCode('Enclosure.src/M000006.html');return false;">
|
|
182
|
+
<span class="method-name">act</span><span class="method-args">(object)</span>
|
|
183
|
+
</a>
|
|
184
|
+
</div>
|
|
185
|
+
|
|
186
|
+
<div class="method-description">
|
|
187
|
+
<p>
|
|
188
|
+
If object is beyond a boundary, set its position equal to the boundary and
|
|
189
|
+
reflect it.
|
|
190
|
+
</p>
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
</div>
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
</div>
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
<div id="validator-badges">
|
|
202
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
203
|
+
</div>
|
|
204
|
+
|
|
205
|
+
</body>
|
|
206
|
+
</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 (Enclosure)</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/environmental_factors.rb, line 32</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">left</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">top</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">right</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">bottom</span> = <span class="ruby-value">0</span>)
|
|
15
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">left</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">top</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">right</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">bottom</span> = <span class="ruby-identifier">left</span>, <span class="ruby-identifier">top</span>, <span class="ruby-identifier">right</span>, <span class="ruby-identifier">bottom</span>
|
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,31 @@
|
|
|
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>act (Enclosure)</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/environmental_factors.rb, line 36</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">act</span>(<span class="ruby-identifier">object</span>)
|
|
15
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">object</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">x</span> <span class="ruby-operator"><</span> <span class="ruby-ivar">@left</span>) <span class="ruby-keyword kw">then</span>
|
|
16
|
+
<span class="ruby-identifier">object</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">x</span> = <span class="ruby-ivar">@left</span>
|
|
17
|
+
<span class="ruby-identifier">object</span>.<span class="ruby-identifier">vector</span>.<span class="ruby-identifier">pitch</span> = <span class="ruby-constant">Utility</span>.<span class="ruby-identifier">find_reflection_angle</span>(<span class="ruby-value">90</span>, <span class="ruby-identifier">object</span>.<span class="ruby-identifier">vector</span>.<span class="ruby-identifier">pitch</span>)
|
|
18
|
+
<span class="ruby-keyword kw">elsif</span> (<span class="ruby-identifier">object</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">x</span> <span class="ruby-operator">></span> <span class="ruby-ivar">@right</span>) <span class="ruby-keyword kw">then</span>
|
|
19
|
+
<span class="ruby-identifier">object</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">x</span> = <span class="ruby-ivar">@right</span>
|
|
20
|
+
<span class="ruby-identifier">object</span>.<span class="ruby-identifier">vector</span>.<span class="ruby-identifier">pitch</span> = <span class="ruby-constant">Utility</span>.<span class="ruby-identifier">find_reflection_angle</span>(<span class="ruby-value">270</span>, <span class="ruby-identifier">object</span>.<span class="ruby-identifier">vector</span>.<span class="ruby-identifier">pitch</span>)
|
|
21
|
+
<span class="ruby-keyword kw">end</span>
|
|
22
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">object</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">y</span> <span class="ruby-operator">></span> <span class="ruby-ivar">@top</span>) <span class="ruby-keyword kw">then</span>
|
|
23
|
+
<span class="ruby-identifier">object</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">y</span> = <span class="ruby-ivar">@top</span>
|
|
24
|
+
<span class="ruby-identifier">object</span>.<span class="ruby-identifier">vector</span>.<span class="ruby-identifier">pitch</span> = <span class="ruby-constant">Utility</span>.<span class="ruby-identifier">find_reflection_angle</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">object</span>.<span class="ruby-identifier">vector</span>.<span class="ruby-identifier">pitch</span>)
|
|
25
|
+
<span class="ruby-keyword kw">elsif</span> (<span class="ruby-identifier">object</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">y</span> <span class="ruby-operator"><</span> <span class="ruby-ivar">@bottom</span>) <span class="ruby-keyword kw">then</span>
|
|
26
|
+
<span class="ruby-identifier">object</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">y</span> = <span class="ruby-ivar">@bottom</span>
|
|
27
|
+
<span class="ruby-identifier">object</span>.<span class="ruby-identifier">vector</span>.<span class="ruby-identifier">pitch</span> = <span class="ruby-constant">Utility</span>.<span class="ruby-identifier">find_reflection_angle</span>(<span class="ruby-value">180</span>, <span class="ruby-identifier">object</span>.<span class="ruby-identifier">vector</span>.<span class="ruby-identifier">pitch</span>)
|
|
28
|
+
<span class="ruby-keyword kw">end</span>
|
|
29
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
30
|
+
</body>
|
|
31
|
+
</html>
|
|
@@ -92,8 +92,8 @@ A virtual environment.
|
|
|
92
92
|
<h3 class="section-bar">Methods</h3>
|
|
93
93
|
|
|
94
94
|
<div class="name-list">
|
|
95
|
-
<a href="#
|
|
96
|
-
<a href="#
|
|
95
|
+
<a href="#M000047">interact</a>
|
|
96
|
+
<a href="#M000046">new</a>
|
|
97
97
|
</div>
|
|
98
98
|
</div>
|
|
99
99
|
|
|
@@ -149,12 +149,12 @@ the <a href="Environment.html">Environment</a>.
|
|
|
149
149
|
<div id="methods">
|
|
150
150
|
<h3 class="section-bar">Public Class methods</h3>
|
|
151
151
|
|
|
152
|
-
<div id="method-
|
|
153
|
-
<a name="
|
|
152
|
+
<div id="method-M000046" class="method-detail">
|
|
153
|
+
<a name="M000046"></a>
|
|
154
154
|
|
|
155
155
|
<div class="method-heading">
|
|
156
|
-
<a href="Environment.src/
|
|
157
|
-
onclick="popupCode('Environment.src/
|
|
156
|
+
<a href="Environment.src/M000046.html" target="Code" class="method-signature"
|
|
157
|
+
onclick="popupCode('Environment.src/M000046.html');return false;">
|
|
158
158
|
<span class="method-name">new</span><span class="method-args">(objects = [], environmental_factors = [])</span>
|
|
159
159
|
</a>
|
|
160
160
|
</div>
|
|
@@ -165,12 +165,12 @@ the <a href="Environment.html">Environment</a>.
|
|
|
165
165
|
|
|
166
166
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
167
167
|
|
|
168
|
-
<div id="method-
|
|
169
|
-
<a name="
|
|
168
|
+
<div id="method-M000047" class="method-detail">
|
|
169
|
+
<a name="M000047"></a>
|
|
170
170
|
|
|
171
171
|
<div class="method-heading">
|
|
172
|
-
<a href="Environment.src/
|
|
173
|
-
onclick="popupCode('Environment.src/
|
|
172
|
+
<a href="Environment.src/M000047.html" target="Code" class="method-signature"
|
|
173
|
+
onclick="popupCode('Environment.src/M000047.html');return false;">
|
|
174
174
|
<span class="method-name">interact</span><span class="method-args">()</span>
|
|
175
175
|
</a>
|
|
176
176
|
</div>
|
|
@@ -178,7 +178,7 @@ the <a href="Environment.html">Environment</a>.
|
|
|
178
178
|
<div class="method-description">
|
|
179
179
|
<p>
|
|
180
180
|
Allow everything in the environment to <a
|
|
181
|
-
href="Environment.html#
|
|
181
|
+
href="Environment.html#M000047">interact</a> with each other. Objects are
|
|
182
182
|
first moved according to their preexisting vectors and the amount of time
|
|
183
183
|
since the last call. Then each <a
|
|
184
184
|
href="EnvironmentalFactor.html">EnvironmentalFactor</a> is allowed to act
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<body class="standalone-code">
|
|
13
13
|
<pre><span class="ruby-comment cmt"># File lib/zyps.rb, line 32</span>
|
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> (<span class="ruby-identifier">objects</span> = [], <span class="ruby-identifier">environmental_factors</span> = [])
|
|
15
|
-
<span class="ruby-
|
|
15
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">objects</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">environmental_factors</span> = <span class="ruby-identifier">objects</span>, <span class="ruby-identifier">environmental_factors</span>
|
|
16
16
|
<span class="ruby-ivar">@clock</span> = <span class="ruby-constant">Clock</span>.<span class="ruby-identifier">new</span>
|
|
17
17
|
<span class="ruby-keyword kw">end</span></pre>
|
|
18
18
|
</body>
|
|
File without changes
|
|
@@ -80,7 +80,8 @@
|
|
|
80
80
|
|
|
81
81
|
<div id="description">
|
|
82
82
|
<p>
|
|
83
|
-
Something in the environment that acts on creatures.
|
|
83
|
+
Something in the environment that acts on creatures. EnvironmentalFactors
|
|
84
|
+
must implement an act(target) instance method.
|
|
84
85
|
</p>
|
|
85
86
|
|
|
86
87
|
</div>
|
|
@@ -88,25 +89,11 @@ Something in the environment that acts on creatures.
|
|
|
88
89
|
|
|
89
90
|
</div>
|
|
90
91
|
|
|
91
|
-
<div id="method-list">
|
|
92
|
-
<h3 class="section-bar">Methods</h3>
|
|
93
|
-
|
|
94
|
-
<div class="name-list">
|
|
95
|
-
<a href="#M000021">new</a>
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
92
|
|
|
99
93
|
</div>
|
|
100
94
|
|
|
101
95
|
|
|
102
96
|
<!-- if includes -->
|
|
103
|
-
<div id="includes">
|
|
104
|
-
<h3 class="section-bar">Included Modules</h3>
|
|
105
|
-
|
|
106
|
-
<div id="includes-list">
|
|
107
|
-
<span class="include-name"><a href="Responsive.html">Responsive</a></span>
|
|
108
|
-
</div>
|
|
109
|
-
</div>
|
|
110
97
|
|
|
111
98
|
<div id="section">
|
|
112
99
|
|
|
@@ -114,46 +101,10 @@ Something in the environment that acts on creatures.
|
|
|
114
101
|
|
|
115
102
|
|
|
116
103
|
|
|
117
|
-
<div id="attribute-list">
|
|
118
|
-
<h3 class="section-bar">Attributes</h3>
|
|
119
|
-
|
|
120
|
-
<div class="name-list">
|
|
121
|
-
<table>
|
|
122
|
-
<tr class="top-aligned-row context-row">
|
|
123
|
-
<td class="context-item-name">behaviors</td>
|
|
124
|
-
<td class="context-item-value"> [RW] </td>
|
|
125
|
-
<td class="context-item-desc">
|
|
126
|
-
A list of <a href="Behavior.html">Behavior</a> objects, each called in the
|
|
127
|
-
same way as those of a <a href="Creature.html">Creature</a>.
|
|
128
|
-
|
|
129
|
-
</td>
|
|
130
|
-
</tr>
|
|
131
|
-
</table>
|
|
132
|
-
</div>
|
|
133
|
-
</div>
|
|
134
104
|
|
|
135
105
|
|
|
136
106
|
|
|
137
107
|
<!-- if method_list -->
|
|
138
|
-
<div id="methods">
|
|
139
|
-
<h3 class="section-bar">Public Class methods</h3>
|
|
140
|
-
|
|
141
|
-
<div id="method-M000021" class="method-detail">
|
|
142
|
-
<a name="M000021"></a>
|
|
143
|
-
|
|
144
|
-
<div class="method-heading">
|
|
145
|
-
<a href="EnvironmentalFactor.src/M000021.html" target="Code" class="method-signature"
|
|
146
|
-
onclick="popupCode('EnvironmentalFactor.src/M000021.html');return false;">
|
|
147
|
-
<span class="method-name">new</span><span class="method-args">(behaviors = [])</span>
|
|
148
|
-
</a>
|
|
149
|
-
</div>
|
|
150
|
-
|
|
151
|
-
<div class="method-description">
|
|
152
|
-
</div>
|
|
153
|
-
</div>
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
</div>
|
|
157
108
|
|
|
158
109
|
|
|
159
110
|
</div>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>Class: FaceAction</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
10
|
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
11
|
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
|
@@ -49,19 +49,27 @@
|
|
|
49
49
|
<div id="classHeader">
|
|
50
50
|
<table class="header-table">
|
|
51
51
|
<tr class="top-aligned-row">
|
|
52
|
-
<td><strong>
|
|
53
|
-
<td class="class-name-in-header">
|
|
52
|
+
<td><strong>Class</strong></td>
|
|
53
|
+
<td class="class-name-in-header">FaceAction</td>
|
|
54
54
|
</tr>
|
|
55
55
|
<tr class="top-aligned-row">
|
|
56
56
|
<td><strong>In:</strong></td>
|
|
57
57
|
<td>
|
|
58
|
-
<a href="../files/lib/
|
|
59
|
-
lib/zyps.rb
|
|
58
|
+
<a href="../files/lib/zyps/actions_rb.html">
|
|
59
|
+
lib/zyps/actions.rb
|
|
60
60
|
</a>
|
|
61
61
|
<br />
|
|
62
62
|
</td>
|
|
63
63
|
</tr>
|
|
64
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>
|
|
65
73
|
</table>
|
|
66
74
|
</div>
|
|
67
75
|
<!-- banner header -->
|
|
@@ -74,8 +82,7 @@
|
|
|
74
82
|
|
|
75
83
|
<div id="description">
|
|
76
84
|
<p>
|
|
77
|
-
|
|
78
|
-
href="Responsive.html#M000030">act</a> on other objects.
|
|
85
|
+
Head toward a target.
|
|
79
86
|
</p>
|
|
80
87
|
|
|
81
88
|
</div>
|
|
@@ -87,7 +94,7 @@ href="Responsive.html#M000030">act</a> on other objects.
|
|
|
87
94
|
<h3 class="section-bar">Methods</h3>
|
|
88
95
|
|
|
89
96
|
<div class="name-list">
|
|
90
|
-
<a href="#
|
|
97
|
+
<a href="#M000052">do</a>
|
|
91
98
|
</div>
|
|
92
99
|
</div>
|
|
93
100
|
|
|
@@ -109,21 +116,19 @@ href="Responsive.html#M000030">act</a> on other objects.
|
|
|
109
116
|
<div id="methods">
|
|
110
117
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
111
118
|
|
|
112
|
-
<div id="method-
|
|
113
|
-
<a name="
|
|
119
|
+
<div id="method-M000052" class="method-detail">
|
|
120
|
+
<a name="M000052"></a>
|
|
114
121
|
|
|
115
122
|
<div class="method-heading">
|
|
116
|
-
<a href="
|
|
117
|
-
onclick="popupCode('
|
|
118
|
-
<span class="method-name">
|
|
123
|
+
<a href="FaceAction.src/M000052.html" target="Code" class="method-signature"
|
|
124
|
+
onclick="popupCode('FaceAction.src/M000052.html');return false;">
|
|
125
|
+
<span class="method-name">do</span><span class="method-args">(actor, target)</span>
|
|
119
126
|
</a>
|
|
120
127
|
</div>
|
|
121
128
|
|
|
122
129
|
<div class="method-description">
|
|
123
130
|
<p>
|
|
124
|
-
|
|
125
|
-
object‘s assigned Behaviors, with the object and a target as
|
|
126
|
-
arguments.
|
|
131
|
+
Set the actor‘s heading to point directly at target.
|
|
127
132
|
</p>
|
|
128
133
|
</div>
|
|
129
134
|
</div>
|