Recent

Author Topic: Simple platform test  (Read 2310 times)

Zaxxon

  • New Member
  • *
  • Posts: 30
Simple platform test
« on: February 05, 2022, 12:36:58 pm »
I've made this some years ago and a thought someone might find it useful.

You can adjust the jumping height with MaxJumpPress and the amount of times you can jump in mid air by changing MaxJumpInJump.
The jump height can also vary depending on how long you are pressing space.

Also you can test to set XYMovement to True. When XYMovement is set to true, you can also test to set BothXYMoving to false.

You can fire by pressing or holding '1' or '2'.

I'm using Linux Mint Mate edition, I haven't tested this in windows.

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: Simple platform test
« Reply #1 on: February 05, 2022, 01:49:53 pm »
Nice!
 ;D
Thank you for sharing it.

It can shoot, do double jumps and it works on Linux too. It uses TThread, not TTimer. The code is 677+285 lines of code.

Very good for learning how to create games. Someone please add the link on the wiki page:
https://wiki.freepascal.org/Portal:HowTo_Demos
« Last Edit: February 05, 2022, 02:07:19 pm by Handoko »

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: Simple platform test
« Reply #2 on: February 05, 2022, 06:44:56 pm »
Really cool.  Thanks for sharing.  :)
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

furious programming

  • Hero Member
  • *****
  • Posts: 836
Re: Simple platform test
« Reply #3 on: February 05, 2022, 10:52:40 pm »
Very good for learning how to create games.

In my opinion, this is the worst approach when it comes to learning to create games. These should not be created using visual components and the entire LCL ecosystem — you should use libraries and techniques designed specifically for games. It doesn't matter if it's a simple test or a whole little game. I made the same horrible mistake once and to create a Deep Platformer I used classes from LCL (but not components), instead of e.g. SDL library.

So if someone wants to touch game development or test some interesting algorithms, I recommend taking SDL and using it as a basis. This library is very easy to use, especially when it comes to basic things such as image rendering and sounds emitting. Not only will you have support of hardware acceleration, multi-channel sound mixer, joysticks on so on, but you will also be able to learn useful things, and such test applications will be a valuable knowledge base for future interested in the topic. SDL is a great library, but there is hardly any learning material for its use in Free Pascal, which is a shame.
Lazarus 3.2 with FPC 3.2.2, Windows 10 — all 64-bit

Working solo on an acrade, action/adventure game in retro style (pixelart), programming the engine and shell from scratch, using Free Pascal and SDL. Release planned in 2026.

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: Simple platform test
« Reply #4 on: February 11, 2022, 10:13:27 pm »
That's true.  Use SDL or Allegro ( 8)) is better.  But I find this interesting.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

 

TinyPortal © 2005-2018