Xorun
A downloadable game for Windows, macOS, Linux, and Android
run this game using Gforth, like this
gforth xorun.fs
or you can just paste the code into Gforth's REPL.
this game is a submission to TweetTweetJam 9. here is the code
require random.fs : v variable ; v y v f v b v d create s 256 allot : dd 32 * + s + c! ; 7 y ! 0 f ! utime b ! seed ! 12 d ! : . 0 begin s 256 bl fill page f @ if -1 f +! -1 y +! else y @ 7 < if 1 y +! else key? if key drop 5 f ! then b @ 1 and if exit then then then d @ random 0= if b @ 32768 or b ! then b @ 32 0 do dup 1 and if 88 i 7 dd then 2/ loop drop b @ 2/ b ! 79 0 y @ dd 1+ dup 255 mod 0= d @ 4 > and if -1 d +! then dup . s 8 0 do dup 32 type cr 32 + loop drop 83 ms .s again ; . bye
meanings of the variables
- s - screen, a 32*8 area of bytes. a char is assumed to be one address unit.
- y - y coordinate.
- f - time to fly. increase y when f positive.
- b - blocks. a number whose lower 32 bits represent obstacles
- d - density. pick a number in [0, d). if it's zero, place a new block.
- unnamed stack item - your score. it stays on the stack after the game ends.
Download
Download
xorun.zip 8.6 kB
Leave a comment
Log in with itch.io to leave a comment.