2020-10-14
Just starting out and really wanting to start something new whilst making a game that I would enjoy playing myself. I’m come to appreciate that I really like puzzles in games - whether it’s spotting patterns or solving problems.
So I’m beginning Marbles2 (or Marbles Squared) in NextBASIC.
I’ve started with the random algorithm and I wanted a simple routine that I could repeat in other languages. I found a reasonably simple XOR shift algorithm which is written in assembly but simple enough that I could port it to JavaScript (for testing).
This routine is then encoded into bytes (decimal) and used in my NextBASIC - again, only because I want to control the RNG. So I get to do confusing things like this:
#autoline 10
PROC init()
PROC pickRandom() TO %a
PRINT %a
STOP
DEFPROC init()
%i=0
REPEAT
READ %o
BANK 17 POKE %i,%o
%i=%i+1
REPEAT UNTIL %o=201
ENDPROC
DEFPROC pickRandom()
; default seed is 1 - to change this we need to BANK 17 DPOKE %1, %<16-bit> - but only during start game
%r=% BANK 17 USR 0
BANK 17 DPOKE %1,%r
ENDPROC =%r&3
DATA 1,1,0,120,31,121,31,168,71,120,31,169,79,168,71,201: ; length: 16
The code above lets me generate a random number from 0-3. Bit overkill, but works nicely.
Then right on cue, Paulo Silva released an input driver which simplifies reading from joystick and keyboard and separately I can use the mouse driver as a third input option. Took me about 10 minutes to have all those input methods available and suddenly some of the core requirements (being able to move around) are solved and I can focus on the problem solving.
Get Marbles Squared (ZX Spectrum Next)
Marbles Squared (ZX Spectrum Next)
A puzzle game harking back to The Same Game
Status | Released |
Author | rem |
Genre | Puzzle |
Tags | nextbasic, Retro, specnext, spectrum-next, zxnext, ZX Spectrum, zx-spectrum-next |
More posts
- 2021-07-16 (update release)Jul 16, 2021
- 2021-07-10Jul 10, 2021
- 2021-07-05Jul 05, 2021
- 2021-06-14Jun 14, 2021
- 2021-05-19May 19, 2021
- 2021-05-18May 18, 2021
- 2021-03-23Mar 23, 2021
- 2020-11-23Nov 23, 2020
- 2020-11-08Nov 08, 2020
Leave a comment
Log in with itch.io to leave a comment.