Steel Mill Duke

This is a bug-fixed version of my Java 2009 competition entry.

You have accepted a job making widgets in Duke’s steel mill. Keep duke happy by turning out widgets according to the displayed pattern and you progress. Turn in too many dodgy widgets and you get the sack.

Controls:
ENTER Key: Start
Left Cursor Key: Bend Left
Right Cursor Key: Bend Right
Both Cursor Keys: Finish Widget

http://www.circuitswamp.org/projects/java2009/steelmillduke2.jnlp

Hint: For your first widget, let the steel roll out straight until the light blue steel covers 4 squares. Press both left and right cursor keys together to cut the widget free. Make sure you press left and right cursor keys exactly together.

Bug fixes:

  1. Timing bug that made the game unplayable on fast computers (mine’s a bit old and slow)
  2. Antialiasing bug that made the scoring not work on Mac’s.
  3. Subtle scoring bug that mean’t you couldn’t get past level 5.

Ahhhh! It’s much better now :slight_smile:

Very hard tho!

Kev

Ah, actually playable now.

Could you tell us about what caused the timing problem?

I was calculating frame time for each loop and then scaling for the desired extrusion speed. I did this in integers and foolishly divided by one constant before multiplying by another. Unfortunately this lost precision, giving me a minimum timing resolution of 4ms. So on fast machines which were achieving better than 200fps, the extrusion rate went to zero.

The Mac bug was easier to spot. The game initially used a stretchblit to scale up the pattern from the level data held in the png image file. The Mac antialiased it, so the match to the player shape was poor. The final bug was in some code which works out bounding boxes (used to cue the widget shape correctly over the pattern). It used some out of date information (from the frame before the final ‘cut’ took place and consequently got the bounding box wrong.

Great game idea!
But I’m too stupid ;D