22 days in France (with source code) fr, eng, deu, esp

Advanced game related topics
jak64
Enthusiast
Enthusiast
Posts: 502
Joined: Sat Aug 15, 2020 5:02 pm
Location: Ciboure (France)

22 days in France (with source code) fr, eng, deu, esp

Post by jak64 »

Hello,
Here is a v0 version of the game with the source code (over 6000 lines of code) and the .exe (v5.72 64 bits)

ATTENTION, the game works with the 22 regions but, as I said previously, the images and comments are not complete (only complete for Alsace). For the other regions, there are no photos or comments (except for certain "activities" such as visiting an aquarium, taking a hot-air balloon ride, playing a game of pétanque, going to the cinema ...).

If you want to complete the game yourself by putting photos, comments, tell me and I'll do a tutorial to explain how to do it: it's simple but it takes time (look for photos, cut out images of objects, write comments ...)

A minimum resolution of 1366 X 768 pixels is required for the game to work.

PROGRAM LINK
https://u.pcloud.link/publink/show?code ... QS05OIuFJX
BarryG
Addict
Addict
Posts: 3318
Joined: Thu Apr 18, 2019 8:17 am

Re: 22 days in France (with source code) fr, eng, deu, esp

Post by BarryG »

Looks good. Had a quick play with the tile-swapping part, but I'm too busy to get too involved right now.
jak64
Enthusiast
Enthusiast
Posts: 502
Joined: Sat Aug 15, 2020 5:02 pm
Location: Ciboure (France)

Re: 22 days in France (with source code) fr, eng, deu, esp

Post by jak64 »

Hello,
I noticed that you were not interested in the game "22 days to France", so I decided not to publish the sequel.
Regards,
BarryG
Addict
Addict
Posts: 3318
Joined: Thu Apr 18, 2019 8:17 am

Re: 22 days in France (with source code) fr, eng, deu, esp

Post by BarryG »

Are you talking to me? Don't let my lack of time deter you. Others may want the sequel. It's only been 3 days since you told us about the games, so give people a chance to find your post and try it! Sometimes I don't visit here for days, and I'm sure others are the same.
User avatar
Saki
Addict
Addict
Posts: 830
Joined: Sun Apr 05, 2020 11:28 am
Location: Pandora

Re: 22 days in France (with source code) fr, eng, deu, esp

Post by Saki »

Hi, you should not expect to get recognition or praise in a forum.

The primary problem is that there is no shooting and blood in your game.

Even though I didn't play your game, I looked at the pictures.
It is very beautiful and made with love.

Primarily you made it for you because you like it.
地球上の平和
dcr3
Enthusiast
Enthusiast
Posts: 165
Joined: Fri Aug 04, 2017 11:03 pm

Re: 22 days in France (with source code) fr, eng, deu, esp

Post by dcr3 »

Hi.

I don't know, how long you have, been programming in PB.

I can see, that you have put, a lot of effort in your game. :)

And I, would like to see the sequel and what kind of improvements you have made.

It's nice of you, to share your work in the PB community. :)
User avatar
Lord
Addict
Addict
Posts: 849
Joined: Tue May 26, 2009 2:11 pm

Re: 22 days in France (with source code) fr, eng, deu, esp

Post by Lord »

Hi!
jak64 wrote:...
I noticed that you were not interested in the game "22 days to France", ...
Maybe this is one reason:
jak64 wrote:...
A minimum resolution of 1366 X 768 pixels is required for the game to work.
...
If you can't start the game, you can't get any impression...
Image
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2057
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: 22 days in France (with source code) fr, eng, deu, esp

Post by Andre »

Just tested the .exe file, as your project looks interesting. :)

But unfortunately it "hangs" directly after starting, at a yellow screen with 4 country flags. No texts, no buttons, and nothing to enter or to click... I need to manually kill the task with Windows task-manager... :|

My system: Win10, 1920x1080 pixel screen with 125% DPI setting
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
jak64
Enthusiast
Enthusiast
Posts: 502
Joined: Sat Aug 15, 2020 5:02 pm
Location: Ciboure (France)

Re: 22 days in France (with source code) fr, eng, deu, esp

Post by jak64 »

Hello,
You just have to click on the flag corresponding to the chosen language
User avatar
Saki
Addict
Addict
Posts: 830
Joined: Sun Apr 05, 2020 11:28 am
Location: Pandora

Re: 22 days in France (with source code) fr, eng, deu, esp

Post by Saki »

You have to change that.
At higher scales the flags are also moved out of the screen.
地球上の平和
jak64
Enthusiast
Enthusiast
Posts: 502
Joined: Sat Aug 15, 2020 5:02 pm
Location: Ciboure (France)

Re: 22 days in France (with source code) fr, eng, deu, esp

Post by jak64 »

Hi saki,
I don't understand why the flags are off the screen since I put the following command in the program :

Code: Select all

ResizeWindow(#FenetrePrincipale,0,0,LargeurBureau,HauteurBureau)
Try commenting this line out
User avatar
Saki
Addict
Addict
Posts: 830
Joined: Sun Apr 05, 2020 11:28 am
Location: Pandora

Re: 22 days in France (with source code) fr, eng, deu, esp

Post by Saki »

Hi,
you must respect the desktop resolution.
Activate on Windows primary DPI aware !
Many use resolutions > 100%, mostly 125%.
Then nothing works for you, because your mouse runs fast out of the picture.
And with increasing resolution everything becomes too big.
You just have to divide everything that has to do with graphics by the resolution factor.
So : Width/DesktopResolutionX(), Height/DesktopResolutionY().
For digital monitors, X is always = Y, since they all use square pixels.
So in principle you can write DR.d=DesktopResolutionX().

ResizeImage(ID , Width/DR , Height/DR).

Maybe activate the ESC key, then you do not have to enter the Task Manager for a break.

For your game I would proceed in such a way that I create the graphics on a virtual desktop.
That means you temporarily display everything on an image at least twice as big as necessary.
You then resize this image and copy it to display it in the output.
This way you get the interpolation of ResizeImage().
Everything will be much smoother and less angular, it will look much better.
And the adjustment to any scale is simplified because you always draw on a virtual desktop of the same size.
This is now primarily considered.

Source codes, it is standard, best, always in english :wink:

Best Regards Saki
地球上の平和
jak64
Enthusiast
Enthusiast
Posts: 502
Joined: Sat Aug 15, 2020 5:02 pm
Location: Ciboure (France)

Re: 22 days in France (with source code) fr, eng, deu, esp

Post by jak64 »

Hello saki,
Thanks for the explanations, but I didn't understand it correctly: can you write a little program and post it on the site so that I understand better?
Thank you
User avatar
Saki
Addict
Addict
Posts: 830
Joined: Sun Apr 05, 2020 11:28 am
Location: Pandora

Re: 22 days in France (with source code) fr, eng, deu, esp

Post by Saki »

Hi, samples

Output simple on canvas

#1

Code: Select all

; ########## Activate the Compileroption DPI aware ###########

UseJPEGImageDecoder()

texture_ID=LoadImage(#PB_Any, #PB_Compiler_Home+"Examples\3D\Data\Textures\ValetCoeur.jpg")

window_ID=OpenWindow(#PB_Any,0, 0, 1800/DesktopResolutionX(), 900/DesktopResolutionY(), "", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
canvas_ID=CanvasGadget(#PB_Any, 0, 0, WindowWidth(window_ID), WindowHeight(window_ID))

image_ID=CreateImage(#PB_Any, 3600, 1800, 24, #White)

StartDrawing(ImageOutput(image_ID))
Circle(1800, 900, 500, #Red)
Line(0, 0, 3600, 1800, #Blue)
StopDrawing()
ResizeImage(image_ID, GadgetWidth(canvas_ID)*DesktopResolutionX(), GadgetHeight(canvas_ID)*DesktopResolutionY())
StartDrawing(CanvasOutput(canvas_ID))
DrawImage(ImageID(image_ID), 0, 0)
StopDrawing()

For i=0 To 1500
  StartDrawing(CanvasOutput(canvas_ID))
  DrawImage(ImageID(image_ID), 0, 0)
  DrawImage(ImageID(texture_ID), i, 300)
  StopDrawing()
  Repeat
    Define win_event=WindowEvent()
    If win_event=#PB_Event_CloseWindow
      End
    EndIf
  Until Not win_event
Next

Repeat
  Define win_event=WaitWindowEvent()
Until win_event=#PB_Event_CloseWindow
#2

Code: Select all

; ########## Activate the Compileroption DPI aware ###########

UseJPEGImageDecoder()

texture_ID=LoadImage(#PB_Any, #PB_Compiler_Home+"Examples\3D\Data\Textures\ValetCoeur.jpg")

ResizeImage(texture_ID, ImageWidth(texture_ID)/DesktopResolutionX(), ImageHeight(texture_ID)/DesktopResolutionY())

window_ID=OpenWindow(#PB_Any,0, 0, 1800/DesktopResolutionX(), 900/DesktopResolutionY(), "", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
canvas_ID=CanvasGadget(#PB_Any, 0, 0, WindowWidth(window_ID), WindowHeight(window_ID))

image_ID=CreateImage(#PB_Any, 3600, 1800, 24, #White)

StartDrawing(ImageOutput(image_ID))
Circle(1800, 900, 500, #Red)
Line(0, 0, 3600, 1800, #Blue)
StopDrawing()
ResizeImage(image_ID, GadgetWidth(canvas_ID)*DesktopResolutionX(), GadgetHeight(canvas_ID)*DesktopResolutionY())
StartDrawing(CanvasOutput(canvas_ID))
DrawImage(ImageID(image_ID), 0, 0)
StopDrawing()

For i=0 To 1670
  StartDrawing(CanvasOutput(canvas_ID))
  DrawImage(ImageID(image_ID), 0, 0)
  DrawImage(ImageID(texture_ID), i, 300)
  StopDrawing()
  Repeat
    Define win_event=WindowEvent()
    If win_event=#PB_Event_CloseWindow
      End
    EndIf
  Until Not win_event
Next

Repeat
  Define win_event=WaitWindowEvent()
Until win_event=#PB_Event_CloseWindow
#3

Code: Select all

; ########## Activate the Compileroption DPI aware ###########

UseJPEGImageDecoder()

texture_ID=LoadImage(#PB_Any, #PB_Compiler_Home+"Examples\3D\Data\Textures\ValetCoeur.jpg")

window_ID=OpenWindow(#PB_Any,0, 0, 1800/DesktopResolutionX(), 900/DesktopResolutionY(), "", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
canvas_ID=CanvasGadget(#PB_Any, 0, 0, WindowWidth(window_ID), WindowHeight(window_ID))

image_ID=CreateImage(#PB_Any, 3600, 1800, 24, #White)

StartDrawing(ImageOutput(image_ID))
Circle(1800, 900, 500, #Red)
Line(0, 0, 3600, 1800, #Blue)
StopDrawing()
StartDrawing(CanvasOutput(canvas_ID))
DrawImage(ImageID(image_ID), 0, 0)
StopDrawing()

For i=0 To 3300 Step 5
  background_ID=CopyImage(image_ID, #PB_Any)
  StartDrawing(ImageOutput(background_ID))
  DrawImage(ImageID(texture_ID), i, 300)
  StopDrawing()
  ResizeImage(background_ID, GadgetWidth(canvas_ID)*DesktopResolutionX(), GadgetHeight(canvas_ID)*DesktopResolutionY())
  StartDrawing(CanvasOutput(canvas_ID))
  DrawImage(ImageID(background_ID), 0, 0)
  StopDrawing()
  Repeat
    Define win_event=WindowEvent()
    If win_event=#PB_Event_CloseWindow
      End
    EndIf
  Until Not win_event
  FreeImage(background_ID)
Next

Repeat
  Define win_event=WaitWindowEvent()
Until win_event=#PB_Event_CloseWindow
地球上の平和
jak64
Enthusiast
Enthusiast
Posts: 502
Joined: Sat Aug 15, 2020 5:02 pm
Location: Ciboure (France)

Re: 22 days in France (with source code) fr, eng, deu, esp

Post by jak64 »

Hello saki,
thanks for these examples, but it would be too complicated to modify my program.
maybe I will use this in future programs.
Post Reply