Recent

Author Topic: Snake game for the ptcGraph unit  (Read 3343 times)

Roland57

  • Full Member
  • ***
  • Posts: 187
Snake game for the ptcGraph unit
« on: April 25, 2021, 09:11:43 pm »
Hello!

Here is a little snake game that I made using the ptcGraph unit.

https://gitlab.com/rchastain/snake-ptcgraph

The more I use the ptcGraph unit, the more I like it! Thanks and congratulations to the author.

And thanks to Eugene Loza for his sprite sheet.

Regards.

Roland

« Last Edit: April 25, 2021, 09:22:27 pm by Roland57 »

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1502
  • Former Delphi 1-7, 10.2 user
Re: Snake game for the ptcGraph unit
« Reply #1 on: April 26, 2021, 01:14:16 am »
Nice!

You might like to add your game to the Wiki's Projects using Free Pascal games category.
Lazarus 2.1 r65061 FPC 3.3.1 r49223 macOS 10.14.6 Xcode 11.3.1
Lazarus 2.3 r65500 FPC 3.3.1 r49634 macOS 11.5 aarch64 Xcode 12.5.1
Lazarus 2.1 r61574 FPC 3.3.1 r42318 FreeBSD 12.1 amd64 VMware VM
Lazarus 2.1 r61574 FPC 3.0.4 Ubuntu 20.04 Parallels VM
Lazarus 2.0.10 FPC 3.2.0 Win10 Parallels VM

Roland57

  • Full Member
  • ***
  • Posts: 187
Re: Snake game for the ptcGraph unit
« Reply #2 on: April 26, 2021, 05:08:37 am »

Seenkao

  • Full Member
  • ***
  • Posts: 171
Re: Snake game for the ptcGraph unit
« Reply #3 on: April 26, 2021, 12:02:35 pm »
Приветствую. Всё довольно неплохо, но надо учитывать что не у всех установлен BASS (в комплекте нет). При попытке записать в таблицу рекордов, клавиатура почти не работает.

Так же было бы неплохо, чтоб ограничительный экран был виден. При движении влево-вправо не понятно, врежемся мы или нет.
И у меня змейка  выводится только квадратиками. )))

google translate: Greetings. Everything is pretty good, but it should be borne in mind that not everyone has BASS installed (not included). When trying to write to the high score table, the keyboard almost does not work.

It would also be nice to have the bounding screen visible. When moving left-right, it is not clear whether we will crash or not.
And my snake is displayed only in squares.  :)

Roland57

  • Full Member
  • ***
  • Posts: 187
Re: Snake game for the ptcGraph unit
« Reply #4 on: April 26, 2021, 12:28:03 pm »
Greetings. Everything is pretty good, but it should be borne in mind that not everyone has BASS installed (not included).
Thank you for your feedback. I will see what I can do for that.

When trying to write to the high score table, the keyboard almost does not work.
I don't know what to say. It works with me.  :-\

It would also be nice to have the bounding screen visible. When moving left-right, it is not clear whether we will crash or not.
Yes. I could draw a wall.

And my snake is displayed only in squares.  :)
Please compile with -dPICTURES.

« Last Edit: April 26, 2021, 12:34:15 pm by Roland57 »

Roland57

  • Full Member
  • ***
  • Posts: 187
Re: Snake game for the ptcGraph unit
« Reply #5 on: April 27, 2021, 06:18:23 pm »
It would also be nice to have the bounding screen visible. When moving left-right, it is not clear whether we will crash or not.
I finally decided to let the snake go through the walls (so to say). So from now you lose only when the snake hits its own body.

Everything is pretty good, but it should be borne in mind that not everyone has BASS installed (not included).
I included the BASS unit, and the binary for Linux 64. I included a note in the README with a link where the user can download the other versions of the library.

I also added a -dNoSound option, in case someone wishes to compile and play the game without installing the library.

When trying to write to the high score table, the keyboard almost does not work.
Still not solved, unfortunately, because I cannot reproduce it.  :(

The git repository has been updated.
« Last Edit: April 28, 2021, 08:53:25 am by Roland57 »

Roland57

  • Full Member
  • ***
  • Posts: 187
Re: Snake game for the ptcGraph unit
« Reply #6 on: April 29, 2021, 10:39:35 am »
  • Fixed a compilation error on Windows.
  • Created a Lazarus project.
  • Uploaded bass.dll to the repository.
Couldn't test sound on Windows, because there were no speakers on my PC.  :)
« Last Edit: April 29, 2021, 10:42:29 am by Roland57 »

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 588
  • Professional amateur ;-P
Re: Snake game for the ptcGraph unit
« Reply #7 on: April 29, 2021, 12:21:34 pm »
Hey Roland,

Couldn't test sound on Windows, because there were no speakers on my PC.  :)

Completely off topic, I know, but don't you have at least ONE set of cheap headphones? :P

Cheers,
Gus
Lazarus 2.3.0(trunk) FPC 3.3.1(trunk) Ubuntu 21.04 64b Dark Theme
Lazarus 2.0.12(stable) FPC 3.2.2(stable) Ubuntu 21.04 64b Dark Theme
http://github.com/gcarreno

Roland57

  • Full Member
  • ***
  • Posts: 187
Re: Snake game for the ptcGraph unit
« Reply #8 on: April 29, 2021, 01:19:43 pm »
Completely off topic, I know, but don't you have at least ONE set of cheap headphones? :P

Unfortunately, I don't. When there are children in a house, it is very difficult to find a pair of headphones when you need it.  :)

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 588
  • Professional amateur ;-P
Re: Snake game for the ptcGraph unit
« Reply #9 on: April 29, 2021, 01:27:37 pm »
Hey Roland,

Unfortunately, I don't. When there are children in a house, it is very difficult to find a pair of headphones when you need it.  :)

I can vouch for that and I sympathise!!! :D

Cheers,
Gus
Lazarus 2.3.0(trunk) FPC 3.3.1(trunk) Ubuntu 21.04 64b Dark Theme
Lazarus 2.0.12(stable) FPC 3.2.2(stable) Ubuntu 21.04 64b Dark Theme
http://github.com/gcarreno

Seenkao

  • Full Member
  • ***
  • Posts: 171
Re: Snake game for the ptcGraph unit
« Reply #10 on: April 29, 2021, 10:53:19 pm »
Still not solved, unfortunately, because I cannot reproduce it.  :(

The git repository has been updated.

Вполне возможно это был маленький глюк, по окончанию игры. Тестировал (если правильно помню) на Linux.

google translate: Quite possibly it was a small glitch at the end of the game. Tested (if I remember correctly) on Linux.

Roland57

  • Full Member
  • ***
  • Posts: 187
Re: Snake game for the ptcGraph unit
« Reply #11 on: May 01, 2021, 07:20:21 am »
Quite possibly it was a small glitch at the end of the game.

Thank you for your message.

I believe I see now what you mean. When you lose, if you don't release fast enough the arrow key that you were using for steering the snake, the program skips the high scores page and closes too quickly. I hope the problem is fixed now.

Seenkao

  • Full Member
  • ***
  • Posts: 171
Re: Snake game for the ptcGraph unit
« Reply #12 on: May 01, 2021, 02:07:16 pm »
Нет, вы меня не правильно поняли.

В конце игры, я пытался ввести "имя пользователя". Но клавиатура не реагировала. Реагировали только стрелки. При нажатии на стрелки появлялись символы.

Надеюсь понятно объяснил!? (и как раз вероятно, что был какой-то глюк, раз у меня так сработала игра).

google translate: No, you misunderstood me.

At the end of the game, I tried to enter a "username". But the keyboard didn't respond. Only the arrows reacted. When the arrows were pressed, symbols appeared.

I hope I explained it clearly !? (and it is likely that there was some kind of glitch, since the game worked like that for me).

Roland57

  • Full Member
  • ***
  • Posts: 187
Re: Snake game for the ptcGraph unit
« Reply #13 on: May 01, 2021, 07:18:53 pm »
No, you misunderstood me.

At the end of the game, I tried to enter a "username". But the keyboard didn't respond. Only the arrows reacted. When the arrows were pressed, symbols appeared.

I hope I explained it clearly !? (and it is likely that there was some kind of glitch, since the game worked like that for me).

I see. Thank you for the information. I will continue to investigate.

Regards.

Roland

Handoko

  • Hero Member
  • *****
  • Posts: 4315
  • My goal: build my own game engine using Lazarus
Re: Snake game for the ptcGraph unit
« Reply #14 on: May 01, 2021, 07:37:28 pm »
I tried to compile it under Ubuntu Mate - Lazarus 2.0.10 but failed. The first error was solved after I installed libxxf86dga-dev. But then I got an error while linking message, which I wasn't able to solve.

 

TinyPortal © 2005-2018