Retrospect Posted October 20, 2021 Author Share Posted October 20, 2021 9 hours ago, Keatah said: Just count the number of aliens blown up and increase speed accordingly. I used an array to flag up which alien is "alive", it was called something like "AA(xx)" There are 40 such aliens. If Alien number 12 is the only one left alive, the counter still checks through 40 aliens regardless. Only 1 alien is moved each "update". So it's checking from aliens 1 to 40 , which one is still alive. I could try a better system, maybe even check the Space Invaders source code for how he did his indexing system. But it's a way off yet as I have issues cognitively at present. Hopefully not for too long. 1 2 Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted October 20, 2021 Share Posted October 20, 2021 1 hour ago, Retrospect said: I used an array to flag up which alien is "alive", it was called something like "AA(xx)" There are 40 such aliens. If Alien number 12 is the only one left alive, the counter still checks through 40 aliens regardless. Only 1 alien is moved each "update". So it's checking from aliens 1 to 40 , which one is still alive. I could try a better system, maybe even check the Space Invaders source code for how he did his indexing system. But it's a way off yet as I have issues cognitively at present. Hopefully not for too long. I think the compiled version works well in this iteration. If you come up with a better system, maybe a sequel? I'm not saying it's aliens... but it's aliens, again! 2 2 Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted October 30, 2021 Share Posted October 30, 2021 (edited) One thing I discovered in my testing is that the font is misaligned when using XB 2.8 G.E.M. This happens because G.E.M. uses a different font at startup. The solution is simple - only if you are running this from XB using G.E.M., simply add this line: 1 CALL FONT(7) At startup this will load the standard XB font and then the program proceeds as usual. Edited October 30, 2021 by senior_falcon 2 Quote Link to comment Share on other sites More sharing options...
Tursi Posted October 30, 2021 Share Posted October 30, 2021 On 10/20/2021 at 9:46 AM, Retrospect said: I used an array to flag up which alien is "alive", it was called something like "AA(xx)" There are 40 such aliens. If Alien number 12 is the only one left alive, the counter still checks through 40 aliens regardless. Only 1 alien is moved each "update". So it's checking from aliens 1 to 40 , which one is still alive. I could try a better system, maybe even check the Space Invaders source code for how he did his indexing system. But it's a way off yet as I have issues cognitively at present. Hopefully not for too long. Space Invaders moved one alien per turn... but the point is it would ALWAYS move one... so it would skip over dead ones till it found one to move. That is how the speedup worked 1 2 Quote Link to comment Share on other sites More sharing options...
Retrospect Posted October 30, 2021 Author Share Posted October 30, 2021 1 hour ago, Tursi said: so it would skip over dead ones till it found one to move Ahhh .. I need to put that into the game somehow. 1 Quote Link to comment Share on other sites More sharing options...
Asmusr Posted October 31, 2021 Share Posted October 31, 2021 7 hours ago, Retrospect said: Ahhh .. I need to put that into the game somehow. Maybe instead of a flag, you could should store the index of the next alien alive in AA(xx), like a linked list? Then you would be able to find the alien to move in constant time. When an alien died you would unlink it from the list, which means you would have to find the previous alien alive and point it to the next alien alive. 2 1 Quote Link to comment Share on other sites More sharing options...
Retrospect Posted October 31, 2021 Author Share Posted October 31, 2021 3 hours ago, Asmusr said: Maybe instead of a flag, you could should store the index of the next alien alive in AA(xx), like a linked list? Then you would be able to find the alien to move in constant time. When an alien died you would unlink it from the list, which means you would have to find the previous alien alive and point it to the next alien alive. Thankyou Rasmus, that is an idea I want to go with and do. I just have to figure out how to do this, how to express it in the code Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.