Wall_Axe wrote: ↑Mon Apr 15, 2024 10:47 am
That is very rapid development for the speccy ;)
thank you! i procrastinated almost 1/2 of the time, tbh. ;-) and most code was lifted from the tile editor (arrow, magified view, hot areas). still, developing in Forth IS that fast: tile editor only took me about 2 days of work (if we remove all procrastination, and compress everything to standard 8-hour working days).
and it could be done on Speccy itself. no, really. i already have a fullscreen editor, so it is mostly the same "write a word, test a word", and i don't have to reload Forth every time. PC editor just have bigger letters, and my eyes are not as good as they were, otherwise i'd do it on Speccy itself (on an emulator). ;-) and there's no asm involved. (i wrote 2 asm words just for the sake of… size. one is "3*", and another is looking for the first set bit in a byte. both were done in Forth first, and asm versions are slightly smaller.)
by the way, bit looking word was taken directly from the x86 UrForth — it is used in sprite compiler there.
Wall_Axe wrote: ↑Mon Apr 15, 2024 10:47 am
Were you saying you could use the same/similar forth code to make the same app for Linux? Or is that far off?
actually, i can. it is the basic "wait for an event / handle an event". i could rewrite low-level part (event reading, pixel manipulation) with Xlib, and reuse most of the other code almost "as is".
Wall_Axe wrote: ↑Mon Apr 15, 2024 10:47 am
I was thinking of making a spectrum game a while back. So I coded a prototype in JavaScript. I basically used 8x8 squares only for the graphics, so it was a tile based game. I suppose in the same vein you could open up a window in Linux which is the same dimensions as the speccy display and it would work well.
one of the reasons i am making various Forth systems is to prototype some game ideas i am too lazy to write in asm. i want to do it on Speccy itself (emulator, of course) to see how it would fit. but yeah, i can write Xlib gfx part, and the end result will look like Speccy emulator. ;-)
p.s.: btw, the walking animation is not some interrupt trick. it's just a Forth word which blits the sprite (yep, this time it is in Forth, not in asm; all sprite sheets printed by Forth words), and it is called in the loop which waits for a mouse/key press. no black magic there at all. ;-)