I've been recently working on projects for the TI84 PSE, and I had this interesting idea for a particle engine written in basic. Right now, it uses 4 lists, and detects when a particle goes off the edge of the screen. What I was originally going to have it do was delete the particle when it goes off the edge of the screen, but I'm not sure how I would accomplish this. Is there a quick way of deleting an element of a list I don't know off (I don't want to use For Loops)? If not, I had some ideas, but anyway...
You can use this code snippet to remove the element at position/index X of L1:

Code:
seq(L1(A+(A>=X)),A,1,dim(L1)-1

This basically gets dim(L1)-1 elements from L1, starting at index 1, 2, 3... etc, but when it reaches index X, it increments the index, so if X=2, it gets the index 1, 3, 4... etc, which is IIRC what you are looking for Smile

EDIT: even better:

Code:
seq(L1(A-(A<X+1)),A,2,dim(L1
It might be better to just put an invalid number for the particle, which would render it permanently off-screen and not soo recoverable. Let's say something like E98->L1(n. It is not elegant, but smaller and faster, and effectively renders the particle out. (I doubt you can add or subtract 99 digit number there, or accumulate it during run time...).
Nik wrote:
It might be better to just put an invalid number for the particle, which would render it permanently off-screen and not soo recoverable.

The reason I'm trying not to do that is
A. If I simply move it off screen, it has a limited number of particles it can use (999) and moving it off screen would increase the number unnecessarily.

B. I'm using the PXL commands right now, as they're faster. If I switch to the point commands, it would be feasable, but anyway...
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement