I've recently implemented an HTML5 based viewer for the flashteases, and in doing so, I thought a bit about how I would desing a new flash tease format. These are my points:
- HTML5 and Javascript are not suitable. They might change in the future and are hard to implement. Also they are hard to embed into a website safely if they come from users and they can be hard to convert to other formats.
- A complicated editor is not needed or usefull. If you look and grafical programming editors, they are very complicated to build, and they are not really easy to use.
- The format schould be easy to parse, not a hell of cornercases like the current format.
- There needs to be some kind to deal with state (flags, numbers, ...)
- There needs to be some kind of ways to build components that can be reused
What I came up with, was something like a simple script language, looking something like that:
Code: Select all
proc main() {
yield SimplePage(text = "Do you want to edge 5 times?", img = "foo.png", buttons = List(
Button(text = "Yes!")
))
yield StrokeSound(pattern = List(0.0, 0.5, 1.0, 2.0), repeat = Infinity)
yield Timeout(120)
await {
on Button(...):
edge(5)
yield SimplePage(text = "You're done.", img = "foo.png")
on Timeout(...):
yield SimplePage(text = "You were too slow.", img = "foo.png")
}
yield StrokingSound(repeat=0)
}
proc edge(count) {
if(count > 0) {
yield SimplePage(text = "Edge Now", img = "foo.png", buttons = List(
Button(text = "Done!", action = {
edge(count - 1)
})
))
}
}
Basically, it is a program that is yielding actions like "setting a page", "setting a stroking sound" and so on. And it can wait on actions with an await block. There are no global variables, but parameters that can be passed to procedures. There is a syntax to instanciate complex data structures, but no way to declare or implement them. There functionality is provided directly by the viewer. They can be decomposed using pattern matching.
There would not be a type system. I like type systems, but they take a lot of work to implement and are too complicated for the target audience. Styling of pages would be restricted to predifined layouts, no embedded html etc. This could be extended as needed but should be kept simple. Keeping it simple allows teases to be easily shown using different viewers on different devices.
This language would allow quite some advanced stuff, but a simple tease would still look simple. (Every page is one proc, yielding a few acions with on await block.)