Page 1 of 1

My first game

Posted: Wed Jun 25, 2014 11:31 pm
by Csabalia
Hi this is my fisrt game, its alfa version :D What do you think ?

Posted: Thu Jun 26, 2014 11:26 am
by Kjell
Hi Csabalia,

Nice job! Good to see a project with designed ( instead of procedurally generated ) levels for a change :)

One major issue though. Apparently you've coded the game expecting a constant framerate of 60, but are actually using SyncedWithMonitor as App.FrameRateStyle. Since my monitor refresh rate is ( usually ) set much higher than 60, this made it impossible for me to jump onto the first floating platform. So i had to change the refresh rate of my monitor to 60 in order to play your game.

There are two ways to fix this. Either change App.FrameRateStyle into Fixed and set App.FixedFrameRate to 60, or incorporate App.DeltaTime into your calculations. For instance, i suspect you're using something as follows for gravity ..

Code: Select all

CurrentModel.Velocity.Y -= 1;
But if you want to write a framerate independent game you need to use the following instead ..

Code: Select all

CurrentModel.Velocity.Y -= 60*App.DeltaTime;
Let us know when you need any help ;)

K

Posted: Fri Jun 27, 2014 7:48 pm
by jonaspm
nice game! :)

Posted: Mon Jun 30, 2014 7:15 am
by Csabalia
Thx, i fixed the framerate problem,

I need one more help, delphi has OnKeyUp event, i want to implement this function on my app, so when i realese one key, the app will do one think, how can i do it ?

And sory for my english :D

Posted: Mon Jun 30, 2014 11:07 am
by Kjell
Hi Csabalia,
Csabalia wrote:I need one more help, delphi has OnKeyUp event, i want to implement this function on my app, so when i realese one key, the app will do one think, how can i do it?
Not sure why this still isn't build-in, but it isn't unfortunately .. so you have to detect when a key has been released yourself. Here's a simple example of how to do this for a single key ( S in this case ).

Code: Select all

<?xml version="1.0" encoding="iso-8859-1" ?>
<ZApplication Name="App" Caption="ZGameEditor application">
  <OnUpdate>
    <ZExpression>
      <Expression>
<![CDATA[Key[1] = Key[0]; // Cache current value
Key[0] = 0;      // Reset current value]]>
      </Expression>
    </ZExpression>
    <KeyPress Keys="S">
      <OnPressed>
        <ZExpression Expression="Key[0] = 1;"/>
      </OnPressed>
    </KeyPress>
    <ZExpression Expression="Key[2] = Key[1] && !Key[0]; // Determine if key has been released"/>
  </OnUpdate>
  <OnRender>
    <Condition Expression="return Key[2];">
      <OnTrue>
        <RenderSprite/>
      </OnTrue>
    </Condition>
  </OnRender>
  <Content>
    <Array Name="Key" Type="4" SizeDim1="3"/>
  </Content>
</ZApplication>
Csabalia wrote:And sory for my english :D
No worries, your English is fine 8)

K

Posted: Fri Jul 11, 2014 10:27 am
by Imerion
Oh, this was really nice! Especially for your first try! Makes me want to try creating a platformer too. :)