Sunday 22 February 2015

Timing of the Loop

The animation problem represented by the rocket (mentioned in the previous post) led me to start tinkering with the Ticktimer() thread. In particular, the amount of sleep() I give it. Allowing the timer less sleep (reducing from 80ms to 16ms) gave the animation a superb boost, and the jerky animation disappeared altogether. Of course, the emulator with debug (on PC with Android Studio) still moves pretty slowly, but running on a naked Android device is highly efficient.

Pretty soon, I'll have to implement a "disable touch response" system, so that the user can't do anything during an animation that has to run to completion.

Thursday 19 February 2015

Using a Rocket

Built a set of images for a runaway firework, but it didn't work so good, not because the images were wrong, but because the animation was extremely staccato and jerky.

Back to the drawing board...

Saturday 14 February 2015

Multiple Sprite Interaction

Found, and solved, a number of problems associated with swapping a pair of sprites as a result of interaction with a third. It was all to do with the sequence in which events took place, and was surprisingly complex. Now, it looks like a piece of cake, but it took me a whole day and some rearrangement of basic code to accomplish. Still, a nice challenge.

Monday 9 February 2015

Problems with Conditions that Affect Multiple Sprites

Came across a problem today, concerning, really, the behaviour of one sprite dependent on another. This isn't something that can be resolved in the sprite's code, because no sprite is conscious of another sprite's existence i.e. it can't access another sprite's context. All such arbitration has to take place in the module that instantiated the two sprites.

The particular case is when the rocket launcher already has a rocket in it, and the user tries to put a second rocket in the launcher.


Later: The state of background sound off is not preserved over a Save Restore.

Later still: A new test version of Jade is available via the link in the left hand column.

Furniture Sprites

Started implementing Furniture sprites, discovering, incidentally, that if a sprite's image cannot be found, Jade crashes. Must fix that.

Though Furniture sprites are INACTIVE (i.e. don't react to touch or collision), they sometimes have to be moved to and from Limbo, so their 'home' scene and location are remembered. Initially, I set up special variables to remember these, but it occurs to me that I could use a single Dropzone for the purpose. Saves coding.


Saturday 7 February 2015

Rocket sprites

Built and tested the carryable rockets. Also need the 'dummy' rockets in the distant view. These will be 'furniture' sprites.
After long contemplation, decided that the furniture sprites, though they tend to be static, should also be MOVABLE, so they can be shoved into Limbo, as will happen with the dummy rockets. So probably type is an irrelevant attribute of Sprite, but I'll leave it there for the time being. The other attribute - GETTABLE, however, is significant, as is ACTIVE.

Thursday 5 February 2015

Re: Switches, Conditional Scenes and Use of Inventory

Switches:

I had thought I might have to implement a new class - Switches - to enable recognition of new conditions (e.g. Rocket already fired) and to give a handle to Save and Restart. However, I am now sure that Sprites themselves will be sufficient, either by detecting the the presence or position of a Sprite, or by creating a Zombie Sprite whose Position data can be used to indicate a state. The Zombie would be saved and restored like a carryable or movable Sprite. The Zombies would be in the Limbo scene (which is unreachable by players), and would never need to be drawn in real play, though inspection by developers of the Limbo scene would aid debugging..

Conditional Scenes:

I have now implemented  a function in JadeData that inspects every destination scene before a scene switch, and changes the destination scene according to current game conditions.

Use of Inventory

Hitherto, if a carried sprite was dropped, and there was no specific dropzone on that scene, it was dropped into Inventory. I'm changing this so that Inventory drops only occur if there's a specific location in Inventory specified in the sprite dropzones. Otherwise, no drop will take place.