Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Battleships - a few not-so-important comments/suggestions, please feel free to ignore/close at any moment in time #29

Open
rubyFeedback opened this issue Sep 3, 2022 · 6 comments

Comments

@rubyFeedback
Copy link

Hey there Andy,

I recently watched some of the Battleships video at: https://youtu.be/b00OWeLZOt8

(I did not watch it completely - you know, my attention span of a squirrel and multitasking
where I manage to confuse myself. Right now I have about 40 tabs open in firefox, the
last ~10 or so quickly fluctuate - I use that a bit like semi-bookmarks).

Anyway. If I understand it correctly hen battleships currently work for SWT, which is
kind of the "main" entry point into glimmer (at the least as far as I understand it,
since you probably put most effort into SWT, e. g. the editor and so forth).

So my first request would be:

(1) If you ever have some time, would it be possible to also port the Battleship
to different toolkits, based on glimmer? I am not sure how easily feasible
this is, but it would be interesting to see how it works.

(2) Perhaps if you use a central glimmer (bin/glimmer) entry point, perhaps
you could consider adding a game-related section?

Something like this, assuming the below example uses bin/glimmer:

glimmer --game=tetris
glimmer --game=battleship

And so forth.

Or if more information is necessary, something like:

glimmer --game=tetris-libui
glimmer --game=battleship-tk

Or some variant like that. Ideally if it is not available then
it could download this. This is mostly for convenience.
The syntax can be different of course, you could omit
--game= and what not, I just wanted to demonstrate what
I mean.

On error message when it is not implemented, glimmer
could show something like:

"tetris for gtk is currently unavailable"

And so forth.

(This could be enabled for ALL glimmer apps, kind of like
the "glimmer store" example, but I am focusing primarily
on what you wrote. I think it is easier to adapt something
towards code that works, as opposed to implementing
something from scratch, which can take a lot of time. I
guess the first time you add a game it is more work than
later tweaks.)

(2) Statistics via a webpage

I think I mentioned this in the past. I saw on some of the
videos the entries in regards to available games, from
within glimmer. That is all fine, but new users may not
yet try out glimmer by installation, so I think some overview
may be nice to have. I guess glimmer here serves a bit
like a generic entry point to all of glimmer, but perhaps
you could add some statistical information about the
whole glimmer suite too. Things people may find
interesting e. g. "supported games: 20, 8 supported in
glimmer-tk, 4 supported in glimmer-libui" and so forth.
Perhaps an external website but otherwise github should
be fine. And perhaps automatically generated so you don't
have to do so manually. Kind of something to show new
users. The current README has a lot of information,
which is great, but perhaps something that is easier to
read and digest. A bit like zenspider's old quickref, but for
glimmer. Kind of like "this is the page to get a short but
useful overview of glimmer, including links" or something.
And statistics too! I like statistics, as overview helper.

(3) Perhaps add "Battleships" to the glimmer main README,
could be a simple short sentence and one image to keep it
small. Right now we have "glimmer tetris", so it would be
interesting to see different games. At the least for swt perhaps.

You currently mention it (aka the string "battleship") in the changelog
but not in the main README. I think a general entry point for
swt and perhaps glimmer itself may be nice. And if you can
add support perhaps in tk or something. Or even libui. The
latter may be interesting if only for users on windows - libui
on windows is really a good idea. I wonder if we could
implement zenity, but I may file a separate issue for that.

(4) Icons!

We want battleship icons. :-)

I don't know how easy it is to get permissive images here.
I think you used some central icon site that allowed you to
use some icons for another project (i forgot it ... was it that
cyberpunk game? Or something like that. There was some
website I remember where you could download and use
icons/images. Perhaps something like this exists too. A
boat. A larger boat. :D)

(5) Sound effects (optional)

Could be interest to add two small audio sites, but only if
they are available locally, e. g. no need to bundle it. If
a ship was hit, make a different sound that upon a miss.
Users can enable/disable sound settings (not everyone
wants them, but it would be nice to support that - it's
just a fancy/candy idea, not really important for the
actual gameplay; but it can also give people ideas if
they want to implement their own games. Perhaps
even in glimmer, at the least for simple games).

Anyway. I think I'll end this here. As always please ignore
when things take too much effort.

@AndyObtiva
Copy link
Owner

AndyObtiva commented Sep 4, 2022

(1) If you ever have some time, would it be possible to also port the Battleship
to different toolkits, based on glimmer? I am not sure how easily feasible
this is, but it would be interesting to see how it works.

That's a good idea. I'll keep this issue report open until that is addressed.

By the way, Glimmer DSL for LibUI matches enough features in Glimmer DSL for SWT (like custom widgets/controls and canvas/area) to be able to handle building Battleship today if I'm not mistaken. You are welcome to port the game to Glimmer DSL for LibUI and then open a Pull Request there if you want to help contribute. I could help if you get stuck along the way. It's important to contribute code to open-source projects not just ideas.

@AndyObtiva
Copy link
Owner

(2) Perhaps if you use a central glimmer (bin/glimmer) entry point, perhaps
you could consider adding a game-related section?

Something like this, assuming the below example uses bin/glimmer:

glimmer --game=tetris
glimmer --game=battleship

And so forth.

Or if more information is necessary, something like:

glimmer --game=tetris-libui
glimmer --game=battleship-tk
Or some variant like that. Ideally if it is not available then
it could download this. This is mostly for convenience.
The syntax can be different of course, you could omit
--game= and what not, I just wanted to demonstrate what
I mean.

On error message when it is not implemented, glimmer
could show something like:

"tetris for gtk is currently unavailable"

And so forth.

(This could be enabled for ALL glimmer apps, kind of like
the "glimmer store" example, but I am focusing primarily
on what you wrote. I think it is easier to adapt something
towards code that works, as opposed to implementing
something from scratch, which can take a lot of time. I
guess the first time you add a game it is more work than
later tweaks.)

Why don't you implement requests like this one yourself and then open a Pull Request? Do you not like to be helpful by contributing code? Do you forget this is an open-source project and open-source projects are a community effort?

In any case, sometimes you come up with the weirdest requests. I mean how difficult is it to click on the game and run it from this app which comes up when you simply run the shorter glimmer samples command?

Screen Shot 2022-09-03 at 8 21 31 PM

How difficult is it to click this link, which is in the README, to find out what all the available games are?

https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/docs/reference/GLIMMER_SAMPLES.md

How difficult is it to simply browse the project's samples or examples directory to find out all the games that are supported?

Please think of your requests from a real business point of view. If a customer asks a business to implement a feature like this, they will tell the customer they could already just visit the Markdown docs, the project directory, or even the glimmer samples app to find out what games are supported. And, they would deny implementing the request given it does not provide any important business value. Every bit of code written adds to the cost of maintaining the project. So, it is important to cut out the fat and keep the code as focused as possible on what truly adds value.

Obviously, some Glimmer toolkits are still brand new and haven't supported the glimmer command yet, so the user would have to simply open the samples or examples directory to find out what games are supported.

If a developer can't even do that, then they shouldn't be using open-source projects to begin with.

@AndyObtiva
Copy link
Owner

AndyObtiva commented Sep 4, 2022

(2) Statistics via a webpage

I think I mentioned this in the past. I saw on some of the
videos the entries in regards to available games, from
within glimmer. That is all fine, but new users may not
yet try out glimmer by installation, so I think some overview
may be nice to have. I guess glimmer here serves a bit
like a generic entry point to all of glimmer, but perhaps
you could add some statistical information about the
whole glimmer suite too. Things people may find
interesting e. g. "supported games: 20, 8 supported in
glimmer-tk, 4 supported in glimmer-libui" and so forth.
Perhaps an external website but otherwise github should
be fine. And perhaps automatically generated so you don't
have to do so manually. Kind of something to show new
users. The current README has a lot of information,
which is great, but perhaps something that is easier to
read and digest. A bit like zenspider's old quickref, but for
glimmer. Kind of like "this is the page to get a short but
useful overview of glimmer, including links" or something.
And statistics too! I like statistics, as overview helper.

