"ZPong.zge" example needs fixing
Posted: Mon May 04, 2015 5:27 am
Here's what I noticed happens in the current build with one of the examples that comes bundled with ZGE...
As soon as the game is run, it starts to beep constantly.
Another thing is... it seems the MouseModelController component has a lag? You can see it in this example, the pink model is calculating its position by reading Mouse x and y directly and it works great, the other uses the MouseModelController and has a "touchscreen style" floaty / laggy / imprecise movement.
As soon as the game is run, it starts to beep constantly.
Another thing is... it seems the MouseModelController component has a lag? You can see it in this example, the pink model is calculating its position by reading Mouse x and y directly and it works great, the other uses the MouseModelController and has a "touchscreen style" floaty / laggy / imprecise movement.
Code: Select all
<?xml version="1.0" encoding="iso-8859-1" ?>
<ZApplication Name="App" Caption="ZGameEditor application" FrameRateStyle="2" FixedFrameRate="60" Camera="ProjectionFrontal" NoSound="1">
<OnLoaded>
<SpawnModel Model="Model1"/>
<SpawnModel Model="Model2"/>
</OnLoaded>
<Content>
<Material Name="ColorMono"/>
<Model Name="Model1" Comment="Gets the coordinates by calculating them manually" Scale="0.5 0.5 1">
<OnUpdate>
<ZExpression>
<Expression>
<![CDATA[CurrentModel.Position.X = App.MousePosition.X*App.ViewportWidth/App.ViewportHeight;
CurrentModel.Position.Y = App.MousePosition.Y;]]>
</Expression>
</ZExpression>
</OnUpdate>
<OnRender>
<UseMaterial Material="ColorMono"/>
<RenderSetColor Color="1 0 0.502 1"/>
<RenderSprite/>
</OnRender>
</Model>
<Model Name="Model2" Scale="0.5 0.5 1">
<OnSpawn>
<ZExpression Expression="Mover.ScaleX = 1f*App.ViewportWidth/App.ViewportHeight;"/>
</OnSpawn>
<OnUpdate>
<MouseModelController Name="Mover" ScaleX="1" ScaleY="1"/>
</OnUpdate>
<OnRender>
<UseMaterial Material="ColorMono"/>
<RenderSetColor Color="0.502 0.502 1 1"/>
<RenderSprite/>
</OnRender>
</Model>
<Camera Name="ProjectionFrontal" Comment="No rotation, for interface etc" Kind="1" Position="0 0 10"/>
</Content>
</ZApplication>