Thursday 23 April 2020

Connectivity

No idea who AZ Delivery are
Okay, so I've been tinkering around with connectivity today (and tweaked odd bits, the main thing is adding RANDOMISE). Been busy the last couple of days (annual follow up test in hospital).

So there are two basic issues. Getting stuff in and getting stuff out. Out is system specific ; ESP32 stores files in SPIFFS, in unused Flash memory. So I need a way of getting that out. I think I'll just dump the lot to the serial port as a debug option for the time being.

Not that I'm actually doing any real development on the actual machine, it's all done cross platform.

The other thing is downloading stuff. I want to do this over Wifi, I mean the ESP32 (pictures) has Wifi so why not (the problem with doing it the other way is I don't really want to use Server. There's a thing with FABGL where it really doesn't get on with SPIFFS. It used to randomly bork ; it's something to do with the interrupts, you have to turn them off to access SPIFFS)

So having waded through mountains of C of varying incomprehensibility, I've now got it downloading an arbitrary file. So next thing is to patch it into the ESP32 version. The emulator version is easy (for now), there'll just be two directories, one is the web directory, the other represents local storage. If I ever get around to doing a Pi version (I know it works) I'll have to figure that out.

Monday 20 April 2020

Game #9 : Asteroids

Asteroids is now working (no flying saucer).

As you can see from the demo here, the collision detection isn't great. I really wanted to avoid square root calculations and can't do pixel collision so its a simple box, and because of the shapes it is fairly generous with the collision detection.

Note, running the emscripten version does occasionally require a reload ignoring cache (Ctrl+Shift+R on Firefox) . I've just had it not work on me , nothing worked apparently, but reloading it fixed it.

Game # 9: Asteroids

Didn't do anything yesterday, but a bit more coding this morning has lots of asteroids flying round the screen.

Quite pleased with this integrated FORTH compiler. It's a bit odd to get used to, but it works quite well. This is still only about 10 lines or so.

It will actually go faster than this (there's a line if event(e.move,6) then ...  which fires every 6/100 of a second) and the large asteroids are moving max 1 pixel per frame. You could say every 6,0 call move.everything() as well.

(The ship is wiped out because it's not redrawn in the main move cycle. The drawing works by writing and erasing bitmaps in black and white in a sprite fashion (e.g. only writing the pixels that are on) but when an asteroid is erased to move it takes the ship with it)

Breaking change

We all make mistakes. One early mistake I made was copying (partly) the old thing in Microsoft BASIC where you didn't have to declare ...