123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|452|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> JSE -> JSE - Jay's Scripting Engine

Page : 1 Prev 2 3 Next 4 5 6 7 8 9 10 11 12 13 14
Fri, 09 Apr 2021, 08:06
Jayenkai


Good grief, the RPN's doing my head in!!!

I'm about 10% of the way done getting it working.
BODMAS is completely knackered, and strings aren't working within the brackets that the RPN code adds.
It's also strapping multitudes of brackets around things that already have brackets, thus confusing itself even further.
Ugh...

I might have to scrap all of the converting I've done, so far, and Redo-From-Start..

-=-=-
''Load, Next List!''
Sat, 10 Apr 2021, 16:09
Jayenkai
Today's insanity..
Trying to draw a Sprite, then realising all the size code was off, and having to rewrite tons of stuff to fix it.
The font still isn't working right.
Bah, humbug!!

But..
A Sprite has been drawn.




The image (Symbol!) is the 32x32 pixel Red Cross.
Currently 32x32 is the largest size available, mostly because the symbol commands end up in the code, and a limit of 90 such symbols due to spritesheet limitations..
.. yeah, I know.. you'll cope.
Fwiw, all the games on Browsercade use 32x32 sprites, and they all look. ... ... ok..!

The next step is to write an art tool to generate said symbol code..

Oh boy..

Oh yeah, and note that the Sprite exists in two different colours. There are 10 "inks" available.
Also, the AntiAlias filter has been toggled halfway, so you can see the difference that makes.



(No Symbol code, yet.. The current Symbol is hardcoded!)

-=-=-
''Load, Next List!''
Sun, 11 Apr 2021, 02:13
Pakz
I was wondering when we could see loops with while do?

edit:Impressive how you dive into this stuff!
Sun, 11 Apr 2021, 03:56
Jayenkai
Most of that stuff needs variables.
I ain't tackled those, yet!!!
I have a vague idea how to get them working, but arrays might be tricky.

-=-=-
''Load, Next List!''
Sun, 11 Apr 2021, 08:21
Jayenkai
It's all getting a little confusing..
I'm tempted to rip out a fuckton of code and redo-from-start..

Eeek!

-=-=-
''Load, Next List!''
Sun, 11 Apr 2021, 10:34
Jayenkai
Better.. Worse.. Both..!?
I dunno..




-=-=-
''Load, Next List!''
Tue, 13 Apr 2021, 06:18
Jayenkai
Updated the command list, via the method of going through the code and checking I'd added all the commands into the command list.

.. Which I hadn't, for quite a number of the commands!
Oops!!

You can View the command list, here.

You'll be happy to know that all of the examples currently work in the engine.
Hurray!!

-=-=-
''Load, Next List!''
Tue, 13 Apr 2021, 07:21
Jayenkai

View on YouTube
As with all things, the main "Ready to go" will be when this is working.

Code Within
> Reveal 🔎

Drawn
Ball = Oval
Floor = Rectangles
Spike = Symbol/Sprite/Image

Todo.
1. Variables
2. Symbols
3. Sounds
4. Input

.. When I write it like that, it's not too much more!!
Unfortunately, when I write it lengthier, the horrors appear.

1. I have to handle variables AND arrays. I'm hoping Javascript's "key" thing works for Variables, but god only knows how I'm going to do Arrays.
2. I have to code a whole sodding art package for this, as well as figuring out how to compress said art symbols into tiny amounts of text to fit inside the code.
3. I'm probably just going to make a library of sfx, and let you choose from those. I can't think of a good alternative, right now!
4. Between Browsercade and Shoebox, I've worked out a ton of input methods. Copy+pasting all those, and making them accessible to the Script Engine is the basic plan. Mouse, Touch, Keyboard, Gamepad and more, all automagically'ish supported. .. Doesn't sound too hard, right!?!?

-=-=-
''Load, Next List!''
Thu, 15 Apr 2021, 09:13
Jayenkai


Basic sprite tool, 50% complete.
Still need a sprite selection thing, and some actual tools other than Draw might be handy, but the tool is loading and saving the sprites using the Symbol command within the code.



Apparently Platdude's nickname is Bob Bob Bob, Wow Wow Wow!

-=-=-
''Load, Next List!''
Fri, 16 Apr 2021, 07:21
Jayenkai
Which idiot reused the Symbol Canvas to draw the Symbol Editor!?!
<-- That idiot!
Had to rewrite a whole chunk to get the editor to draw on the standard canvas, instead.



With that finally done, I added the "List of symbols you can edit" on the bottom right.

You can select a Symbol, edit a symbol, save.

