RetroBASIC

Retrogamecoding(.org) => BrowserBasic => Topic started by: Guilect on May 24, 2013, 02:39:09 PM

Title: Announcing BrowserBasic
Post by: Guilect on May 24, 2013, 02:39:09 PM
I hope the members here in this forum are not too adverse to trying JS/HTML5.
I have been working on a project that allows you to type in code in a BASIC-like syntax and it outputs working Javascript and uses HTML5 tags.
It is not a very 'retro' thing, so maybe this is the wrong audience....?
Title: Re: Announcing BrowserBasic
Post by: Cybermonkey on May 24, 2013, 03:11:19 PM
I hope the members here in this forum are not too adverse to trying JS/HTML5.
I have been working on a project that allows you to type in code in a BASIC-like syntax and it outputs working Javascript and uses HTML5 tags.
It is not a very 'retro' thing, so maybe this is the wrong audience....?
Nope. One can do "retro" games with HTML5, can't we? (http://codeincomplete.com/projects/boulderdash/)
I am very interested in your project, how is the actual status? I know you implemented a BASIC which uses the codef library. Although quite impressive it was limited since no input (keyboard, mouse) was actually possible. Any news on that?
Title: Re: Announcing BrowserBasic
Post by: Tomaaz on May 24, 2013, 06:11:08 PM
... so maybe this is the wrong audience....?

Absolutely not. Your project can be a success, because HTML5/JavaScript is extremely popular nowadays.
Title: Re: Announcing BrowserBasic
Post by: Guilect on May 24, 2013, 10:00:55 PM
I used codef as an experiment, a learning experience.
I have since moved on to another library that allows for image rotation, scaling, alpha blending, etc.
It now has mouse, keyboard, sound.
It is quite capable of making a game.
There are still several things that I want to add to it.
Also, there is no help file made yet.
(I like coding, I dislike making help files).

Here is the list of HTML5 related commands so far:
setBackgroundColor
getBackgroundColor
getAlpha
setAlpha
setColor
getWidth
getHeight
setDimensions
setLineWidth
getLineWidth
setLineCap
getLineCap
setImageSmoothing
getImageSmoothing
Line
StrokeRectangle
FillRectangle
StrokeCircle
FillCircle
StrokeArc
FillArc
Draw
DrawCentered
Translate
Scale
Rotate
Push
Pop
Canvas
ImageLoad
Sprite
SpriteSheet
KeyDown
MouseX
MouseY
MousePressed
SoundLoad
SoundPlay
SoundCanPlay
MediaLoaded
MediaPending
ImageWidth
ImageHeight
ImageDraw
SpriteWidth
SpriteHeight
SpriteDraw
Title: Re: Announcing BrowserBasic
Post by: Cybermonkey on May 25, 2013, 07:22:43 AM
Sounds awesome. Will it be a commercial or a free product?
Title: Re: Announcing BrowserBasic
Post by: Guilect on May 25, 2013, 01:09:15 PM
FREE  ;D
Title: Re: Announcing BrowserBasic
Post by: Tomaaz on May 25, 2013, 01:15:17 PM
It looks really impressive!
Title: Re: Announcing BrowserBasic
Post by: Cybermonkey on May 25, 2013, 03:20:59 PM
FREE  ;D
8) Can't wait to test ...
Title: Re: Announcing BrowserBasic
Post by: Aurel on May 25, 2013, 04:43:00 PM
wait..are you author of brutus2d ?
Anyway cool thing..!
Title: Re: Announcing BrowserBasic
Post by: Cybermonkey on May 25, 2013, 08:44:49 PM
wait..are you author of brutus2d ?
Yes, he is ... that's I why think that his Javascript converter must rock!
Title: Re: Announcing BrowserBasic
Post by: Aurel on May 26, 2013, 07:17:20 AM
This is good because if you ask me i prefer javaScript over java and i think that javascript is
far better solutions .
For example i like Crafty
Title: Re: Announcing BrowserBasic
Post by: Guilect on June 01, 2013, 12:27:59 AM
Made some progress.
Put together a very basic help file.
Working on some simple examples.

Hope to have something for you to try in a week or two.
Title: Re: Announcing BrowserBasic
Post by: Cybermonkey on June 01, 2013, 07:11:30 AM

Hope to have something for you to try in a week or two.
8)
Title: Re: Announcing BrowserBasic
Post by: ScriptBasic on June 01, 2013, 08:50:16 AM
I actually use Rhino and a couple different JavaScript based BASIC languages. How would your project differ?

Title: Re: Announcing BrowserBasic
Post by: Guilect on June 01, 2013, 11:56:14 AM
I do not know rhino.
I googled for rhino and it only shows a big animal with a horn.
My project does not have a horn.


Seriously though, if you can provide me a link to this particular rhino I will take a look at it.

I just like making utilities that make games.
HTML5 seems to be the latest craze so I thought I would try my hand at creating something.
There might be better projects out there, there might not.
Title: Re: Announcing BrowserBasic
Post by: Mopz on June 01, 2013, 02:58:23 PM
My project does not have a horn.

