Sign up

A small D/GtkD example game

I've just completed a small D/GtkD game.

It might be useful for others trying to learn GtkD since it is only just over 1000 lines, yet shows how to create a dialog-style app with a modal dialog and a modeless dialog, and a custom drawn widget, as well as keyboard and mouse handling.

The source (and a 64-bit Windows binary) is here:
github.com/mark-summerfield/gravitate-d.

Any advice/feedback from D and GtkD experts to improve the code would be of interest.

(I also posted similarly to this on the D Learn forum since I'm not sure if people read both.)

Re: A small D/GtkD example game

On Mon, 24 Feb 2020 19:33:05 GMT, mark wrote:

Any advice/feedback from D and GtkD experts to improve the code would be of interest.

Interesting game. Sort of related to Tetris and definitely takes some thinking to get all the tiles removed. Well done, Mark.

Just FYI... it also compiles with DMD (the reference compiler) but without the -brelease switch.

Re: A small D/GtkD example game

On Tue, 25 Feb 2020 13:31:54 GMT, Ron Tarrant wrote:

On Mon, 24 Feb 2020 19:33:05 GMT, mark wrote:

Any advice/feedback from D and GtkD experts to improve the code would be of interest.

Interesting game. Sort of related to Tetris and definitely takes some thinking to get all the tiles removed. Well done, Mark.

Just FYI... it also compiles with DMD (the reference compiler) but without the -brelease switch.

Thanks I've updated the README.md to mention this.

Re: A small D/GtkD example game

On Wed, 26 Feb 2020 08:00:22 GMT, mark wrote:

Thanks I've updated the README.md to mention this.

Cool.

A question... I've been playing your game and it doesn't always allow me to clear all adjacent tiles. It'll something get down to anywhere from a half dozen to two dozen tiles, some of which are clumps all the same colour, and it declares 'game over.' Is these a limit to the number of steps or is this a bug?

Re: A small D/GtkD example game

On Thu, 27 Feb 2020 12:53:55 GMT, Ron Tarrant wrote:

A question... I've been playing your game and it doesn't always allow me to clear all adjacent tiles. It'll something get down to anywhere from a half dozen to two dozen tiles, some of which are clumps all the same colour, and it declares 'game over.' Is these a limit to the number of steps or is this a bug?

Never mind. I just figured it out. It stops the game when there's one tile that will never have a match.

Re: A small D/GtkD example game

On Thu, 27 Feb 2020 14:35:22 GMT, Ron Tarrant wrote:

On Thu, 27 Feb 2020 12:53:55 GMT, Ron Tarrant wrote:

A question... I've been playing your game and it doesn't always allow me to clear all adjacent tiles. It'll something get down to anywhere from a half dozen to two dozen tiles, some of which are clumps all the same colour, and it declares 'game over.' Is these a limit to the number of steps or is this a bug?

Never mind. I just figured it out. It stops the game when there's one tile that will never have a match.

Yes, you're right.

I'll try to improve the help text to explain this better.

Re: A small D/GtkD example game

On Thu, 27 Feb 2020 18:11:01 GMT, mark wrote:

I'll try to improve the help text to explain this better.

Not likely necessary. I didn't actually read the docs. <blush>