On the bottom left is a list of the currently selected symbol at 1x scale.
Anything you draw will be as you drew it, when you draw with ink 0.

Inks 1,2,3,4,5,6 and 7 are recolourings of your sprite, with rotated hue.
Ink 8 is Greyscale.
Ink 9 is Inverted Greyscale.

.. Should be plenty..!

(Also, please ignore that odd "Display a Menu" option on the bottom left.. That happens when I tap the keyboard combination to take a screenshot!!)

I now need to draw some icons for the rest of the functionality.

-=-=-
''Load, Next List!''
Fri, 16 Apr 2021, 17:38
Jayenkai

View on YouTube

Mmmm!
Sat, 17 Apr 2021, 07:43
Jayenkai




Getting there, slowly but surely..
The damn <= and =< and == and != stuff is all broken again, because they use two characters. Dangit..
I'm sure I had those working, the other day.
Grrr...

-=-=-
''Load, Next List!''
Sat, 24 Apr 2021, 09:07
Jayenkai
Minor tweak : Got <= and co working again, today.
I've been scanning through the parser, step by step, and I *think* I understand now where the biggest issue is.
I originally started with Line/Stack/Parameter values, but at some point Parameter morphed into "Bit of Parameter"..

So, say you had.
Text 100,200,Rand(300,400)+500
What would happen is..
Line : 1
Stack 0 : Parameter 0 = 100
Stack 0 : Parameter 1 = 200
Stack 1 : Parameter 0 = 300
Stack 1 : Parameter 1 = 400
Stack 0 : Parameter 2 = Rand of 1
Stack 0 : Parameter 3 = 500
Stack 0 : Parameter 4 = Work out 3 + 2, place back into slot .. 0.. !
Stack 0 : Text of 0

It's getting itself confused over what is and isn't parameters and stacks and things like that.

I think it might be a good time to strip out a whole chunk and rewrite it.

So, today I did just that, and chopped out most of the parser.
The lexar is still working, so it's split everything up into words, and it's scanning through the words shuffling maths to the ends and whatnot.
Next job is to rewrite the parser, probably adding in extra info per bit, so that it hopefully can understand it all a little better.
I'll have to then rewrite a chunk of the interpreter, too.

Gawd, the amount of work going into this is insane.

Good thing I didn't set myself a deadline, huh!!

-=-=-
''Load, Next List!''
Tue, 27 Apr 2021, 03:40
Jayenkai


It's getting better.. in places.
.. It's also getting worse in other places!
Go figure!!



-=-=-
''Load, Next List!''
Tue, 27 Apr 2021, 06:05
cyangames
It's great to see how this language is coming along though, you can do it Jay!

-=-=-
Web / Game Dev, occasionally finishes off coding games also!
Tue, 27 Apr 2021, 10:05
rockford
Are you planning/hoping to make this a game programming language or is it just for fun?
Tue, 27 Apr 2021, 10:18
Jayenkai
I don't think you should expect to make decent quality games with it. It can be a little bit battery draining, even on an M1 Mac!!!! Full framerates in a browser, with parsing and interpreting and "doing".. it's not exactly super-speed.
Optimisation will help, but ..

*shrugs*

I mean, you could certainly code a game in it, (or.. should be able to!) and I'm aiming to get SpikeDislike up and running as a test, so we'll see how well I can get that going. (Keep in mind how basic SpikeDislike is!)

If it's "good enough", I'm thinking of adding a simple "QuickMenu()" (or something) sort of command to do what my framework's menu system does. But that's far ahead in the future.
Gotta get it working properly, first!!!