To express myself as the kids of today do: LSHIDMT!
Title: Re: Announcing BrowserBasic
Post by: ScriptBasic on June 01, 2013, 03:40:50 PM
(http://files.allbasic.info/ScriptBasic/taco.png)
Title: Re: Announcing BrowserBasic
Post by: Mopz on June 01, 2013, 06:50:06 PM
@ScriptBasic Admit that you had to look that one up!  :)
Title: Re: Announcing BrowserBasic
Post by: ScriptBasic on June 01, 2013, 08:22:42 PM
No me hagas caer otro taco.
Title: Re: Announcing BrowserBasic
Post by: Guilect on June 02, 2013, 02:32:54 PM
My project is NOT a BASIC language interpreter running in javascript.
My project takes a BASIC language and translates it in to 100% javascript.
The end user does not need to have my project installed on their system.
The result is a javascript webpage that can be run on any device and any platform that has an HTML5 capable browser.  No additional downloads or plugins required for the end user.
HTML5 capable browsers include Firefox, Chrome, Opera, and Safari.  (IE9+ ??)
Title: Re: Announcing BrowserBasic
Post by: ScriptBasic on June 02, 2013, 03:29:22 PM
Sounds great!

Looking forward to giving it a try.

Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 02, 2013, 05:47:53 PM
Hi Guilect,

Just seen your post of 24 May.

Inspired by NaaLaa and EGSL but thwarted by Java I am thinking in a similar way about  basic/html5/javascript.
I think this model has HUGE potential for developing simple portable games and other apps.

I posted some thoughts on the thinBasic forum last week but got no response.
http://www.thinbasic.com/community/showthread.php?t=9756&page=2&p=88917#post88917.

I am currently prototyping a converter program that converts a text file with restricted/extended Basic instructions (I call it Browzic)
into a simple html page with canvas and embedded javascript.

My converter prog is currently written in VB6 but ultimately it (and a nice language sensitive editor) could be browser based.
But it sounds like you are some way ahead of me, and probably more skilled.

I am VERY interested in your project. ;D

Good luck. :D



Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 04, 2013, 06:57:06 AM
Hi GUIlect

My project takes a BASIC language and translates it in to 100% javascript.
The end user does not need to have my project installed on their system.
The result is a javascript webpage that can be run on any device and any platform that has an HTML5 capable browser. 
No additional downloads or plugins required for the end user.

Are you planning that the javascript webpage which the end user "loads and plays" in their browser will contain ALL the needed javascript?
Or will there be need for run-time access to external third-party libraries (such as JQuery, ThreeJS,...) ?
Title: Re: Announcing BrowserBasic
Post by: Cybermonkey on June 04, 2013, 08:56:33 AM
You could have a look into https://github.com/metzzo/123-basic
It is a GLBasic compatible translator for javascript/webGL.
Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 04, 2013, 09:53:38 AM
Thanks Cybermonkey,

123 Basic looks very interesting,  :D
I am investigating further.

cheers,
SteveOW
Title: Re: Announcing BrowserBasic
Post by: Guilect on June 04, 2013, 09:14:28 PM
Quote
Are you planning that the javascript webpage which the end user "loads and plays" in their browser will contain ALL the needed javascript?

I did consider that but when making games there are a lot of other files like images and sounds.
So I saw no point in trying to stuff the javascript into just one file.
Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 05, 2013, 09:19:28 AM
Can anyone tell me if there is someway to post a demo .HTML file on this forum?

Title: Re: Announcing BrowserBasic
Post by: Cybermonkey on June 05, 2013, 09:44:04 AM
Can anyone tell me if there is someway to post a demo .HTML file on this forum?
Put a direct link to your HTML file, like this: http://retrogamecoding.org/2ddrawing.html
Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 05, 2013, 10:30:52 AM
Sorry I should have said:-

"Can I upload an HTML file to the retrogamecoding.org website?"

I tried to attach my HTML file to a post but the HTML filetype is not allowed.

I could zip it I suppose and ask the user to unzip it
or I could rename it to .TXT, upload it and ask user to download and rename to .HTML
but these seem a bit effortful.

The thing is that my particular HTML file is an app in itself (its only 23Kb).
I tried to post it as text but it exceeds the 20,000 character limit.
Title: Re: Announcing BrowserBasic
Post by: Tomaaz on June 05, 2013, 11:28:02 AM
I could zip it I suppose and ask the user to unzip it

That's the best solution.
Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 05, 2013, 12:25:58 PM
Attached is a Zipped  HTML file produced by coding in "Browzic" and converting to Javascript.
It is not pretty.
But it demonstrates the concept.

It runs in Firefox 20 on my Windows7 laptop.
It wont work if your browser doesnt support HTML5 Canvas.
Title: Re: Announcing BrowserBasic
Post by: Guilect on June 05, 2013, 10:55:39 PM
Looks good SteveOW.
Seems you and I have had the same kind of ideas.
I, for instance, had named my project BrowserBasic.
The BASIC language that you can translate is very complete looking.
Title: Re: Announcing BrowserBasic
Post by: Guilect on June 05, 2013, 11:07:43 PM
Here is a sample from my project.
The text file is the original BASIC source that gets translated.

