Jump to content
Retrospect

I'm not saying it's aliens .....

Recommended Posts

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.

  • Like 1
  • Thanks 2

Share this post


Link to post
Share on other sites
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! :D

  • Thanks 2
  • Haha 2

Share this post


Link to post
Share on other sites

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 by senior_falcon
  • Like 2

Share this post


Link to post
Share on other sites
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 :)

 

  • Like 1
  • Thanks 2

Share this post


Link to post
Share on other sites
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.  :)

 

  • Like 1

Share this post


Link to post
Share on other sites
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.

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...