This already exists in this link, which is inside the README under samples:

https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/docs/reference/GLIMMER_SAMPLES.md

You must not be reading the README Table of Contents or Sections or else you wouldn't miss it. Make sure to read slowly. Don't just skim and jump over things like the very obvious README Samples section that links to the samples quickref: https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/docs/reference/GLIMMER_SAMPLES.md

@AndyObtiva
Copy link
Owner

(3) Perhaps add "Battleships" to the glimmer main README,
could be a simple short sentence and one image to keep it
small. Right now we have "glimmer tetris", so it would be
interesting to see different games. At the least for swt perhaps.

You currently mention it (aka the string "battleship") in the changelog
but not in the main README. I think a general entry point for
swt and perhaps glimmer itself may be nice. And if you can
add support perhaps in tk or something. Or even libui. The
latter may be interesting if only for users on windows - libui
on windows is really a good idea. I wonder if we could
implement zenity, but I may file a separate issue for that.

As mentioned above in my previous reply, it already exists, but is extracted from the README into its own page, which is linked from the README over here:

https://github.com/AndyObtiva/glimmer-dsl-swt#samples

Which links to Battleship and all other games (I am not going to put all screenshots int the README given that they are linked in this page ... the README cleanly links to them.. you just missed it):

https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/docs/reference/GLIMMER_SAMPLES.md#battleship

Besides, if you had run glimmer samples and played around with the samples by following instructions that are in the README, you would have already found Battleship and all other games many months ago when you first discovered the project. It's on you if you missed it. It's mentioned indirectly in the README and in the Samples. I am not sure how you could miss it. You must not be doing your homework and running all Glimmer DSL for SWT samples, which is the correct way to learn the library.

@AndyObtiva
Copy link
Owner

AndyObtiva commented Sep 4, 2022

(4) Icons!

We want battleship icons. :-)

I don't know how easy it is to get permissive images here.
I think you used some central icon site that allowed you to
use some icons for another project (i forgot it ... was it that
cyberpunk game? Or something like that. There was some
website I remember where you could download and use
icons/images. Perhaps something like this exists too. A
boat. A larger boat. :D)

I add icons to games that are spun off into separate projects like Glimmer Tetris, Glimmer Klondike Solitaire, and Glimmer Wordle.

If it's just a sample included in a Glimmer GUI library, then it runs as part of the Glimmer Meta-Sample, so it doesn't really need an icon.

In any case, you can build your own separate project of Battleship if you want and add an icon.

What is stopping you?!

I wish you would contact me once with code that you built that you want to showcase and have me link to in my projects. That would make me very happy obviously.

@AndyObtiva
Copy link
Owner

AndyObtiva commented Sep 4, 2022

(5) Sound effects (optional)

Could be interest to add two small audio sites, but only if
they are available locally, e. g. no need to bundle it. If
a ship was hit, make a different sound that upon a miss.
Users can enable/disable sound settings (not everyone
wants them, but it would be nice to support that - it's
just a fancy/candy idea, not really important for the
actual gameplay; but it can also give people ideas if
they want to implement their own games. Perhaps
even in glimmer, at the least for simple games).

I already demonstrate how to use Sound in Glimmer DSL for SWT through the Timer sample and Glimmer Metronome application.

These should serve as sufficient examples for how to add Sound to Glimmer DSL for SWT applications, but that is outside the scope of samples like Battleship. If it were a separate application, I would have considered it, but the sample is about demonstrating GUI not Sound.

Still, if you want to implement it and open a Pull Request or just implement as a separate project, I'd be happy to hear of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants