Saturday, 18 April 2020

Game # 9 ?????? : RPL In Action

You can probably guess what the game is :)

So I thought I'd use this built in compiler and see what it could do. I'd do two things with it, move the objects on the screen, and collision detection. Steering code and so on can be BASIC.

This is doing about 30fps with 25 asteroids, and it's 9 lines of actual code. A fair amount of that time is the actual drawing bit. Code could definitely be clearer, but still getting a feel for it. It's pretty ineffecient code ; (it assembles to about 300 words), because the CPU isn't really designed for Threaded Languages ; it can do it fine ; it doesn't have a push/pop or a load/save with auto increment. At the moment it's using one register for TOS and keeping the rest on the stack ; that was probably a mistake. I'll probably rewrite the library at some time (there's not very much of it).

These are bitmaps. The blitter isn't great at drawing lines ; it's not terrible by any means (especially when parallel to an axis), but it's not really its strong point.

No comments:

Post a Comment

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 ...