Update to entity data files in preparation for orders sytem

This was SVN commit r784.
This commit is contained in:
MarkT 2004-07-20 19:31:30 +00:00
parent 194fdf9b4b
commit 939bdae5cb
5 changed files with 50 additions and 36 deletions

View File

@ -1,5 +1,5 @@
novbo=true
shadows=false
shadows=true
vsync=false
; You can specify these as well, but the default (keeping the current resolution) is

View File

@ -5,7 +5,6 @@
<Actor>Deciduous 1</Actor>
<Speed>0</Speed>
<Size Radius="1.0"/>
<BoundsOffset x="0.25" y="-1.0" />
<EventHandlers>
<Initialize>scripts/pasap/initdude</Initialize>
<Update>scripts/pasap/tick</Update>

View File

@ -4,6 +4,6 @@
<Name>Deciduous Tree 2</Name>
<Actor>Deciduous 2</Actor>
<Speed>0</Speed>
<BoundsOffset x="0.0" y="-6.25" />
<Size Radius="1.5"/>
<BoundsOffset x="0.0" y="-15.25" />
</Entity>

View File

@ -8,4 +8,6 @@
<Speed>2.5</Speed>
<TurningRadius>2.0</TurningRadius>
<Size Radius="0.5" />
<Ability>GOTO</Ability>
<Ability>PATROL</Ability>
</Entity>

View File

@ -13,6 +13,47 @@
writeConsole("Dude created at " + DudeSpawnPoint);
}
function updateOrbital()
{
if( !getGUIObjectByName( 'arena' ).hidden )
{
writeConsole( "Updating..." );
g_ballx += g_balldx;
g_bally += g_balldy;
if (g_ballx > 600) {
g_balldx *= -0.9;
g_ballx = 600-(g_ballx-600);
}
else if (g_ballx < 0) {
g_balldx *= -0.9;
g_ballx = -g_ballx;
}
if (g_bally > 400) {
g_balldy *= -0.9;
g_bally = 400-(g_bally-400);
}
else if (g_bally < 0) {
g_balldy *= -0.9;
g_bally = -g_bally;
}
// Gravitate towards the mouse
var vect_x = g_ballx-g_mousex;
var vect_y = g_bally-g_mousey;
var dsquared = vect_x*vect_x + vect_y*vect_y;
if (dsquared < 1000) dsquared = 1000;
var force = 10000.0 / dsquared;
var mag = Math.sqrt(dsquared);
vect_x /= mag; vect_y /= mag;
g_balldx -= force * vect_x;
g_balldy -= force * vect_y;
var ball = getGUIObjectByName('ball');
var r=5;
ball.size = new GUISize(g_ballx-r, g_bally-r, g_ballx+r, g_bally+r);
}
}
writeConsole("Made MakeDude " + MakeDude);
]]></script>
@ -62,42 +103,14 @@ Nunc bibendum metus a tellus. Nulla lorem metus, convallis id, lobortis eu, elem
g_bally = 200;
g_balldx = 0;
g_balldy = 0;
g_mousex = 0;
g_mousey = 0;
setInterval( updateOrbital, 100 );
]]></action>
<action on="MouseOver"><![CDATA[
g_ballx += g_balldx;
g_bally += g_balldy;
if (g_ballx > 600) {
g_balldx *= -0.9;
g_ballx = 600-(g_ballx-600);
}
else if (g_ballx < 0) {
g_balldx *= -0.9;
g_ballx = -g_ballx;
}
if (g_bally > 400) {
g_balldy *= -0.9;
g_bally = 400-(g_bally-400);
}
else if (g_bally < 0) {
g_balldy *= -0.9;
g_bally = -g_bally;
}
// Gravitate towards the mouse
var vect_x = g_ballx-mouse.x;
var vect_y = g_bally-mouse.y;
var dsquared = vect_x*vect_x + vect_y*vect_y;
if (dsquared < 1000) dsquared = 1000;
var force = 10000.0 / dsquared;
var mag = Math.sqrt(dsquared);
vect_x /= mag; vect_y /= mag;
g_balldx -= force * vect_x;
g_balldy -= force * vect_y;
var ball = getGUIObjectByName('ball');
var r=5;
ball.size = new GUISize(g_ballx-r, g_bally-r, g_ballx+r, g_bally+r);
g_mousex = mouse.x;
g_mousey = mouse.y;
]]></action>
</object>