Hello again! So while I take a break from DoodleJump, I kinda got distracted and am now attempting to port Aspirin. So far I've got one of those stabby lines moving, a player, and one of the point balls.

I've gotten collision for both circles and lines working, and I just need to implement more lines, now. Anyone have an idea for that? I'm thinking maybe a matrix? I'm not sure. Any suggestions would be great!

So yeah, got more lines and things, but at a certain point things slow down:

So to counteract that, Mateo suggested drawing over the lines with white versions of themselves instead of redrawing the whole screen. Here's what that looks like. Any idea how to make it erase all the black?

It's because of the two buffers. When you are drawing you should *ahem* draw everything twice if you want to use this buffering method. Once you draw the first render, swap it to the visible screen. Then (on the back buffer) draw everything again, and swap again. Then erase the lines in the buffer, draw the new ones in the buffer, and swap. Then erase the lines in the buffer, draw the new ones in the buffer, and swap. And that should solve the buffering issues.

An alternate (easier, but might be a little slower) would be to just draw everything in the back buffer, and then call gfx_BlitBuffer(), rather than gfx_SwapDraw().

Welp, thanks for the pointers everyone! I found a problem with coordinates not being randomized correctly. and lines being drawn over themselves, so I fixed that, and now it is much harder before the slowdown occurs. I am also going to make the area where the lines and the player move into a smaller square so I don't have to draw as much, speeding up the program a bit

Here's a screenshot for now. (Notice 6 lines instead of 2 in the beginning)

So yeah, gonna add a menu and more levels after that. 6 per point is going to be the hardest, I think.

So, beside the fact that my code is pretty unoptimized, could anyone try figuring out why when I get a point the coordinates for already displaying lines gets reset, and displays in another place? I'm thinking a fresh set of eyes could help.

I don't understand the purpose of the displaying variable in the struct. It can be entirely removed. Just loop for the number of enabled lines; and when you add lines; just increase enabled lines and add to the end rather than looping through every single one...

Heyo! So I just decided to do a little bit of work on Aspirin, and look what I did! I almost finished it! Now, it has some things to fix, and highscores and stuff to work around, but hey! I also have a few questions, scroll down to see em.

So, here's a screenshot!

So, a question. You see how the selection of difficulty is super fast? To fix that, I apparently should use interrupts. The thing is, I don't exactly understand what those are, or how I would go about using them. Could you guys please explain? And if you want to give some example code, here is my keypressing loop. I've looked at the examples, and they just don't make that much sense to me, probably because I'm not understanding what interrupts are.

I have written up two important wiki articles that everyone should read The first one details interrupts in general on the CE, and the second interacting with the keypad and interrupts. You can find them here:

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.