When I switched to using a computer for my lectures instead of a chalkboard, I also took the opportunity to add a few animations/simulations to my lectures (see applets).
Then I started using my iPad for the lectures, which meant that those applets would no longer work, even over the internet (as they use processing which is built on java).
Fortunately, I was told about Codea (formerly known as Codify).
As luck would have it, this is heavily influenced by processing so my applets should transfer -- once I've learnt a bit of lua.
Codea has its own forum and wiki.
Here, I'll mainly put links to my code.
Unless otherwise stated, all of my code is placed in the public domain to the extent governable by law.
Explicitly, I place it under the CC0.
The code that this does not apply to is that which I have derived from someone else's code or code that has been adapted from some other format.
Note Regarding Attribution
Code that is placed in the public domain does not require attribution.
However, if you have found this code useful, the best way to say "Thank you" is to point others to it.
Library Files: These are "auxilliary" files rather than individual projects.
Projects:
Since the most recent version of Codea does not allow direct import of code, the files themselves are available for cut-and-pasting in a directory or as a single (but large!) files for cutting and pasting into Codea.
Cube Single file or directory.
This is a 3D shape viewer and editor.
It makes use of several of the files in the Library, amongst others the user interface, the font, the touch handler, and (of course) the shape renderer.
Bit Invader with Tilt Controls Single file or directory.
This is a minor modification of one of the demo programs that uses gravity to control the game.
There are two modes (controlled by the boolean hero.TrueGravity).
One in which gravity acts as gravity (thus controlling the acceleration) and one in which it acts as a control (thus controlling the velocity).
In the first case, the "ship" bounces off the sides.
In the second case, it rests against a side when it reaches it.
Update (2011-12-09) Tilting the iPad vertically now does something.
If TRUEGRAVITY (now a global boolean, by the way) is false then tilting the iPad slows down or speeds up the vertical speed of things: towards you for slowing down, away for speeding up.
The initial tilt is used as a base against which to measure subsequent tilting.
If TRUEGRAVITY is true then the effect is more sublte.
It is still the case that tilting it towards you slows things down and away speeds them up, but the effect has a decay so that it only lasts a certain time.
Particles Single file or directory.
This simulates particles in a box.
You introduce particles to the box by touching the screen; if you "flick" it then they get given an appropriate initial velocity.
They then proceed to bounce around the box and bounce off each other.
All collisions are totally elastic.
The colour changes depending on the speed of the particle, from blue to white (not very physically accurate).
It is possible to specify a lifetime for the particles, and also to allow them to escape from the box if they get enough energy.
The temperature (average kinetic energy) is displayed in the parameter box.
Complex Plane Single file or directory.
This is for exploring the complex plane by drawing points on the plane and seeing how they transform under various operations such as addition, multiplication, and taking roots.
Anagrams Single file or directory.
This is a simple anagram program (the current word list is very simple).
Rearrange the words to match one from the list (celebration effect adapted from http://www.twolivesleft.com/Codea/Talk/discussion/396).
Hangman Single file or directory.
This is a hangman program (still a bit rough around the edges).
(Same celebration as the anagram program.)
Pendulum Single file or directory.
This is a simulation of two pendulums.
The pendula can be coupled, they can run with the "small angle approximation" or not, with friction, and various parameters can be adjusted.
Note Regarding Cutting-and-Pasting
Cutting-and-pasting from a text file on the web is a little tricky on the iPad itself.
In my experiments, I couldn't select more than a word when using Safari Mobile (I managed a line once).
Using Opera Mini, I managed to select a whole page but then the Copy dialogue was at the other end of the selection ... off the screen.
The method I found that worked was to use an app that let me download and edit text files from the web.
Two that do this are GoodReader and FastKeyboard.
Then I download the file, go as if to edit it, and select-and-copy the whole document.
This gets it into the clipboard from where I can paste it into a Codea file.
Beta Software
I'm now a beta tester for Codea.
The following projects were developed using features available in a beta version.
If the corresponding Codea version has been released, they might work anyway.
- Anagrams Version of the above using native iOS5 fonts, Codea file and Movie (developed on the beta for Codea 1.3).