<div dir="ltr">Awesame work! :-)<div><br></div><div><div>areas for improvement:</div><div><br></div><div>in santa2</div><div>- loop Jingle Bells.mp3 for an infinite pleasure ;-)</div><div>- play boing.mp3 multiple times in case of multiple keyboard hits.</div><div><br></div><div>in snake:</div><div>- avoid this: <a href="https://imagebin.ca/v/3nOH4webezqH">https://imagebin.ca/v/3nOH4webezqH</a></div><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 7 January 2018 at 15:03, Ingemar Ragnemalm <span dir="ltr"><<a href="mailto:ingemar@ragnemalm.se" target="_blank">ingemar@ragnemalm.se</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
An update on my tests with pas2js:<br>
<br>
I have overcome most problems now and am quite a bit happier with what I see - and what I did see before was good!<br>
<br>
Reimar Grabowski asked for interactivity. Done!<br>
<br>
Myself, I wanted to reduce the amount of information, like file references in the HTML file, because, yes, it does matter! And I wanted to load sounds, and of course I, too, wanted interactivity! Done! Adding missing methods, interfacing to more APIs (like audio), no problem! It was surprisingly easy.<br>
<br>
Here is an updated version of the Santa animation:<br>
<br>
<a href="http://ragnemalm.se/images/santa/santa2.html" rel="noreferrer" target="_blank">http://ragnemalm.se/images/san<wbr>ta/santa2.html</a><br>
<br>
and here is an (almost) fully working snake game:<br>
<br>
<a href="http://ragnemalm.se/images/santa/snake/snake.html" rel="noreferrer" target="_blank">http://ragnemalm.se/images/san<wbr>ta/snake/snake.html</a><br>
<br>
I really enjoyed making these! My code gets more and more comfortable, there is no problem hiding the JS libraries. Will I do that in the long run? Well, I don't know but doing that can help me making the code portable.<br>
<br>
I also made some minor additions to Lightweight IDE, so now I edit, compile and run directly from the IDE. "Run" passes the HTML to a web browser.<br>
<br>
I have implemented a different way to run animations, but still don't know if it flickers on other platforms. On my Mac, there is no flicker at all.<br>
<br>
For gaming and similar purposes, all I miss now is the ability to save scores on file. For a wider range of applications, I want the ability to download data to my local drive. I havn't considered the case of communicating directly with some server.<br>
<br>
For being a preliminary "0." version, pas2js works wonderfully well!<br>
<br>
/Ingemar<br>
<br>
<br>
Den 2017-12-24 kl. 12:00, skrev Ingemar Ragnemalm:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Den 2017-12-22 kl. 12:00, skrev Michael Van Canneyt:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Wed, 20 Dec 2017, Reimar Grabowski wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Wed, 20 Dec 2017 15:14:50 +0100<br>
Ingemar Ragnemalm<<a href="mailto:ingemar@ragnemalm.se" target="_blank">ingemar@ragnemalm.se</a><wbr>>  wrote:<br>
<br>
But I don't see anything wrong with putting them in the HTML. For more flexibility you could create the HTML via a template engine or something but I would only load them from JS if there is a good reason to do so.<br>
</blockquote></blockquote>
One reason is to collect information in one place. Making HTML load it<br>
gives me two steps to the file instead of one. More chances to do it wrong.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
While you are updating your code you can remove the two dependencies on bootstrap (as they are not satisfied anyway and I think the whole fpReport dir is superflous) and perhaps do something about the flickering of the text (although this may be a little bit too much asked).<br>
</blockquote></blockquote>
Ah. They just remained from an example I worked from.<br>
<br>
Text flicker is most likely caused by not double buffering. I need to<br>
generate an image off-screen. Nothing strange with that, just one more<br>
thing to figure out in the JS environment.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It feels really nice to have my first Pascal web application running!<br>
</blockquote>
Not dissing you or your work or pas2js but I fail to see the web application part. There is no communication between client and server. Actually there is no server side code at all and there is no interactivity. In my book this is a static page, but perhaps I miss something.<br>
</blockquote></blockquote>
There is no interactivity, and no client-server communication, but this is my *first*, my "proof of concept" for the platform, like Hello World but with some more features (animation, random numbers, graphics elements). Doing *something* with it myself, showing myself the potential, making a kind of "thanks" for it and a Christmas greeting atthe same time. Interactivity is the next step, and the ability to save data somewhere.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
That is one of the points of pas2js. To allow you to program the browser.<br>
<br>
There is no need for a server. You can make e.g. a chess application that runs<br>
100% in the browser, using a single HTML file. You can embed the JS and<br>
images in the HTML itself, and thus your HTML file is the 'executable'.<br>
<br>
See the browser as a desktop. Your program runs in that desktop.<br>
If need be, this program can contact a server - the classical<br>
client/server model, using HTTP as the protocol - but this is by no means a necessity.<br>
<br>
In that sense, the demo demonstrates this. The server is just there for you<br>
to be able to download the "program"...<br>
</blockquote>
Exactly. I get a cross-platform solution with no installations, in a way<br>
that users are increasingly used to. And I can write it in FPC, which I<br>
am a lot more happy with than a rubbish language like JavaScript! For me<br>
it opens a lot of possibilities!<br>
<br>
But let me get back to my current problems. I can accept loading images<br>
through HTML for now, but how can I load and play sounds? There is an<br>
"Audio" API in JavaScript but it seems that pas2js doesn't support it,<br>
it can't find play(). I have searched web.pas and a few others for it.<br>
Where do I start to fix that?<br>
<br>
/Ingemar<br>
</blockquote>
<br>
______________________________<wbr>_________________<br>
fpc-pascal maillist  -  <a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank">fpc-pascal@lists.freepascal.or<wbr>g</a><br>
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal" rel="noreferrer" target="_blank">http://lists.freepascal.org/cg<wbr>i-bin/mailman/listinfo/fpc-pas<wbr>cal</a></blockquote></div><br></div>