Telepong in CGE

Hello, do you remember the old game telepong from atary?ç
images

I made a game in CGE like that. I’ts my first proyect using physics

/BlueIcaro

2 Likes

Tested, cool! Just like original Pong, it is incredibly hard :slight_smile:

Recommendations:

  • Show somewhere the keybindings (e.g. as a TCastleLabel at top-middle: “left player: Q/A, right player: up/down, restart by space”). I did have to look at source code to learn them :slight_smile:
  • The font that displays the score could be “more crisp”. To do this, use TCastleFont with larger OptimalSize. Or even activate distance field fonts.
  • You can use GitHub Actions to let GitHub automatically compile ready versions for Windows, Linux, macOS for you.

Hello Michalis, Thanks for the tips. I change the font, but I can not see many different.
Also I add some text with the keys for the player and a text, which says press space bar to start.
Also I fixed a bug, when a player scores the ball starts to the player which lost. May be is more correct, that the player which gets the goal is who make the next serve

Also I want to say, that after some time reading and making test with CGE, make this game with the physics engine is not so complicate.
I am in a hurry to continue learning about CGE
Thanks for the CGE.

Thanks for the good words about the engine! I’m happy it’s going nicely :slight_smile:

I looked at your project on GitHub (BTW thank you for making it public, this allowed me to quickly investigate! I). The issue occurred because you left the TCastleFont.Url empty – in such case, the TCastleFont instance doesn’t load any font, so it’s ignored, and the values of OptimalSize, DistanceField there don’t matter.

Solution:

Attaching the screenshot with important things outlined.

I see you added GitHub Actions – CastleEngineTelepong/.github/workflows/build.yml at main · Blueicaro/CastleEngineTelepong · GitHub . Cool. Let me know if you need any help setting them up – I highly recommend using them to have automatic builds of your projects!

Note that the workflow specified there uploads the “artifacts” (your game builds) to the “snapshot” release tag at the end. To make it work, you need to manually (one time) create the “snapshot” release. Just go to “Releases” of GitHub - Blueicaro/CastleEngineTelepong as the project admin, create a new release, as tag of it choose “snapshot” (the tag will be created upon publishing) and click “publish”. You will then see a new “snapshot” release with only the source code (zip) published. Then you can rerun the action workflow – and it should upload the builds to the release, adding there binaries for Windows, Linux etc.

See e.g. how “snapshot” release looks like in

cool, played it and won :slight_smile:
I miss something like randomness. The ball jumps allways in the same way/direction. If the player stands on the right position he has won (in my case).
In my next project I need also something with physics, thanks for the inspiration. :crazy_face:

Hello, I add some random in the rest.
May be can be more funny
/BlueIcaro

Hi Michalis, first apologies because I was overloaded with the work and I was AFK and I couldn’t test it

I got a error when I run the action. The MacOs give a error:

Error: Installation failed: Destination file path /Users/runner/work/_temp already exists
Error: Installation process failed: Destination file path /Users/runner/work/_temp already exists
Error: Destination file path /Users/runner/work/_temp already exist

I attach the log file.
logs_30757223540.zip (22.6 KB)

Thanks

There was a bug in the 3.3.0 version of the gcarreno/setup-lazarus action, which is part of the GitHub Actions setup we recommend GitHub Actions | Manual | Castle Game Engine .

I submitted it (see Version 3.3.0 fails with "Error: Installation failed: Destination file path /home/runner/work/_temp already exists and" (at least Linux, macOS) · Issue #31 · gcarreno/setup-lazarus · GitHub ) and it’s already fixed. Sorry, I guess you must have used my castle-game/blob/master/.github/workflows/build.yml as a template during the 6 days when it was broken (while I did some tests on engine branch, but for castle-game I used the master branch).

Short version: Just change the line

uses: gcarreno/[email protected]

into

uses: gcarreno/[email protected]

here: CastleEngineTelepong/.github/workflows/build.yml at main · Blueicaro/CastleEngineTelepong · GitHub

and the issue will be gone :slight_smile:

Bonus option: I also recommend you copy the file .github/dependabot.yml into your project. Then every week GitHub will automatically check are there updated versions of your action components, and create a pull request proposing to upgrade them (if they pass automatic tests of course).