Forum > Games

Simple platform test


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.

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:

Really cool.  Thanks for sharing.  :)

furious programming:

--- Quote from: Handoko on February 05, 2022, 01:49:53 pm ---Very good for learning how to create games.
--- End quote ---

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.

That's true.  Use SDL or Allegro ( 8)) is better.  But I find this interesting.


[0] Message Index

Go to full version