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,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 (FaceAction)</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 24</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">actor</span>.<span class="ruby-identifier">vector</span>.<span class="ruby-identifier">pitch</span> = <span class="ruby-constant">Utility</span>.<span class="ruby-identifier">find_angle</span>(<span class="ruby-identifier">actor</span>.<span class="ruby-identifier">location</span>, <span class="ruby-identifier">target</span>.<span class="ruby-identifier">location</span>)
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,189 @@
|
|
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: FleeAction</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">FleeAction</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
|
+
Flees from the target, but obeys law of inertia.
|
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="#M000055">do</a>
|
98
|
+
<a href="#M000054">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">heading</td>
|
120
|
+
<td class="context-item-value"> [RW] </td>
|
121
|
+
<td class="context-item-desc">
|
122
|
+
Direction/speed actor is accelerating in.
|
123
|
+
|
124
|
+
</td>
|
125
|
+
</tr>
|
126
|
+
<tr class="top-aligned-row context-row">
|
127
|
+
<td class="context-item-name">turn_rate</td>
|
128
|
+
<td class="context-item-value"> [RW] </td>
|
129
|
+
<td class="context-item-desc">
|
130
|
+
Degrees per second the direction of acceleration can change.
|
131
|
+
|
132
|
+
</td>
|
133
|
+
</tr>
|
134
|
+
</table>
|
135
|
+
</div>
|
136
|
+
</div>
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
<!-- if method_list -->
|
141
|
+
<div id="methods">
|
142
|
+
<h3 class="section-bar">Public Class methods</h3>
|
143
|
+
|
144
|
+
<div id="method-M000054" class="method-detail">
|
145
|
+
<a name="M000054"></a>
|
146
|
+
|
147
|
+
<div class="method-heading">
|
148
|
+
<a href="FleeAction.src/M000054.html" target="Code" class="method-signature"
|
149
|
+
onclick="popupCode('FleeAction.src/M000054.html');return false;">
|
150
|
+
<span class="method-name">new</span><span class="method-args">(heading = Vector.new, turn_rate = 360)</span>
|
151
|
+
</a>
|
152
|
+
</div>
|
153
|
+
|
154
|
+
<div class="method-description">
|
155
|
+
</div>
|
156
|
+
</div>
|
157
|
+
|
158
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
159
|
+
|
160
|
+
<div id="method-M000055" class="method-detail">
|
161
|
+
<a name="M000055"></a>
|
162
|
+
|
163
|
+
<div class="method-heading">
|
164
|
+
<a href="FleeAction.src/M000055.html" target="Code" class="method-signature"
|
165
|
+
onclick="popupCode('FleeAction.src/M000055.html');return false;">
|
166
|
+
<span class="method-name">do</span><span class="method-args">(actor, target)</span>
|
167
|
+
</a>
|
168
|
+
</div>
|
169
|
+
|
170
|
+
<div class="method-description">
|
171
|
+
<p>
|
172
|
+
Accelerate away from the target, but limited by turn rate.
|
173
|
+
</p>
|
174
|
+
</div>
|
175
|
+
</div>
|
176
|
+
|
177
|
+
|
178
|
+
</div>
|
179
|
+
|
180
|
+
|
181
|
+
</div>
|
182
|
+
|
183
|
+
|
184
|
+
<div id="validator-badges">
|
185
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
186
|
+
</div>
|
187
|
+
|
188
|
+
</body>
|
189
|
+
</html>
|
@@ -0,0 +1,19 @@
|
|
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 (FleeAction)</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 104</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">heading</span> = <span class="ruby-constant">Vector</span>.<span class="ruby-identifier">new</span>, <span class="ruby-identifier">turn_rate</span> = <span class="ruby-value">360</span>)
|
15
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">heading</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">turn_rate</span> = <span class="ruby-identifier">heading</span>, <span class="ruby-identifier">turn_rate</span>
|
16
|
+
<span class="ruby-ivar">@clock</span> = <span class="ruby-constant">Clock</span>.<span class="ruby-identifier">new</span>
|
17
|
+
<span class="ruby-keyword kw">end</span></pre>
|
18
|
+
</body>
|
19
|
+
</html>
|
@@ -0,0 +1,38 @@
|
|
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 (FleeAction)</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 109</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">#Find the difference between the current heading and the angle to the target.</span>
|
16
|
+
<span class="ruby-identifier">turn_angle</span> = <span class="ruby-constant">Utility</span>.<span class="ruby-identifier">find_angle</span>(<span class="ruby-identifier">actor</span>.<span class="ruby-identifier">location</span>, <span class="ruby-identifier">target</span>.<span class="ruby-identifier">location</span>) <span class="ruby-operator">-</span> <span class="ruby-ivar">@heading</span>.<span class="ruby-identifier">pitch</span> <span class="ruby-operator">+</span> <span class="ruby-value">180</span>
|
17
|
+
<span class="ruby-comment cmt">#If the angle is the long way around from the current heading, change it to the smaller angle.</span>
|
18
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">turn_angle</span> <span class="ruby-operator">></span> <span class="ruby-value">180</span> <span class="ruby-keyword kw">then</span>
|
19
|
+
<span class="ruby-identifier">turn_angle</span> <span class="ruby-operator">-=</span> <span class="ruby-value">360.0</span>
|
20
|
+
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">turn_angle</span> <span class="ruby-operator"><</span> <span class="ruby-value">-180</span> <span class="ruby-keyword kw">then</span>
|
21
|
+
<span class="ruby-identifier">turn_angle</span> <span class="ruby-operator">+=</span> <span class="ruby-value">360.0</span>
|
22
|
+
<span class="ruby-keyword kw">end</span>
|
23
|
+
<span class="ruby-comment cmt">#The creature can only turn as fast as the elapsed time, of course.</span>
|
24
|
+
<span class="ruby-identifier">maximum_turn</span> = <span class="ruby-identifier">turn_rate</span> <span class="ruby-operator">*</span> <span class="ruby-ivar">@clock</span>.<span class="ruby-identifier">elapsed_time</span>
|
25
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">turn_angle</span>.<span class="ruby-identifier">abs</span> <span class="ruby-operator">></span> <span class="ruby-identifier">maximum_turn</span>
|
26
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">turn_angle</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
27
|
+
<span class="ruby-identifier">turn_angle</span> = <span class="ruby-identifier">maximum_turn</span>
|
28
|
+
<span class="ruby-keyword kw">else</span>
|
29
|
+
<span class="ruby-identifier">turn_angle</span> = <span class="ruby-identifier">maximum_turn</span> <span class="ruby-operator">*</span> <span class="ruby-value">-1</span>
|
30
|
+
<span class="ruby-keyword kw">end</span>
|
31
|
+
<span class="ruby-keyword kw">end</span>
|
32
|
+
<span class="ruby-comment cmt">#Turn the appropriate amount.</span>
|
33
|
+
<span class="ruby-ivar">@heading</span>.<span class="ruby-identifier">pitch</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">turn_angle</span>
|
34
|
+
<span class="ruby-comment cmt">#Apply the heading to the creature's movement vector.</span>
|
35
|
+
<span class="ruby-identifier">actor</span>.<span class="ruby-identifier">vector</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@heading</span>
|
36
|
+
<span class="ruby-keyword kw">end</span></pre>
|
37
|
+
</body>
|
38
|
+
</html>
|
data/doc/classes/GameObject.html
CHANGED
@@ -92,10 +92,11 @@ An object in the virtual environment.
|
|
92
92
|
<h3 class="section-bar">Methods</h3>
|
93
93
|
|
94
94
|
<div class="name-list">
|
95
|
-
<a href="#
|
96
|
-
<a href="#
|
97
|
-
<a href="#
|
98
|
-
<a href="#
|
95
|
+
<a href="#M000035">age</a>
|
96
|
+
<a href="#M000036">age=</a>
|
97
|
+
<a href="#M000034">move</a>
|
98
|
+
<a href="#M000032">new</a>
|
99
|
+
<a href="#M000033">size=</a>
|
99
100
|
</div>
|
100
101
|
</div>
|
101
102
|
|
@@ -145,6 +146,14 @@ The object‘s <a href="Location.html">Location</a> in space.
|
|
145
146
|
<td class="context-item-desc">
|
146
147
|
A String with the object‘s name.
|
147
148
|
|
149
|
+
</td>
|
150
|
+
</tr>
|
151
|
+
<tr class="top-aligned-row context-row">
|
152
|
+
<td class="context-item-name">size</td>
|
153
|
+
<td class="context-item-value"> [RW] </td>
|
154
|
+
<td class="context-item-desc">
|
155
|
+
Radius of the object.
|
156
|
+
|
148
157
|
</td>
|
149
158
|
</tr>
|
150
159
|
<tr class="top-aligned-row context-row">
|
@@ -177,13 +186,13 @@ and direction of travel.
|
|
177
186
|
<div id="methods">
|
178
187
|
<h3 class="section-bar">Public Class methods</h3>
|
179
188
|
|
180
|
-
<div id="method-
|
181
|
-
<a name="
|
189
|
+
<div id="method-M000032" class="method-detail">
|
190
|
+
<a name="M000032"></a>
|
182
191
|
|
183
192
|
<div class="method-heading">
|
184
|
-
<a href="GameObject.src/
|
185
|
-
onclick="popupCode('GameObject.src/
|
186
|
-
<span class="method-name">new</span><span class="method-args">(name = nil, location = Location.new, color = Color.new, vector = Vector.new, age = 0, tags = [])</span>
|
193
|
+
<a href="GameObject.src/M000032.html" target="Code" class="method-signature"
|
194
|
+
onclick="popupCode('GameObject.src/M000032.html');return false;">
|
195
|
+
<span class="method-name">new</span><span class="method-args">(name = nil, location = Location.new, color = Color.new, vector = Vector.new, age = 0, size = 1, tags = [])</span>
|
187
196
|
</a>
|
188
197
|
</div>
|
189
198
|
|
@@ -193,12 +202,12 @@ and direction of travel.
|
|
193
202
|
|
194
203
|
<h3 class="section-bar">Public Instance methods</h3>
|
195
204
|
|
196
|
-
<div id="method-
|
197
|
-
<a name="
|
205
|
+
<div id="method-M000035" class="method-detail">
|
206
|
+
<a name="M000035"></a>
|
198
207
|
|
199
208
|
<div class="method-heading">
|
200
|
-
<a href="GameObject.src/
|
201
|
-
onclick="popupCode('GameObject.src/
|
209
|
+
<a href="GameObject.src/M000035.html" target="Code" class="method-signature"
|
210
|
+
onclick="popupCode('GameObject.src/M000035.html');return false;">
|
202
211
|
<span class="method-name">age</span><span class="method-args">()</span>
|
203
212
|
</a>
|
204
213
|
</div>
|
@@ -210,12 +219,12 @@ Time since the object was created, in seconds.
|
|
210
219
|
</div>
|
211
220
|
</div>
|
212
221
|
|
213
|
-
<div id="method-
|
214
|
-
<a name="
|
222
|
+
<div id="method-M000036" class="method-detail">
|
223
|
+
<a name="M000036"></a>
|
215
224
|
|
216
225
|
<div class="method-heading">
|
217
|
-
<a href="GameObject.src/
|
218
|
-
onclick="popupCode('GameObject.src/
|
226
|
+
<a href="GameObject.src/M000036.html" target="Code" class="method-signature"
|
227
|
+
onclick="popupCode('GameObject.src/M000036.html');return false;">
|
219
228
|
<span class="method-name">age=</span><span class="method-args">(age)</span>
|
220
229
|
</a>
|
221
230
|
</div>
|
@@ -224,12 +233,12 @@ Time since the object was created, in seconds.
|
|
224
233
|
</div>
|
225
234
|
</div>
|
226
235
|
|
227
|
-
<div id="method-
|
228
|
-
<a name="
|
236
|
+
<div id="method-M000034" class="method-detail">
|
237
|
+
<a name="M000034"></a>
|
229
238
|
|
230
239
|
<div class="method-heading">
|
231
|
-
<a href="GameObject.src/
|
232
|
-
onclick="popupCode('GameObject.src/
|
240
|
+
<a href="GameObject.src/M000034.html" target="Code" class="method-signature"
|
241
|
+
onclick="popupCode('GameObject.src/M000034.html');return false;">
|
233
242
|
<span class="method-name">move</span><span class="method-args">(elapsed_time)</span>
|
234
243
|
</a>
|
235
244
|
</div>
|
@@ -241,6 +250,23 @@ Move according to vector over the given number of seconds.
|
|
241
250
|
</div>
|
242
251
|
</div>
|
243
252
|
|
253
|
+
<div id="method-M000033" class="method-detail">
|
254
|
+
<a name="M000033"></a>
|
255
|
+
|
256
|
+
<div class="method-heading">
|
257
|
+
<a href="GameObject.src/M000033.html" target="Code" class="method-signature"
|
258
|
+
onclick="popupCode('GameObject.src/M000033.html');return false;">
|
259
|
+
<span class="method-name">size=</span><span class="method-args">(v)</span>
|
260
|
+
</a>
|
261
|
+
</div>
|
262
|
+
|
263
|
+
<div class="method-description">
|
264
|
+
<p>
|
265
|
+
Size must be positive.
|
266
|
+
</p>
|
267
|
+
</div>
|
268
|
+
</div>
|
269
|
+
|
244
270
|
|
245
271
|
</div>
|
246
272
|
|
@@ -10,11 +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.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> (<span class="ruby-identifier">name</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">location</span> = <span class="ruby-constant">Location</span>.<span class="ruby-identifier">new</span>, <span class="ruby-identifier">color</span> = <span class="ruby-constant">Color</span>.<span class="ruby-identifier">new</span>, <span class="ruby-identifier">vector</span> = <span class="ruby-constant">Vector</span>.<span class="ruby-identifier">new</span>, <span class="ruby-identifier">age</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">tags</span> = [])
|
15
|
-
<span class="ruby-
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/zyps.rb, line 95</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> (<span class="ruby-identifier">name</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">location</span> = <span class="ruby-constant">Location</span>.<span class="ruby-identifier">new</span>, <span class="ruby-identifier">color</span> = <span class="ruby-constant">Color</span>.<span class="ruby-identifier">new</span>, <span class="ruby-identifier">vector</span> = <span class="ruby-constant">Vector</span>.<span class="ruby-identifier">new</span>, <span class="ruby-identifier">age</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">size</span> = <span class="ruby-value">1</span>, <span class="ruby-identifier">tags</span> = [])
|
15
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">location</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">color</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">vector</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">age</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">size</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">tags</span> = <span class="ruby-identifier">name</span>, <span class="ruby-identifier">location</span>, <span class="ruby-identifier">color</span>, <span class="ruby-identifier">vector</span>, <span class="ruby-identifier">age</span>, <span class="ruby-identifier">size</span>, <span class="ruby-identifier">tags</span>
|
16
16
|
<span class="ruby-ivar">@identifier</span> = <span class="ruby-identifier">rand</span>(<span class="ruby-value">99999999</span>) <span class="ruby-comment cmt">#TODO: Current setup won't necessarily be unique.</span>
|
17
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">age</span> = <span class="ruby-identifier">age</span>
|
18
17
|
<span class="ruby-keyword kw">end</span></pre>
|
19
18
|
</body>
|
20
19
|
</html>
|
@@ -0,0 +1,16 @@
|
|
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>size= (GameObject)</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.rb, line 101</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">size=</span>(<span class="ruby-identifier">v</span>); <span class="ruby-identifier">v</span> = <span class="ruby-value">0</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span>; <span class="ruby-ivar">@size</span> = <span class="ruby-identifier">v</span>; <span class="ruby-keyword kw">end</span></pre>
|
15
|
+
</body>
|
16
|
+
</html>
|
@@ -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.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/zyps.rb, line 104</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">move</span> (<span class="ruby-identifier">elapsed_time</span>)
|
15
15
|
<span class="ruby-ivar">@location</span>.<span class="ruby-identifier">x</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@vector</span>.<span class="ruby-identifier">x</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">elapsed_time</span>
|
16
16
|
<span class="ruby-ivar">@location</span>.<span class="ruby-identifier">y</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@vector</span>.<span class="ruby-identifier">y</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">elapsed_time</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.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/zyps.rb, line 110</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">age</span>; <span class="ruby-constant">Time</span>.<span class="ruby-identifier">new</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@birth_time</span>; <span class="ruby-keyword kw">end</span></pre>
|
15
15
|
</body>
|
16
16
|
</html>
|
@@ -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.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/zyps.rb, line 111</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">age=</span>(<span class="ruby-identifier">age</span>); <span class="ruby-ivar">@birth_time</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">new</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">age</span>; <span class="ruby-keyword kw">end</span></pre>
|
15
15
|
</body>
|
16
16
|
</html>
|