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 » Wed Jun 25, 2014 11:31 pm

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 332 times

User avatar
Kjell
Posts: 1726
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell » Thu Jun 26, 2014 11:26 am

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 » Fri Jun 27, 2014 7:48 pm

nice game! :)

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

Post by Csabalia » Mon Jun 30, 2014 7:15 am

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: 1726
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell » Mon Jun 30, 2014 11:07 am

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: 198
Joined: Sun Feb 09, 2014 4:42 pm

Post by Imerion » Fri Jul 11, 2014 10:27 am

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

Post Reply