My first game

Post screenshots, binaries and projectfiles of the projects you have made with ZGE that you want to share!

Moderator: Moderators

Post Reply
Csabalia
Posts: 6
Joined: Sun Jun 15, 2014 3:30 pm

My first game

Post by Csabalia »

Hi this is my fisrt game, its alfa version :D What do you think ?
Attachments
youareacube0.8.rar
AD SPACE -moving
X -restart if you die
F- shield, if you pick
(277.65 KiB) Downloaded 941 times
User avatar
Kjell
Posts: 1911
Joined: Sat Feb 23, 2008 11:15 pm

Post 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
User avatar
jonaspm
Posts: 89
Joined: Fri Jul 06, 2012 3:51 pm
Contact:

Post by jonaspm »

nice game! :)
Csabalia
Posts: 6
Joined: Sun Jun 15, 2014 3:30 pm

Post 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
User avatar
Kjell
Posts: 1911
Joined: Sat Feb 23, 2008 11:15 pm

Post 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
Imerion
Posts: 200
Joined: Sun Feb 09, 2014 4:42 pm

Post by Imerion »

Oh, this was really nice! Especially for your first try! Makes me want to try creating a platformer too. :)
Post Reply