Arrow keys to move.
Title: Re: Announcing BrowserBasic
Post by: ScriptBasic on June 05, 2013, 11:33:34 PM
I gave it a try in Firefox on my Ubuntu 64 laptop. Works fine as far as I can tell. (slight delays in movement of Bob)

Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 06, 2013, 12:23:15 AM
Guilect I am impressed. :D
You are far ahead of me with your graphics and user interface (and probably most other things!).


The BASIC language that you can translate is very complete looking.

There is no pre-existing Basic language plan there as such.  :-[ It is an evolving prototype.
I am just adding simple and essential Basic-style language structures that I need for each new task.
It is constrained mainly by my limited understanding of javascript and html.
Quite a bit of the functionality in the demo comes from raw javascript which has not been translated from browzic.
Browzic acts as a friendly wrapper that will help to keep the novice amateur app developer away from horrible html & javascript.
With time hopefully Browzic will be able to do more and more things that currently require html & js.


Title: Re: Announcing BrowserBasic
Post by: Guilect on June 08, 2013, 01:44:32 PM
I have added spritesheet aninimation functionallity.
Hope to add touch and have something out in about a week.
Title: Re: Announcing BrowserBasic
Post by: Cybermonkey on June 08, 2013, 05:03:03 PM
Here is a sample from my project.
The text file is the original BASIC source that gets translated.

Arrow keys to move.
Looks very cool. I see you are using the Love2d Javascript port as your game library. Is this port complete, yet?
Title: Re: Announcing BrowserBasic
Post by: Guilect on June 08, 2013, 10:13:26 PM
There are 3 ports that I know of.
None are a complete replacement for the hundreds of commands that Love2D has.
This particular port has all the necessary commands to make nice HTML5 games.
Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 13, 2013, 06:30:04 PM
Thanks Cybermonkey,

123 Basic looks very interesting,  :D
I am investigating further.

cheers,
SteveOW

123Basic looks very nice as a proposal.
Recently heard from author of 123Basic. 
Project is currently stalled for lack of time and not tryable.
( https://github.com/metzzo/123-basic)

Motive for 123Basic is to make it easy to port GL Basic games to Javascript/HTML.
So not quite what I am looking for.

So I am continuing to develop BROWZIC as a basic-like "language" which translates into Javascript/HTML and hides their horribleness from the casual app developer.  Present thinking is that BROWZIC will be capable of being used as a simple platform for game development while not being focussed only on game development.  So then it can be used with external libraries written in javascript or anything callable from javascript.
So then any person wishing to make a game-development-platform for browser-based games could let the game-developer use BROWZIC as a scripting language.  And the game-development-platform itself can be written in BROWZIC.  In fact the BROWZIC-to-JS/HTML translator could itself be written in BROWZIC. And then there will be universal peace and happiness.
(But words are cheap.    ;D)
Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 13, 2013, 08:56:39 PM
...so heres Browzic demo # 2

Now available online at:- 
http://www.zen226082.zen.co.uk/PongGoneWrong4.html (http://www.zen226082.zen.co.uk/PongGoneWrong4.html)

also available as attached zip file:-
It should run straight from the zip file by opening the zip file and then double-clicking on the .html file.
but for sound and image to work from zip you will need to install the .html file and the _files folder on your local disk.

Title: Re: Announcing BrowserBasic
Post by: Guilect on June 15, 2013, 12:32:23 AM
Lots of colors swirling around there.
Runs smooth.
Keep it going.
I like the idea of being able to do any kind of application.

I just finished coding and testing my WiFi BrowserBasic server.
This allows you to code a BrowserBasic game on your desktop and then immediately be able to test it on your WiFi enabled smartphone or tablet.  No need for uploading to a webhost first.
No need to download to the device.  Just set your device's web browser to point to the server and viola.

I am almost done with what I want to accomplish for a first release.
I have spent most of the development time on the workings of the project and not on demos.
I hope once BrowserBasic is released someone can make a sweet demo to share with us all.
Title: Re: Announcing BrowserBasic
Post by: Guilect on June 15, 2013, 03:17:08 PM
Here is a release for you to play with.
Download, unzip, run pn.exe
(pn.exe (programmer's notepad) is the editor that is setup for BrowserBasic)

There are a few examples in the examples folder.

F5 - Compiles the active page.
F6 - Runs the HTML page in Firefox
F7 - Runs the HTML page in Chrome.
F8 - Starts the BrowserBasic WiFi Server
F9 - Launches this help file.

You might have to adjust the install location for Firefox and Chrome depending upon your system.
It is currently set for their default installation locations in Windows XP 32-bit.
Instructions on how to change the settings are in the help file.

BrowserBasic (http://www.pewtersoftware.com/browserbasic/browserbasic.zip)
Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 15, 2013, 04:00:12 PM
WOW! :o :D ;D
That is a really impressive-looking package GUIlect!
It didnt run out of the opened zip file because it couldnt find a dll but
I just extracted everything in the zip file to C:Program Files/BrowserBasic and all seemed OK.
All the example HTMLs seemed to work fine on my Windows7-32bit/Firefox20.
Compilation works OK. The editor seems to work OK too.

= = = = = = = = = = = = =
Minor Questions (Trying to port my demo to BB)

Q1
Is there a Draw_Filled_Triangle/Polygon function?

Q2
Line 1: var MyVar as number
Line 2: MyVar = 1 + MyVar/12
Line 3: MyVar = 1 + (MyVar/12)  ==> Compilation error: Expected: Value - value but got: ( (ascii 40) on Line: 3

Q3
var MyStr1 as string
MyStr1 = Str$(11) ==> Compilation error: String expression error Str$

Q4
var jjj as number
var R_Width as number
var moiRects_PosXmax[1000] as array
var moiRects_PosXmin[1000] as array
jjj=1
moiRects_PosXmax[1]=1
moiRects_PosXmin[1]=1
R_Width   =  moiRects_PosXmax[jjj]
R_Width   =  R_Width - moiRects_PosXmin[jjj]
R_Width   =  moiRects_PosXmax[jjj] - moiRects_PosXmin[jjj] ==> Compilation error: Expected: Match - = but got:

Title: Re: Announcing BrowserBasic
Post by: cvirus on June 15, 2013, 05:05:23 PM
Fantastic, Love it.   ;D
Title: Re: Announcing BrowserBasic
Post by: Guilect on June 15, 2013, 08:39:54 PM
@cvirus - thanks

@ steveOW
Yah, it is usually best to not try to run something in the zip file.  Best to unpack it.

A1 - there is no draw triangle
A2 - BB does not expect 'extra' parentheses.  I may have to change that in the parser, but for now just omit them.
A3 - will look in to it.
A4 - bug in compiler, will look in to it.

I knew something would show up as soon as someone else tried it.  :)
Title: Re: Announcing BrowserBasic
Post by: Cybermonkey on June 15, 2013, 08:56:09 PM
Really impressive. I hope I'll find some time this weekend to code a little example.
Keep up that great work!
Title: Re: Announcing BrowserBasic
Post by: Guilect on June 15, 2013, 09:07:52 PM
@steveOW
Fixed issue Q4 from above.

Will look into the Str$ thing.

Will post update later.
Title: Re: Announcing BrowserBasic
Post by: Guilect on June 15, 2013, 09:38:16 PM
Also fixed Str$.

new download can be found at the same link:

BrowserBasic (http://www.pewtersoftware.com/browserbasic/browserbasic.zip)
Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 15, 2013, 10:20:28 PM
A quick hack of my demo code to BrowserBasic.
Doesnt do justice to BB.
But shows how easy it is to knock something up in BB. :)

(Unpack zip to local disk and click on the .HTML file)

Title: Re: Announcing BrowserBasic
Post by: Guilect on June 15, 2013, 10:33:03 PM
Hey steveOW,

Thanks for trying BB and thanks for making the demo.

I can look into a JS filled triangle routine for ya.
Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 15, 2013, 10:58:38 PM
Hi Guilect,

I think the BB framework is superb.
It deserves a much finer demo than that one.

Filled Polygons would be nice. 
I have coded triangle fills in the past but its a bit much to expect of a casual programmer (IMO).

One point of interest - for the demo I had to use <Else If> in place of <Elseif>
The former requires an extra Endif.  I prefer the latter (its what I use in VB6).
Could your compiler stretch to handle both forms?

Anyway, thanks for a great product.
SteveOW.

Title: Re: Announcing BrowserBasic
Post by: ScriptBasic on June 16, 2013, 12:11:39 AM
The Cat & Mouse demo was cool.
Title: Re: Announcing BrowserBasic
Post by: Aurel on June 16, 2013, 10:31:58 AM
I have tried with Opera and work so..so...not very fast but work ok 8)
Title: Re: Announcing BrowserBasic
Post by: Cybermonkey on June 16, 2013, 10:56:17 AM
For a maximum speed one should use Chrome. It's no secret that Chrome (or Chromium on Linux) has at the moment the fastest Javascript/HTML5 engine.
Title: Re: Announcing BrowserBasic
Post by: Guilect on June 16, 2013, 12:58:24 PM
for steveOW I have added 'elseif'.
Will try to add a few more things (e.g. filledpoly) and have a new release next weekend.
Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 16, 2013, 03:49:01 PM
Hi Guilect,

can I squeeze another bugfix request in please...
(Edit: *** This bug is from using original installation, so may already be fixed in second version ***)

var AA[1000] as array
var BB[1000] as array
var kkk as number
kkk=1
AA[kkk] = 1 + BB[kkk]  '...compiles OK

'...Compiler Errors with all these lines:-
AA[kkk] += 1              '...Expected: Match - = but got: + ...Fair enough += is not part of many BASIC's
AA[kkk] = BB[kkk] + 1  '...Expected: Get Name - Name but got: 0  ... Maybe a parsing problem?      
AA[kkk] = AA[kkk] + 1  '...Expected: Get Name - Name but got: 0

'=========================================

'...Also do you have any plans regarding buttons?
In Browzic prototype I have used html buttons but it might be nice and I guess fairly easy to make buttons in the canvas.
maybe you have some GUI library in mind?

'=========================================
'...btw for javascript triangles I have been using,
(here with 'canvas01_2Dctx' as the canvas context object)
//...Plot  Red Triangle
 canvas01_2Dctx.beginPath(); 
 canvas01_2Dctx.lineTo (moiRects_PosXmin[jjj], moiRects_PosYmin[jjj]);   
 canvas01_2Dctx.lineTo (moiRects_PosXmax[jjj], moiRects_PosYmin[jjj]);       
 canvas01_2Dctx.lineTo (moiRects_PosXmax[jjj], moiRects_PosYmax[jjj]);
 canvas01_2Dctx.stroke ();
 canvas01_2Dctx.closePath ();
 canvas01_2Dctx.fillStyle = "red";
 canvas01_2Dctx.fill(); 
Presumably same can be used for any (simple) polygon fill.

====================
Cheers,
SteveOW.
Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 16, 2013, 11:40:51 PM
Hi again Guilect,

I tried to link another JS library ( by putting a .js file into the js folder) and call its functions from within BrowserBasic source code.

Compiler gives: Function Call - Undeclared function: SOW_MyFunctionOne

Is there any way (present, planned or considered) to enable such extension of libraries?

cheers, SteveOW.
Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 17, 2013, 10:38:01 AM
Hi again Guilect,

(Sorry to keep pestering you!, no pressure intended  ;))

Ive made a slightly updated version of my BrowserBasic demo.
It runs fine in private from my local disk.
I used "Save as WebPage, Complete" from my browser(Firefox) which produces a Fred.html file and a Fred_files folder (as I'm sure you know).
Ive uploaded  Fred.html and Fred_Files to my scrap of Public webspace.
(Hope this is OK with you, if not just say and I'll drop it)
http://www.zen226082.zen.co.uk/BB_PO_v03_03.html

But Firefox/Save-As-WebPage function doesnt include the linked Sound files in the Fred_Files folder, for any sound-links written in javascript.
(It does alright for links written in html).
Obvious short-term solution is to manually edit the fred.html code and manually copy the relevant files into the Fred_files folder.
But this is a bit kludgy for a novice user (imo).
Do you have any thoughts about smoothing out this "Publication" process?

cheers, SteveOW.
Title: Re: Announcing BrowserBasic
Post by: Guilect on June 17, 2013, 11:56:09 AM
@steveOW,

I will check into the error you posted.

I had no plans for buttons.  I just imagined making fullscreen games.
Much like using DirectX, OpenGL, or SDL.
At some point I can look into a GUI library.
But first to squash the bugs before adding much more.

Thanks for the triangle/polygon code.
Should be easy enough to implement.

There is not presently a way to hook in other libraries.
The idea was to have the compiler know exactly what functions were allowed.
That way if a user mistyped a keyword or function  or the the parser came across an unknown command, it could through an error.
I thought this would be easier for a beginner.
This way errors would be generated at design time and caught rather than
no errors and then  trying to figure out way the javascript code was not running.
It is not as easy to debug in js.
If the user can just add 'unknown commands' that the parser should ignore then I can see many more programs not working and the user not knowing why.
I can look into some sort of 'declare external' type of command in which the parser would get passed the keywords from the external library.
Once most of the bugs are squashed I had intended to look into adding other libraries to BrowserBasic, e.g. Box2DWeb.js.

Thanks for uploading the updated demo.
Any example code I provide is to be considered open source, do with it what you want.
And obviously, hopefully, anything that you create and store on your webspace is yours to do with it as you want.

I had never considered using the 'save as complete website' as a way to bundle a project.
I had always thought that the html file and any needed folders would be uploaded, using FTP for example.  If anyone knows an easier way, please let us know.
Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 17, 2013, 01:23:12 PM
@Guilect,

Thanks v.much. :)
I completely understand you want to focus on final polishing of BrowserBasic V1 into a robust, rich easy-to-use product.
I dont want to get in the way of that at all.
And I appreciate that you sure dont want to get tangled up in debugging other people's middleware libraries.
The more control you keep on scope the more stable and successful the product.

I have a vision (for Browzic) which is slightly different (from BB V1) and mainly vaporware at present.
It could be that if BrowserBasic delivers a lot of what I need in short-term (and it is certainly looking that way) then I could simply park the Browzic endeavour.
I guess I am a bit conflicted about which route to go and trying to peer down the road a bit.
Should I stay on the Browzic jallopy or should  I park it up and hitch a ride downtown on the gleaming BrowserBasic bus?
Your recent comments are useful to me in this respect.

Anyway, my angst is not your concern, happy bug squashing!

Cheers, SteveOW.




Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 17, 2013, 09:03:16 PM
@Guilect
Another little bug for squashing (still using compiler v0.2)

   var Bnames[100] as array
   var Bnom as string
   
   Bnames[1] ="Fred"
   msgbox("Button name:" + Bnames[1])     '...OK
   
   Bnom = Bnames[1]         ' ==> String expression error Bnames

cheers, SteveOW.
Title: Re: Announcing BrowserBasic
Post by: Guilect on June 17, 2013, 11:39:14 PM
@steveOW
The 2 bugs you listed have been fixed.
Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 17, 2013, 11:39:38 PM
Added some buttons to BrowserBasic demo...

     http://www.zen226082.zen.co.uk/BB_PO_v03_03.html
Title: Re: Announcing BrowserBasic
Post by: Guilect on June 17, 2013, 11:42:44 PM
Simple, yet effective graphical buttons.
 :D
Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 18, 2013, 12:16:23 PM
@Guilect

(now using BrowserBasic Compiler v0.3)
(work-around-able) bug with string addition

   var usr_string as string

   var mxs as string
   var mys as string

      mxs=Str$(MouseX())
      mys=Str$(MouseY())
   
      usr_string = "Left mouse button pressed at " + mxs
      usr_string = usr_string +  ","
      usr_string = usr_string + mys

      
usr_string = "Left mouse button pressed at " + mxs + "," + mys '... ==> ERROR Expected: Get Name - Name but got: 0
Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 18, 2013, 08:32:33 PM
@Guilect,

 Is there any present/planned way to change Printed Text Size?
 
 Is there any plan for a simple text entry field e.g. for high scorers to type in their name?
   (suppose I could capture keystrokes and echo them...but...er...lazy  ;)).

 Re external non-core libraries...
 into the txt file read by BrowserBasic I can
     put dummy function definitions e.g. function Janet_release_chickens(fox as number)
 and then in the output html file I can
      insert my own library link   e.g.<script src="Janet_Lib.js"></script>
      and delete the relevant (translated javascript) dummy code .
  Not elegant, but do-able.
  So external function handling in BrowserBasic would be nice-to-have but not critical for me.
  However it might server to attract game (and other) developers who want to plug in easily to awesome libraries like ThreeJS.


 Re app/project bundling
 I like the idea of simple app portability, forking, evolution, memes (like the Scratch guys)
 Ideally for me an entire app would be contained in a single html (possibly accessing cloud-based libraries).
 Failing that having Fred.html and Fred_Files gives a neat easy-to-use standard format bundle.
 It is probably not too difficult to manually put together or write a script
 to examine the BrowserBasic Fred.html output
 and then copy relevant assets to a Fred_Files folder
 and edit the links in the Fred.html.
 For me such ability would be a nice-to-have option in BrowserBasic, but not critical.
 
 Ability to record games sequences, animation frame sequences to audio-video file (avi, mp4 etc) and upload to youtube.
 Now that would be ..........Sorry I am rambling!

cheers, SteveOW.
 
Title: Re: Announcing BrowserBasic
Post by: Guilect on June 18, 2013, 09:38:46 PM
@steveOW

I have fixed the bug you reported.
It will be included in the next release.

But for now another work around is to not put spaces after the +.

So instead of :
usr_string = "Left mouse button pressed at " + mxs + "," + mys
do:
usr_string = "Left mouse button pressed at "+mxs+","+mys

For now to size text, the method is to use the scale function.
See ex_translate.txt
   Scale( 4,4)   ' make things 4 times bigger
   Print("After scale", 20, 20)

I will look into a setfont function.

No plans for text field entry, so far.
I know it is not exactly what you want but I will add a vb-like inputbox for now.

Having a way to add external functions would be good.
It is on the road map but, a bit down the road still.

Project bundling :  What are the other guys doing? (Stencyl, Construct 2, GameMaker HTML5, etc.)
Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 19, 2013, 03:58:29 PM
@Guilect

I have fixed the bug you reported. 
For now another work around is to not put spaces after the +.
Great/Fine.

Quote
For now to size text, the method is to use the scale function.
I will look into a setfont function.
Great/Nice.

Quote
I will add a vb-like inputbox for now
Fine.

Quote
No plans for text field entry, so far
Not completely sure what I want for text entry long-term.

[ramble]
In Browzic I was thinking to use it as a way for user to submit an entire multi-line textfile (by copy & paste) to a running Browzic app.
Rationale = a way to get around the sandbox restrictions on browser programs reading local disk files.  There may be more elegant ways.
Ive seen a couple of html5 apps where user can drag a local image file into a running javascript app which reads and processes the image data. Tres cool 8) But I'm not expecting that of BrowserBasic anytime soon.  Am also interested in user-selectable/copyable text output stream for similar reason.
[/ramble]

Quote
Having a way to add external functions would be good.
It is on the road map but, a bit down the road still.
Fine.

Quote
Project bundling :  What are the other guys doing? (Stencyl, Construct 2, GameMaker HTML5, etc.)
Way out of my current knowledge at present.  :-[
 
[ramble]
I guess I'm looking thru  "free and open-source software" lenses.
From a quick look at wikipedia those guys you mention all seem to have a commercial angle.  Maybe you do too and good luck to you if you do.  If I thought I could monetize Browzic I might have a go myself.  Anyway the point I'm getting at is that commercial considerations will not always spawn the most elegant technical solution for delivery and distribution.  For me right now this stuff is mostly just good-fun playtime and I'm interested in the idea of highly-portable/deittable apps akin to highly-portable and edittable jpg's png's wav's, mp3's and mp4's etc.  Of course if someone offered me a million bucks for Browzic ( ::) ha ha ha) I would probably suddenly become VERY interested in digital rights management.  But for now I probably want to steer clear of that potential messiness.
[/ramble].
Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 21, 2013, 06:29:03 AM
@Guilect (BrowserBasic)
I want to store a color definition as a single value (number or string)
and then recall that value and apply it ...using, for example, setColor(r,g,b).
But how?   ???

From BrowserBasic.pdf:-
   rgb  returns a value from three color inputs.  example:  rgb(255,0,255)

 TEST 1
var MyColorStr as string
MyColorStr=rgb(255,0,255) '... ==> String expression error rgb

 TEST 2
var MyColorNum as number
MyColorNum=rgb(255,0,255)
Msgbox("MyColorNum is " + MyColorNum )    '  ==> MyColorNum is rgb(255,0,255)
huh?

cheers, SteveOW
Title: Re: Announcing BrowserBasic
Post by: Guilect on June 21, 2013, 11:25:19 AM
@steveOW

That command's response is a left over from when I was using the codef library.
There are no other left overs.
I will update it to return a number in the next release.
If I have the time the release might be later today.
Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 21, 2013, 12:08:46 PM
@Guilect

  Good news. :)

  One last minute query:-
      in BrowserBasic can a user defined function return a string value to the caller?

cheers, SteveOW.
Title: Re: Announcing BrowserBasic
Post by: Guilect on June 22, 2013, 12:00:13 AM
@ steveOW

In the release below I had no issues returning a string from a user function.
Give it a go.

v0.4
added StrokePolygon and FillPolygon.
some bug fixes.
added elseif to if then else endif.
added foreach - next.
added step to for-next loop.
added inputbox.
added setfont and getfont commands
fixed RGB command

BrowserBasic (http://www.pewtersoftware.com/browserbasic/browserbasic.zip)
Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 22, 2013, 11:12:25 PM
@Guilect
Looking forward to getting in to v0.4 shortly.

Here an update of rough example made with v0.3.
http://www.zen226082.zen.co.uk/BB_v03_POND_v04.html

cheers, SteveOW.
Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 23, 2013, 08:47:49 AM
@Guilect
Strange bug when I try to compile attached TXT with BB v0.4.
(Same TXT compiles OK with BB v0.3)
I cant isolate it to a particular piece of code. ???
Title: Re: Announcing BrowserBasic
Post by: Guilect on June 23, 2013, 12:11:59 PM
Sorry,

Before, most of the compile mistakes were due to the parser not removing enough whitespace, so then I made it remove pretty much all whitespace.  Well this caused another issue IF the BB program had a call to a user function AND used an inline comment.

This issue should be okay now.
There is a new release, v0.41.
BrowserBasic (http://www.pewtersoftware.com/browserbasic/browserbasic.zip)
I hope by a couple more releases the base functionality will be good and from there future releases will be for adding functionality and capabilities.

SteveOW I appreciate you trying BB.
I am interested in seeing what you can do with it.

Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 23, 2013, 04:42:49 PM
@Guilect,

Thanks.
My app runs fine on BrowserBasic v0.41. ;D

White space and comments... yeah Ive been having "fun" with that stuff in writing Browzic. ::)

cheers, SteveOW.


Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 27, 2013, 02:50:30 AM
@Guilect

Having fun with v.0.41 of Browserbasic. :)
Minor bugs:-
1. FillPolygon draws outline (stroke).
2. sgn(1) --> 0

Restrictions:-
3. elseif ... only 1 "elseif" allowed per "if...endif" structure, this is probably by design, but (if easy to do) would be very useful to have unlimited elseif's
4. BB does not permit superfluous brackets in math expressions but resulting "stark" code can be hard to read/decipher.
cheers, SteveOW.
Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 27, 2013, 03:52:28 AM
POND v05

New functions:- Pull, Push, Triangles, Faster, Slower, Input, Output, Frog
Not a game, just a Plaything and a Demo of BrowserBasic (by Guilect)

http://www.zen226082.zen.co.uk/POND.html
- just click and it will run in your browser
(if you have html5/canvas capable browser like Firefox, Chrome,Safari)
Title: Re: Announcing BrowserBasic
Post by: Guilect on June 27, 2013, 03:31:39 PM
Only just realized that the frog goes after the small triangles and sticks its tongue out to eat them. ;D

Also, pressing and holding the left mouse button while moving it over the objects is the way to go.  Originally, I was just trying to individually click on an object.

Nice demo.  Is this going to migrate into a pond with a frog eating stuff game?

Quote
FillPolygon draws outline (stroke).
Have not seen this.  Is there a minimum code that produces this?

Quote
sgn(1) --> 0
Fixed. Will be in next release.
For now you can edit bb_core.js and replace :
Sgn(e){if(e==0){return 0}else{if(e<0){return-1}else{return 0}}}
with
Sgn(e){if(e==0){return 0}else{if(e<0){return-1}else{return 1}}}

Quote
unlimited elseif's
superfluous brackets
will look into

Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 27, 2013, 05:20:51 PM
@Guilect
Is this going to migrate into a pond with a frog eating stuff game?
Dont know where it is heading gamewise.  One motive is modelling animal behavior systems, learning and evolution. Another influence is playing Lego Star Wars on Wii with my son where rules are discovered thru playing rather than from a rule book, quite exasperating at first but good practice for real life I think.

Quote
FillPolygon draws outline (stroke)......Have not seen this.  Is there a minimum code that produces this?
Voila...gives first triangle with red fill and green edge, second triangle  with just green edge.
Code: [Select]
var Poly1[7] as array
var Poly2[7] as array
'--------------------------------------------
Function OnLoad()
setBackgroundColor(0,0,0)
Poly1[0] =  100
Poly1[1] =  100
Poly1[2] =  10
Poly1[3] =  310
Poly1[4] =  200
Poly1[5] =  310
Poly1[6] =  100
Poly1[7] =  100

Poly2[0] =  500
Poly2[1] =  100
Poly2[2] =  410
Poly2[3] =  310
Poly2[4] =  600
Poly2[5] =  310
Poly2[6] =  500
Poly2[7] =  100
EndFunction
'--------------------------------------------
Function OnDraw()
setColor(255,0,0)
FillPolygon(Poly1) '...Red 
setcolor(0,255,0)  '...Green
StrokePolygon(Poly2)
EndFunction

Quote
sgn(1) --> 0  ...Fixed. Will be in next release.

Fine.

Quote
unlimited elseif's superfluous brackets.....will look into
  Fine.

P.S. Just reread an earlier post from you re: "hopeful ownership"...sudden thought should I be citing credits /displaying licenses on my Demo/Webspace?.  Not sure of the etiquette on this kind of stuff.  Maybe helpful to have a small section in the Browserbasic Manual telling future app developers/hosters what to do when hosting apps in public?
cheers, SteveOW.
Title: Re: Announcing BrowserBasic
Post by: Guilect on June 27, 2013, 08:58:53 PM
For next release:
added ability to have multiple elseif statements
added ability to use Parentheses in mathematical statements
   ex: z = ((x + y) * (4/2)) - (11 * 1)
        and in logical expressions
   ex: If (foo = 3) OR (bar = "good") then

@SteveOW,
Regarding the FillPoly/StrokePoly commands; ah now I see.
This is an issue in the js library.  I will investigate.
Title: Re: Announcing BrowserBasic
Post by: Guilect on June 27, 2013, 11:29:39 PM
Quote
citing credits /displaying licenses
No need to give credits.
It would be nice to get more users of BB and any 'advertising' of it would help.
Anything you make with BB is yours to do with as you see fit.
Any sample code I put out there is up for grabs.
No need to include a copy of the license with any of your work,
because there is none.  I looked at GPL, BSD, MIT, etc.
None of them seemed to apply to my particular case.

I will try to remember to put something in the help file expressing these feelings.
Title: Re: Announcing BrowserBasic
Post by: Cybermonkey on June 28, 2013, 07:24:13 AM
Will there be a website for BB eventually?
Title: Re: Announcing BrowserBasic
Post by: Guilect on June 28, 2013, 01:45:06 PM
Hi Cybermonkey,

Sorry if I am taking up too much of this board.
Yes, eventually I hope to find the time to put a website up for it.
Title: Re: Announcing BrowserBasic
Post by: Cybermonkey on June 28, 2013, 03:03:19 PM
Hi Cybermonkey,

Sorry if I am taking up too much of this board.
Yes, eventually I hope to find the time to put a website up for it.
Oh, no that's no problem at all. It's good to see some nice talk here. But I thought about other who are not members here. I remember Brutus2d having a nice web site.
And the thread seems not about BrowserBasic? ;D
If you or any other wish I can add a board here for BrowserBasic.
Title: Re: Announcing BrowserBasic
Post by: Guilect on June 28, 2013, 03:19:04 PM
Hi Cybermonkey,

I would love to have BrowserBasic join the likes of EGSL and NaaLaa in having a board here.
Similar to NaaLaa, BrowserBasic will have its own website that can direct people to Retrogamecoding.org for the forum.  This will help drive people from BrowserBasic to the other languages here and vice versa.  I think it would be good for everyone.

Regards,
Guilect
Title: Re: Announcing BrowserBasic
Post by: SteveOW on June 28, 2013, 04:05:49 PM
If you or any other wish I can add a board here for BrowserBasic.

I think it would be good for everyone.

Gets my vote. :)

@Guilect
Suggest BB could also benefit from a logo
Title: Re: Announcing BrowserBasic
Post by: Cybermonkey on June 28, 2013, 04:09:25 PM
Ok, already done!  ;) As you may have seen Guilect is also a moderator of his board. Have a lot of fun here.
Title: Re: Announcing BrowserBasic
Post by: bolbo on June 29, 2013, 12:49:52 PM
Keep it up guys. This forum is a gold mine. I'm very excited with Naalaa and BB so I'll try to make some demos with them over this summer. Not to mention EGSL, which I haven't taken a look at yet.