The recent Nimh Game Revisit Tutorial continued the idea with our Nimh game, whereby a human plays the computer, and we take it you can see that two players within reach of a device playing the game could collaborate as a two player choice. But what about a competitive two player mode of use? Yes, that might be good, but how?
Solutions wise, from coolest to hottest (does not compute?) โฆ
- PHP mail inline HTML form email showing of matches in the body of the email โฆ but โฆ
- lots of current logic is Javascript which does not work with โinline HTML form emailโ
- images pointing at web server disks could be converted to data-URIs but then email would get too large in content size
- PHP mail HTML content attachment that emailee has to download and click on to make happen
- client โaโ href=sms: SMS link containing a &body= argument that is a link to an RJM Programming domain Nimh game (resumption) webpage link
- client โaโ href=mailto: email link containing a &body= argument that is a link to an RJM Programming domain Nimh game (resumption) webpage link
Weโre opting for options 3 and 4 above, but donโt rule out 2 and 1 into the future.
To make this happen a new SMS emoji button piece of HTML โฆ
<a onclick=asksms(); title=SMS style=cursor:pointer;text-decoration:none;>📟</a>
โฆ with associated Javascript โฆ
function asksms() {
if (document.getElementById('sms')) {
var wassms=document.getElementById('sms').value;
var smsis=prompt('Please enter comma separated SMS To,From', wassms);
if (smsis) {
if (smsis.trim() != '') {
if (smsis.indexOf(',') == -1) {
if (smsis == smsis.toUpperCase()) {
smsis+=',' + smsis.toLowerCase();
} else {
smsis+=',' + smsis.toUpperCase();
}
}
document.getElementById('sms').value=smsis;
}
}
}
}
โฆ and similar thoughts for Email button. On macOS an SMS address can be an email address, on occasions, and we cater for both possibilities, in this scenario.
Previous relevant Nimh Game Revisit Tutorial is shown below.
Weโre revisiting our Nimh (โplay the computer and do not get stuck with the last matchโ) game today, for a few reasons โฆ
- it had slowed down, reading through user files, but every now and then we can maintain that โฆ as well as realizing โฆ
- the effect of โฆ
- the sizing weโd established for the matches โฆ combined with โฆ
- the vertical alignment weโd established for a โwhole matches row deletionโ โaโ link โฆ as well as โฆ
- non-mobile onmouseover (ie. on hover) logic weโd applied to preview what could happen should you follow through with your proposed move
โฆ had (unbeknown to us, sometime back โฆ sorrrrrrrryyyyyyyy) set up the dreaded โwhac-a-moleโ situation whereby the โaโ link would move away from โclickabilityโ when hovering on the way to really wanting to click the โaโ link โฆ very frustrating โฆ and the CSS solution panned out to be โฆ
<style>
a { vertical-align:top; }
</style> - it had many โMixed Contentโ situations causing problems, now more โfatalโ with the web browsers whereby the coding allows for a mix of โHTTP:โ protocol content to mix with โHTTPS:โ protocol content, or vice versa โฆ the fix being โฆ
Fix mixed content
via mapping of
HTTP:// and HTTPS://
hardcodings to
// - had two PHP bugs where in โheader(โLocation: /Games/Nimh/index.phpโ);โ we had spurious characters to the right of โ:โ โฆ sorrrrrrrrrryyyyyyy (for some scenarios)
- fixed the size of matches that in some scenarios was far too big
โฆ that we hope makes the game below more bearable โฆ
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.