A small library of composable controllers that translate touch events into higher level callbacks to control game objects.
The library includes a virtual analogue joystick with central dead-zone, a catapult style interaction for launching projectiles, and tap interpreters that can be used as fire or jump buttons.
Controllers can be composed. A single statement can define a complex control scheme, such as used in a dual-stick shooter, or a shared-screen multiplayer game, or a shared-screen multiplayer dual-stick shooter!
Ha! That’s cool - I love getting base common functionality into classes we can drop in. You really need to get something into Examples.lua, or you’re gonna get a ton of questions. I was just working on a space ship pew pew thing, and was just mulling about how to add a control mechanism - you may have done it for me.
Uses named parameters in constructors, making code that uses it much more readable
Fires pressed, moved and/or released events from the virtual stick, which makes it easier to write different control schemes (running Vs aiming/shooting)
fires pressed and/or released events from the TapAction
I can’t seem to copy from github on my iPad. Does anyone know an easy way? You would think clicking ‘raw’ would do the trick but from that page I can’t select more than 1 word.
It’s possible to copy the raw output, but really tricky. I find if I scroll to the end and select a word, then try to drag one of the handles, it sometimes selects the entire text.
If its your github repo, if you do “edit” on the file, selection works well in the resulting edit window.
If its someone else’s repo, you can either fork it then “edit”, or… Well, I was doing “git clone” to my desktop, to a directory exposed by apache, then browsing locally. Nasty.
I finally jail broke my iPad, and now I git clone, then rsync it over. I will be the first to admit this is all very “beginner hostile”. The sooner we have import/export of some sort, the better - cut and paste is a giant pain.
When you drag the left selection, it… Well, try it on that page.
What you suggest should work, and does for small files - I think it’s line wrap that confuses the curt-and-paste thingamabob. In an “edit” window, it doesn’t wrap lines (it scrolls) and so works. Just a theory.
I found that copying a text file on Safari Mobile was pretty much hopeless. Once, and only once, I managed to select a line, but other than that I just got words. Opera Mini let me select the whole page (by dragging the anchors) but then the “Copy” box was off the page so I couldn’t actually copy it!
In the end, I downloaded it using an app that allows me to download text files (happened to be GoodReader but I don’t think that’s important). Then I could copy it to the clipboard and paste it into a Codea file.
(If I’m near my home computer then I hook up the iPad and transfer files via libimobiledevice. No jailbreaking required.)
I’ve just pushed a version that adds linear sliders that can have arbitrary orientation. They act like the virtual stick but emit scalar values between -1 &1, not vectors.
Ah, I had some hope with the opera browser but when I pasted it it cut out all the white space including new lines.
I finally figured out a way to do it in safari. On the raw page, you select the last word of the document, hold the left handle with one finger, flick up to the top with another finger, and finally move your first finger to the first word of the document. It will, hopefully, select the whole document.