Friday, 24 December 2010

Anyways...

So, despite all my best intentions, I find myself interested in android dev, so I think I'll chase that down a bit more. I've been looking at getting the sqlite interface working, since that should let me create generic ADV loops again. Currently I'm testing a state flag for each tap of the screen

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;
                Scene scene("intro");
                Snippet snip;

                while(snippet = scene.next()) {
                        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: