Dice Poker

Post

Posted
Rating:
Item has a rating of 5 (Liked by gbWillyLiked by Gianluigi)
#1 (In Topic #2006)
Avatar
Enthusiast
Yogi is in the usergroup ‘Enthusiast’
Hi folks,

This learning project was developed over the Christmas holidays 2025/26.

We used to play this game a lot during our school days about 45 years ago
(and drink beer while doing so :-)

At the beginning, I decided to make the playing field
static and not generate it during runtime.

Up to 4 players can play at the same time.
In addition, it is possible to use one of the players
as a PC opponent.

Playing against the computer is a challenge.
The routine for selecting moves is far from perfect, but at least you can
play against the computer.

Sound effects, background music, and playing against the
computer are optional and can be saved as defaults.

I have no idea if it is possible to adjust the audio volume
with the mediaplayer, so I used Audacity to lower the
background music so that the other sounds remain audible.

I would also have liked to have displayed the dice roll differently,
but then left it as it is now.

I discarded the option of allowing multiple columns per player,
as it was easier in this form.

Have fun 😇
Regards,
Yogi

Current version

Attachment

Dice-0.0.8.tar.gz

Attachment

Dice-0.0.7.tar.gz

Last edit: by Yogi

Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Guru
cogier is in the usergroup ‘Guru’
cogier is in the usergroup ‘GambOS Contributor’
Hi Yogi, the game looks good, but I have a couple of points.

This is in German: -


Is the form supposed to be like this? It looks like the bottom is cut off, and I can't resize it: -


This does not look correct: -


With a change to line 843 in Dice.class to If Message.Question("Exit?", "&Yes", "&No") = 1 Then you get this: -
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Enthusiast
Yogi is in the usergroup ‘Enthusiast’

cogier said

Hi Yogi, the game looks good, but I have a couple of points.

This is in German: -


Is the form supposed to be like this? It looks like the bottom is cut off, and I can't resize it: -





Dear cogier ,
Thanks a lot for looking at the Game, if correct translated it is "Betriebsblind" => operational blindness
if someone is too much involved.

+) Changed the German words.

+) Changed the position of the rotating dices in dependence to the "hold" Buttons at the bottom.
Maybe the resolution of your screen is that much different to mine or whatever it is, no idea.
Just see if it is now working, the dices should now be visible.

+) I added the "&" ampersand to the question dialog, never used it because the default button
is "yes" if I hit enter.

I'm working a lot on the PC Player, changed also something in this version.

Kind regards,
Yogi
Attachment

Dice-0.0.2.tar.gz

Online now: No Back to the top

Post

Posted
Rating:
Item has a rating of 5 (Liked by Yogi)
#4
Avatar
Expert
Quincunxian is in the usergroup ‘Expert’
Quincunxian is in the usergroup ‘Blogger’
Hi Yogi,
I like it.
Here are two dice icons to add to your project.
32x32 for the project icon and 16x16 for the new game icon in the menu.


Attachment

Dice-Icons.tar.gz


Cheers - Quin.
I code therefore I am
Online now: No Back to the top

Post

Posted
Rating:
#5
Avatar
Enthusiast
Yogi is in the usergroup ‘Enthusiast’

Quincunxian said

Hi Yogi,
I like it.
Here are two dice icons to add to your project.
32x32 for the project icon and 16x16 for the new game icon in the menu.


Attachment

Dice-Icons.tar.gz



Hi Quincunxian ,

Thanks for looking at the Game and contributing to it,
nice that it becomes a collective Project 👍

I added the icons.
Here on Ubuntu 24.04 in the standard gb.gui component I don't see the icon in the taskbar,
just see this icon for all Apps I created and running:
Image

screenshot_dice.png

screenshot_dice.png

(Click to enlarge)


So I have not that much attention on this topic.
Once I got it running by I think using gb.qt5 as GUI component.

I will upload the changed version later, who knows who will contribute to the project …

Kind regards,
Yogi
Online now: No Back to the top

Post

Posted
Rating:
#6
Avatar
Guru
cogier is in the usergroup ‘Guru’
cogier is in the usergroup ‘GambOS Contributor’

Yogi said

Here on Ubuntu 24.04 in the standard gb.gui component I don't see the icon in the taskbar,
just see this icon for all Apps I created and running:

To fix this, add an icon to the Form:-

Online now: No Back to the top

Post

Posted
Rating:
#7
Avatar
Enthusiast
Yogi is in the usergroup ‘Enthusiast’
Dear cogier ,

Thanks for having a look at this icon thingsy,
I tried my best, did the icon in the form, did also an executable
then changed project GUI to gb.qt5
nothing changed!

If I remember well it did in the beginning if I used the Wayland manager, now at X11 Gnome 46
it doesn't …

I leave the icon in the form so if someone else downloads the Game it will hopefully be visible.

kind regards,
Yogi
Online now: No Back to the top

Post

Posted
Rating:
#8
Avatar
Guru
cogier is in the usergroup ‘Guru’
cogier is in the usergroup ‘GambOS Contributor’

Yogi said

I tried my best, did the icon in the form, did also an executable
then changed project GUI to gb.qt5
nothing changed!

You got me thinking that there must be a way to fix this. I loaded Ubuntu 24.04 on another computer, installed Gambas and Dice, then I had to find out how to get it to install X11 instead of Wayland. I discovered that you need to place the image, you want to use, in the program's main folder.



Now got to Project Properties ([Ctrl]+I) and set the picture here.



Then: -



Online now: No Back to the top

Post

Posted
Rating:
#9
Avatar
Enthusiast
Yogi is in the usergroup ‘Enthusiast’

cogier said


You got me thinking that there must be a way to fix this. I loaded Ubuntu 24.04 on another computer, installed Gambas and Dice, then I had to find out how to get it to install X11 instead of Wayland. I discovered that you need to place the image, you want to use, in the program's main folder.

Now got to Project Properties ([Ctrl]+I) and set the picture here.

Then: -

[…]


Dear cogier
Very much appreciated, so much effort for this little icon.

My used icon is in the programs main folder. Even set the icon for the form and in the project properties.
Problem stays…

As I was used to handle Micro*** Windows I was maybe to curious to change things in Ubuntu too much,
if I did something which was not good for the Ubuntu System, it's my fault.
I'm on Ubuntu since August, deleted all backups and the running system by accident, had to setup from the beginning
and now I'm a little bit slower in changing things.
I always try to see the good in things, so I did using Wine, then I crashed the system with installing a
Win App with Wine what I didn't believe that this could happen (topic sandbox)

So now I have a running system, and, believe it, never change a running system 😁

Kind regards,
Yogi
Online now: No Back to the top

Post

Posted
Rating:
#10
Avatar
Expert
Quincunxian is in the usergroup ‘Expert’
Quincunxian is in the usergroup ‘Blogger’
Yogi,
Just curious. Did you use ESpeak to create the "Player One" sound effect?

I use it (a lot) in one of my applications and it does sound very familiar.



 

Cheers - Quin.
I code therefore I am
Online now: No Back to the top

Post

Posted
Rating:
#11
Avatar
Enthusiast
Yogi is in the usergroup ‘Enthusiast’

Quincunxian said

Yogi,
Just curious. Did you use ESpeak to create the "Player One" sound effect?

I use it (a lot) in one of my applications and it does sound very familiar.



 

Good Morning,

Yes - and did a little Gambas GUI for using a few parameters,
languages DE, EN, IT, FR
words per second
Testbutton for hearing
Save to WAV

Languages seems not to be the best but for that case …

There are so many TTS Apps around, I took the (I think) smallest/easiest to use

Online now: No Back to the top

Post

Posted
Rating:
#12
Avatar
Enthusiast
Yogi is in the usergroup ‘Enthusiast’
The new version has some minor improvements

  • added icons from Quincunxian
  • changed some things suggested by cogier
  • changed the "Dice Button" if clicked to .enabled=false and after dice back to .enabled=true to prevent accidental click on it

Actual Version download from the starting post

Online now: No Back to the top

Post

Posted
Rating:
#13
Avatar
Enthusiast
Yogi is in the usergroup ‘Enthusiast’
The new version has some improvements:

  • improved computer player
  • some GUI enhancements
  • Soundeffect for the winner

off topic:
I spent my time in the warm living room while snow fell outside.


Current Version download from the starting post

Last edit: by Yogi

Online now: No Back to the top

Post

Posted
Rating:
#14
Avatar
Enthusiast
Yogi is in the usergroup ‘Enthusiast’
The last version has some improvements:

  • improved computer player
  • some GUI enhancements
  • Set Name of the Players for use in…
  • High Score/Low Score List

To be honest, I lost so often against the computer
that I created a high score list to document it.

So, once again, a little more bells and whistles…

I'm a bit curious regarding the gridview object I used to build the
High Score Table.
Is it possible to change the colour of the selection? Default is grey…

Anyway, I worked around as you can see if you play a little to see the
results in the list…

Regards,
Yogi

Current Version download from the starting post

Online now: No Back to the top

Post

Posted
Rating:
#15
Avatar
Expert
Quincunxian is in the usergroup ‘Expert’
Quincunxian is in the usergroup ‘Blogger’
Hi Yogi,
I checked and I do have the current version (4 ?) but cannot find a gridview?

However, Gridview1.[Row,Column].Background = Color will set the selected cell colour as the example below.

GridViewCellColour.png
 

Cheers - Quin.
I code therefore I am
Online now: No Back to the top

Post

Posted
Rating:
#16
Avatar
Enthusiast
Yogi is in the usergroup ‘Enthusiast’

Quincunxian said

Hi Yogi,
I checked and I do have the current version (4 ?) but cannot find a gridview?

However, Gridview1.[Row,Column].Background = Color will set the selected cell colour as the example below.
 

Hi Quincunxian
Thanks for having a look.
The current version is 6. See here where I used the gridview for High Scores:
Modul


Regarding the selection It was my fault, I already found the background syntax.
I was interested in changing the selected line cursor, which is grey by default:
Gridview HighScore

Thanks &
Kind Regards
Yogi
Online now: No Back to the top

Post

Posted
Rating:
#17
Avatar
Enthusiast
Yogi is in the usergroup ‘Enthusiast’
Hi folks,

The updated version has
  • some bugfixes (High Score/Low Score)
  • minor improvements

Regards,
Yogi

Current Version 7 download from the starting post
Online now: No Back to the top

Post

Posted
Rating:
Item has a rating of 5 (Liked by Yogi)
#18
Avatar
Expert
Quincunxian is in the usergroup ‘Expert’
Quincunxian is in the usergroup ‘Blogger’
Hi Yogi,
I was downloading the attachment from the bottom of the OP, thinking that was the latest version. *sigh* Sorted out now.

I am just curious. Why do you use a module to programatically create a form window and grid view rather that just using a standard form to dispaly the data?
(Just because I can is a reasonable answer and by the ancient gods of assembler code, I've done that often enough myself)
Reuse is the only thing I can think of but you obvisouly had some reason to choose that direction. 


Also, If you want to try lighter shades of color rather than the Gambas pre-sets, you can use as an example:

Code

.background =color.rgb(255, 179, 179)

There is a good color chooser here on W3Schools that allows you to select the colour visually and get the Hex, RGB & Hsl codes.


 


 





 

Cheers - Quin.
I code therefore I am
Online now: No Back to the top

Post

Posted
Rating:
#19
Avatar
Enthusiast
Yogi is in the usergroup ‘Enthusiast’

Quincunxian said

Hi Yogi,
I was downloading the attachment from the bottom of the OP, thinking that was the latest version. *sigh* Sorted out now.

I am just curious. Why do you use a module to programatically create a form window and grid view rather that just using a standard form to dispaly the data?
(Just because I can is a reasonable answer and by the ancient gods of assembler code, I've done that often enough myself)
Reuse is the only thing I can think of but you obvisouly had some reason to choose that direction. 


Also, If you want to try lighter shades of color rather than the Gambas pre-sets, you can use as an example:

Code

.background =color.rgb(255, 179, 179)

There is a good color chooser here on W3Schools that allows you to select the colour visually and get the Hex, RGB & Hsl codes.
 

The project was created as a practice example. That's why I just played around with the “High Score.”
Since I'm not a professional, I like to test things out.

I had also considered storing the high score list in an sqlite database,
but that was a bit too much for the 30 data records that are stored.

Thanks for the tip regarding the color scheme of the grid view. I also played around a bit
with the background and foreground colors, but I couldn't change the selection bar
with them.

Basically, I'm having some fun with Gambas and it makes my life easier under
Ubuntu. It's nice if someone finds it useful,

Regards,
Yogi

Online now: No Back to the top

Post

Posted
Rating:
#20
Avatar
Enthusiast
Yogi is in the usergroup ‘Enthusiast’

Hi folks,

This should be the last version for the time being.
As we know:
Even if a project has been successful, it can certainly benefit from changes.

The last version has
  • minor improvements & GUI effects

Regards,
Yogi

Current Version 8 download from the starting post


Online now: No Back to the top
1 guest and 0 members have just viewed this.