| Menu | JAQForum Ver 19.10.27 |
Forum Index : Microcontroller and PC projects : PicoMite - Attractor Mode
Here we go ... Not a heavy GitHub user, but it works: PicoMite Attractor Currently only Missile Command in there as I need to clean up my trashy code and add comments. This plays against itself, so no actual user control. If anyone want to refactor and add that, go for it. The autoload part is in there, but in the upload it forces just missile.bas to reload - should be obvious where this is. Also, no sound. Used a ST7735S_W - but should work on anything 128x128 - but didnt code anything to cope with different screens as this is what I have ;-) G |
||||||
Missile Command Asteroids AI used to comment the code as I generally skimp on that. AI also used to get the frame rate up -- it suggested / implemented: 1 - scaling the graphics by x16 and then downsizing (to use Ints) 2 - not using trig but a lookup table 3 - use of Framebuffer on Asteroids for the background BUT drawing the user ship straight on the LCD bypassing the framebuffer - sort of hybrid. 4 - collision detected tweak by AI (still not sure it's 100%) G |
||||||
Hi Nimue, I am surprised that 1 & 2 made it faster, I have usually found there is almost no difference using Ints, especially if you then have to rescale; when I, and I think Peter, tried using lookup tables, to speed up Bubble Universe for trig, it was slower? I do use Int where it's easy loop counts, maths that doesn't require the precision etc. Have you tried implementing each item and then timing individually. Regards. Edited 2026-08-16 03:52 by Bleep |
||||||
Honest answer - no. Just by inspection of the game on the screen. I was happy with the percieved frame rate. I implemented them Int first, then look up. Moving to INTs seems to make a visible difference - so I left it. The look up - not so much as obvious, but I still left it as it didnt break anything. This raises the "AI" question again, where I was happy to delegate some of the thinking as this was for "fun" and not mission critical -- but I didnt test for sure, so dont have numbers. I'm working on Space Invaders that AI has done all the heavy lifting after I uploaded the MMBasic Manual - my Missile Command prog and told it what LCD panel it was using. One prompt and a runnable version stright to the 'Mite. Lots of tweaking still to do, but it worked first time with my working example to lean on. Colour me impressed. |
||||||
G'day Nimue, Very nice job on this project, self playing games are a great idea Downloaded your code from GITHUB and tried out on LCD and it looks neat After making a few adjustments to try on HDMI (1024x600 Mode2 = 256x150) the following caused an error: Dim lnew Dim newload As Integer Dim attract$ As String SetTick 180000, lnew newload = 0 Sub lnew Select Case 2 'Int(Rnd * 4) + 1 Case 1 attract$ = "defender.bas" Case 2 attract$ = "asteroids2.bas" Case 3 attract$ = "lander.bas" Case 4 attract$ = "missile.bas" End Select newload = 1 End Sub Having LNEW as a variable and a subroutine name should not be possible, this might be causing some problems Oddly it works on the LCD version but errors on the HDMI version Regards, Lyle. |
||||||
That's odd - the error is probably mine. Dim Lnew as used as Sub as have Option Explicit. Do I not need to do that and just define the sub and call it? Its not a variable - just the sub name. Getting in a bit of a knot I think (me that is ;-)) G |
||||||
You should only DIM variables, not Sub names. Strange that it works at all. :) |
||||||
Yup - fixed / removed. Not very good at maintaining code, I think at somepoint lnew was going to be a variable with an IF check and it just got left behind. Thanks G |
||||||
| The Back Shed's forum code is written, and hosted, in Australia. |