Code: Select all
<?xml version="1.0" encoding="iso-8859-1" ?>
<ZApplication Name="App" Caption="ZGameEditor application" ClearColor="0.502 0.502 1 1" ScreenMode="0" Camera="cam_Front" ViewportRatio="3" FileVersion="2">
<OnLoaded>
<SpawnModel Model="m_Dropper" Position="-21 0 0" UseSpawnerPosition="255"/>
</OnLoaded>
<OnRender>
<UseMaterial Material="mat_Wireframe"/>
<RenderNet XCount="20" YCount="11">
<RenderVertexExpression>
<![CDATA[//Update each vertex.
//Vertex : current vertex
//TexCoord : current texture coordinate
//Color : current vertex color
Vertex.X *= (this.XCount+1)*2;
Vertex.Y *= (this.YCount+1)*2;]]>
</RenderVertexExpression>
</RenderNet>
</OnRender>
<Content>
<Camera Name="cam_Front" Kind="1" Position="0 0 10" OrthoZoom="12"/>
<Material Name="mat_Color" Shading="1" Light="0"/>
<Material Name="mat_Wireframe" Shading="2" Light="0"/>
<Mesh Name="mesh_Rectangle">
<Producers>
<MeshBox Grid2DOnly="255"/>
</Producers>
</Mesh>
<Model Name="m_Dropper" Velocity="4 0 0">
<Definitions>
<Variable Name="DropPoint" Type="1"/>
</Definitions>
<OnSpawn>
<ZExpression Expression="DropPoint = CurrentModel.Position.X+1;"/>
</OnSpawn>
<OnUpdate>
<Condition Comment="Drop?">
<Expression>
<![CDATA[return
(
CurrentModel.Position.X > DropPoint
);]]>
</Expression>
<OnTrue>
<ZExpression>
<Expression>
<![CDATA[m_Droplet.Position.X = DropPoint;
m_Droplet.Position.Y = CurrentModel.Position.Y;
DropPoint += 2;]]>
</Expression>
</ZExpression>
<SpawnModel Model="m_Droplet"/>
</OnTrue>
</Condition>
<Condition Comment="Out of screen? (remove)">
<Expression>
<![CDATA[return (
CurrentModel.Position.X > 21
);]]>
</Expression>
<OnTrue>
<ZExpression>
<Expression>
<![CDATA[CurrentModel.Position.X = 0-21;
DropPoint = CurrentModel.Position.X + 2;]]>
</Expression>
</ZExpression>
<RemoveModel/>
</OnTrue>
</Condition>
</OnUpdate>
<OnRender>
<UseMaterial Material="mat_Color"/>
<RenderSetColor Color="1 0 1 1"/>
<RenderMesh Mesh="mesh_Rectangle"/>
</OnRender>
</Model>
<Model Name="m_Droplet" Position="12 0 0">
<OnRender>
<UseMaterial Material="mat_Wireframe"/>
<RenderSetColor Color="1 0 0.502 1"/>
<RenderMesh Mesh="mesh_Rectangle"/>
</OnRender>
</Model>
</Content>
</ZApplication>