To get us a bit more in the direction of easy multiplayer game programming, I wrote another little example. It took me about half an hour to make this, using the CLAP library and the API (two player only):
Full source here:
http://timendus.student.utwente.nl/~cla ... s/Move.txt
(Will look better if you open it in Latenite)
A funny thing is that this demo doesn't synchronize or set up a connection. I intended to do that, but I skipped the synchronization so I could test one calc stand alone, and forgot to put it back in. Then I finished the program, tested it, saw that everything worked properly, and didn't realize that it wasn't synchronizing untill I was about to post it here
Anyway, this makes the code shorter and easier, and it works just as well (slightly to my surprise), so whatever
---
Edit: For the interested reader; this synchronizes as follows: The main game loop first tries to swap a byte with the other calc before it shows the sprites. The swapping is done by first sending a few bytes, then waiting for a few bytes. So the first calc runs the program, displays the waiting message, gets to the main program loop, which tries to swap. It sends out it's coordinates, which the other calc ignores because it's not running the program (the Ti-OS doesn't mess up because the transfer is too fast to trigger the silent link shit, and even if it gets triggered it doesn't generate a proper clock signal so the other calc will just ignore it). Then it starts waiting for the other calc to send it's coordinates.
When the second calc enters the program, it does the same thing; it gets to the main loop, sends out it's coordinates, and starts to wait for the coordinates of the other. The first calc picks this up, displays the sprites, and loops again, so it sends out it's coords again, which the second calc picks up, so that calc also displays the sprites. From then on, they keep each other's program from deadlocking by unlocking each other in turn.
This is probably not the fastest way to do this, because both calcs are just waiting to be unlocked half the time. Properly synchronizing would have been faster, but it's late and I'm lazy, so I'll leave you to figure that out on your own, or wait untill I either write another demo or write a library with an interrupt routine so you don't have to wait at all