Recent

Author Topic: DuckHunter Game  (Read 786 times)

Guva

  • Full Member
  • ***
  • Posts: 167
  • 🌈 ZX-Spectrum !!!
DuckHunter Game
« on: March 24, 2025, 01:09:31 pm »
The game is almost finished. Recommended for reference only!  Since almost everything is a shit code
https://github.com/GuvaCode/DuckHunter


Lulu

  • Sr. Member
  • ****
  • Posts: 292
Re: DuckHunter Game
« Reply #1 on: March 24, 2025, 10:05:51 pm »
Hi Guva,
Thanks to share.
the game seems nice but, on Windows 10 machine, one can see the landscape with the text 'LEVEL 1', we can move the target with the mouse but nothing append. Duck don't appears, no dog.
wishing you a nice life!
GitHub repositories https://github.com/Lulu04

TRon

  • Hero Member
  • *****
  • Posts: 4329
Re: DuckHunter Game
« Reply #2 on: March 24, 2025, 11:22:03 pm »
Hi Guva,

Thank you for sharing.

Trying to compile from source with FPC (no Lazarus) and seem to be missing the create method for TVector2 record.
Code: Bash  [Select][+][-]
  1. fpc -Mobjfpc -B -Furaylib DuckHunt.lpr
  2. Free Pascal Compiler version 3.2.3 [2024/09/23] for x86_64
  3. Copyright (c) 1993-2024 by Florian Klaempfl and others
  4. Target OS: Linux for x86-64
  5. Compiling DuckHunt.lpr
  6. Compiling ./raylib/raylib.pas
  7. Compiling ./raylib/raymath.pas
  8. Compiling ray_sprite_engine.pas
  9. Compiling ray_math2d.pas
  10. ray_math2d.pas(114,19) Warning: function result variable of a managed type does not seem to be initialized
  11. ray_math2d.pas(156,19) Warning: function result variable of a managed type does not seem to be initialized
  12. ray_math2d.pas(181,19) Warning: function result variable of a managed type does not seem to be initialized
  13. DuckHunt.lpr(379,10) Error: identifier idents no member "Create"
  14. DuckHunt.lpr(380,22) Warning: Local variable "target" does not seem to be initialized
  15. DuckHunt.lpr(730,20) Error: identifier idents no member "Create"
  16. DuckHunt.lpr(734,52) Warning: Local variable "fontPosition1" does not seem to be initialized
  17. DuckHunt.lpr(812) Fatal: There were 2 errors compiling module, stopping
  18. Fatal: Compilation aborted
  19. Error: ppcx64 returned an error exitcode
  20.  

Most probably something simple that I've overlooked...
Today is tomorrow's yesterday.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8798
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: DuckHunter Game
« Reply #3 on: March 24, 2025, 11:37:03 pm »
VCS best practice:
  • Don't commit binaries, put them (alongsize resources in expected directory structure, compressed) in Releases page instead
  • Don't commit compiled files: *.compiled, *.o, *.ppu, put them in .gitignore will prevent future accidents

Guva

  • Full Member
  • ***
  • Posts: 167
  • 🌈 ZX-Spectrum !!!
Re: DuckHunter Game
« Reply #4 on: March 25, 2025, 03:29:24 am »
Hi Guva,

Thank you for sharing.

Trying to compile from source with FPC (no Lazarus) and seem to be missing the create method for TVector2 record.
Code: Bash  [Select][+][-]
  1. fpc -Mobjfpc -B -Furaylib DuckHunt.lpr
  2. Free Pascal Compiler version 3.2.3 [2024/09/23] for x86_64
  3. Copyright (c) 1993-2024 by Florian Klaempfl and others
  4. Target OS: Linux for x86-64
  5. Compiling DuckHunt.lpr
  6. Compiling ./raylib/raylib.pas
  7. Compiling ./raylib/raymath.pas
  8. Compiling ray_sprite_engine.pas
  9. Compiling ray_math2d.pas
  10. ray_math2d.pas(114,19) Warning: function result variable of a managed type does not seem to be initialized
  11. ray_math2d.pas(156,19) Warning: function result variable of a managed type does not seem to be initialized
  12. ray_math2d.pas(181,19) Warning: function result variable of a managed type does not seem to be initialized
  13. DuckHunt.lpr(379,10) Error: identifier idents no member "Create"
  14. DuckHunt.lpr(380,22) Warning: Local variable "target" does not seem to be initialized
  15. DuckHunt.lpr(730,20) Error: identifier idents no member "Create"
  16. DuckHunt.lpr(734,52) Warning: Local variable "fontPosition1" does not seem to be initialized
  17. DuckHunt.lpr(812) Fatal: There were 2 errors compiling module, stopping
  18. Fatal: Compilation aborted
  19. Error: ppcx64 returned an error exitcode
  20.  

Most probably something simple that I've overlooked...

Do you have an old version? replace the Target := Vector2Create(GetMousePosition.x - 75/2, GetMousePosition.y - 75/2 )

Guva

  • Full Member
  • ***
  • Posts: 167
  • 🌈 ZX-Spectrum !!!
Re: DuckHunter Game
« Reply #5 on: March 25, 2025, 03:35:39 am »
Hi Guva,
Thanks to share.
the game seems nice but, on Windows 10 machine, one can see the landscape with the text 'LEVEL 1', we can move the target with the mouse but nothing append. Duck don't appears, no dog.
Yes, I checked, and it doesn't work on windows. There is no animation. We'll figure out where the error is.

Guva

  • Full Member
  • ***
  • Posts: 167
  • 🌈 ZX-Spectrum !!!
Re: DuckHunter Game
« Reply #6 on: March 25, 2025, 03:37:21 am »
VCS best practice:
  • Don't commit binaries, put them (alongsize resources in expected directory structure, compressed) in Releases page instead
  • Don't commit compiled files: *.compiled, *.o, *.ppu, put them in .gitignore will prevent future accidents
So what's the problem!  send a `pr` to .gitignore

TRon

  • Hero Member
  • *****
  • Posts: 4329
Re: DuckHunter Game
« Reply #7 on: March 25, 2025, 04:19:56 am »
Do you have an old version? replace the Target := Vector2Create(GetMousePosition.x - 75/2, GetMousePosition.y - 75/2 )
No old version. Source coming straight from your repo that contains a single commit. Thank you for the hint though as I missed that.

line 379
line 730

I am/was not sure whether or not there is a record helper hidden somewhere.
« Last Edit: March 25, 2025, 04:26:48 am by TRon »
Today is tomorrow's yesterday.

 

TinyPortal © 2005-2018