-=-=-
''Load, Next List!''
Tue, 27 Apr 2021, 15:17
Jayenkai
Ack...
One thing I DEFINITELY need to add is an Export button. Last night's MacOS update has flushed out all of Safari's LocalStorage, so all my test scripts disappeared.
Luckily I do most of my testing in Firefox (because it updates the .js, instead of caching it all the bloomin' time), but..
Yeah, that's annoying..

Grrr..

OK, after all of today's work, I'm now about 80% convinced that the syntax is working as it oughta.
ALL of my test scripts, so far, appear to be working, with one single little quirk..

... BODMAS.. I still haven't done the BODMAS..
Oh, and there are no variables, so Until, For, If, While, etc, are all currently missing.





The First Test Edition : Command List
See how you get on.
And if you find anything, at all, out of place.. Let me know.

Don't forget to manually backup your code (Copy+paste it somewhere!) just in case. But, for the most part, it *should* be relatively safe unless you update or something!!

-=-=-
''Load, Next List!''
Wed, 28 Apr 2021, 07:16
Jayenkai


Added basic date and time functionality. Hurray!

-=-=-
''Load, Next List!''
Thu, 29 Apr 2021, 09:15
Jayenkai


Ooooooh Yeahhhhh...

Today's additions.
1. Basic Variable functionality.
You can't set variables mid-line. Only bog standard functionality is currently working.
Like how you could do..
Print "This sets a value"+(a=16)
in Blitz..
Not gonna happen, here!! Maybe a future tweak. Right now I'm just honestly not sure how to achieve that.

2. Mouse Input
MouseX and Y work.
MouseX(),MouseY() = co-ordinates based on the scaling method with 0,0 being the top left of the "visible" screen, and ScreenWidth(),ScreenHeight() being the bottom right.
MouseX(1),MouseY(1) = co-ordinates based on the browser, so 0,0 is the top left of the browser's viewport and ... Whatever the bottom right is!!

MouseDown() lets you know if the left mouse button has been pressed.
I'm looking into universal ways of getting right mouse button to work, but .. it's not looking good..

MouseX,Y and MouseDown also work for the first finger on a touchscreen.
There's some crazy-ass code in the touch functionality, leftover from Shoebox, that I need to scrap and rewrite to get multi-touch working properly.

The MouseX/Y values currently leap to -1600 (/scaled) when the mouse leaves the browser, or the finger leaves the touchscreen. I'm not 100% sure on the best way to cope with that.
Thoughts and suggestions are welcome.

-=-=-
''Load, Next List!''
Fri, 30 Apr 2021, 14:45
Jayenkai


Basic Gamepad support added, alongside tests for Until and If.
And/Or/Not/etc aren't working yet, but the basic <|>|==|!= comparison stuff is at least functional.
I *think* I'm aiming to get the engine to swap out For/Next loops for Repeat/Until loops, since those seem to at least be functional.
I need to tie together the tops and bottoms of loops a little better, though. Right now, the way the If is working, is it switches on Skip mode, and scans through lines of code until it finds its nested endif.
It'd be MUCH better optimised if I did that prior to running, and gave the if a line number to jump to.

That functionality would also be handy for While/Wend, which is why it's currently missing.

But.. Yeah, it's coming together..

-=-=-
''Load, Next List!''
Sat, 01 May 2021, 02:02
Dan
Is there a difference between = and == ?
Sat, 01 May 2021, 02:35
Jayenkai
Currently yes. Following most none-basic language syntax, = is "set value to" whereas == is "is it equal to?"
The single = only really works if it's the second element at the start of a line, though. (Ie, Variablename=...) It's kinda glitchy like that, right now. I need to find a neater way of analysing what the user wants, but without ending up second guessing them and breaking their own logic.

-=-=-
''Load, Next List!''
Sat, 01 May 2021, 05:03
Jayenkai


Gamepad code, so far..
Currently working on getting onscreen Touchscreen controls working, but .. ugh.. I so much hate onscreen touchscreen controls!!!

|update| Updated to now account for Touch Controls |update|

The touch controls only currently has a thumbstick on the left (with DPad values for digital input), and an A and B button.
I might add more buttons in future, but .. gawd, I hate onscreen controls!!

|update| Updated again! |update|

The FPS display now looks a bit more FPS'y instead of the haphazard "wtf are these numbers" display that it used to be!

-=-=-
''Load, Next List!''
Sun, 02 May 2021, 08:26
Jayenkai

You can Play it in JSE here

A simple Dice Roller. Makes use of Symbol/sprites, repeat/forever, repeat/until, If's, and the recently added "AND" command. Ooooooh!

.. Unfortunately, the syntax isn't quite perfect, so you need to bracket the hell out of anything that's nearby an AND. (Again, I think this is probably a BODMAS issue..)

Also, for some really odd reason, if you switch out an "and" for an "&&", it seems to completely knacker the code. .. Even though the code switches out an "and" for an "&&" itself!!!
Baffling issues..

-=-=-
''Load, Next List!''
Mon, 03 May 2021, 07:59
Jayenkai
Can it play Pong yet?!


View on YouTube

Sure it can!

Mouse control for player one.
Gamepad or keys for player two.
Alternatively (by default) Player two is AI controlled.
.. AI controlled.!?!?! In a script!?! That I've written!!?!?

Sure does feel kinda empty without sound though, huh...?
Hmmm..

The code is more or less "standard", but I've had to do a few quirky things to get the ifs working properly.



You can Play it here. Simply copy the code, shove it in the box, then click run!

-=-=-
''Load, Next List!''
Page : 1 Prev 2 3 Next 4 5 6 7 8 9 10 11 12 13 14