My (distant) goal is to make a RAD language that novice html writers are comfortable with, enabling them to create small games and perhaps applications. At the moment it can create gui elements, frame independent animation and has an easy to understand tiling system. I have a few working demos written in it, including a tile editor and a 2d platform game.
As users, How would you expect an objects scope to behave in the <code> block examples:
Example 1
All objects with IDs are laid out in their native tree structure in Lua* (Flash AS 1.0 style):
Code: Select all
<!-- index.xml -->
<sprite art="character.png" id="sprite1" />
<code>
_root:drawFrame()
_root:sprite1:setPosition(20,20)
_root:frame2:drawFrame()
_root:frame2:sprite2:setPosition(50,20)
</code>
<frame id="frame2">
<sprite art="character2.png" id="sprite2" />
</frame>
Example 2
Only local objects are in scope, and you have to search for other objects you want:
Code: Select all
<!-- index.xml -->
<sprite id="hello" art="hello.jpg" position="20,30" />
<code>
-- will work
hello:setvisible(false)
-- I made this function up, to demonstrate to get an object in scope
-- At the moment, I use a global function called getSpriteById() or getFrameByID()
test = getFrame("test")
blankSprite = test:getSprite("test")
</code>
<frame id="test">
<sprite id="blank"/>
</frame>
Bonus question, how would you expect the following code to function:
Code: Select all
<code>
print("hello ")
</code>
<frame id="test">
<code>
print("world!")
</code>
</frame>
* Don't worry if I get a stupid user who calls his sprite a function name, I'll write a filter, or perhaps put an underscore before all ids
**At the moment I use a function called onLoadFrame() to do this