Android code samples are in Java BTW. The scriptable languages framework is neat, but I get the impression it's kind of hamstrung. There's a cool hack with the Android C compiler (which is definitely hamstrung) using the scripts for access to android classes, but I've not looked at that yet.
Anyway: bumping a state variable for each click, and then switching on the result:
public void onClick(View v) {
Button b = (Button) v;
switch(++intro_count) {
case 2:
b.setText(R.string.intro2);
break;
case 3:
b.setText(R.string.intro3);
break;
// ... much snippage
}
}
Which works, but isn't really scalable. What I want is something like this
public void onClick(View v) {
Button b = (Button) v;
Button b = (Button) v;
Scene scene("intro");
Snippet snip;
b.setText(snip.text_id);
if(snip.has_image()) {
set_background(snip.image_id);
}
}
}
}
}
That looks a lot easier to generalise. I can still load images from game resources, but now we start to separate data and engine from one another. And in doing so we open the door to another necessity of any WM derived game: addon girl packs
No comments:
Post a Comment