diff options
| author | Alexander Pickering <alex@cogarr.net> | 2020-02-02 08:11:08 -0500 |
|---|---|---|
| committer | Alexander Pickering <alex@cogarr.net> | 2020-02-02 08:11:08 -0500 |
| commit | 57701059b1b65fc08366318e92d32d9dd7094d25 (patch) | |
| tree | a569db68d27982d83fead3cc9c8192056c49509f /src/level8.moon | |
| download | drydock-57701059b1b65fc08366318e92d32d9dd7094d25.tar.gz drydock-57701059b1b65fc08366318e92d32d9dd7094d25.tar.bz2 drydock-57701059b1b65fc08366318e92d32d9dd7094d25.zip | |
inital commit
Diffstat (limited to 'src/level8.moon')
| -rw-r--r-- | src/level8.moon | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/level8.moon b/src/level8.moon new file mode 100644 index 0000000..0a9ce96 --- /dev/null +++ b/src/level8.moon @@ -0,0 +1,56 @@ +layer = require "layers" +game = require "game" +state = require "global" +graph = require "graph" +import Layer from layer +ui = require "ui" + +mod = ... + +mod.setup_level = () -> + state.current_level = 8 + --ret = am.group! + state.move_out_done = false + state.clear_layers! + flayer = Layer("fuel","fuel pipe",50,"data/layer_fuel.png") + elayer = Layer("electric","electric wire",10,"data/layer_electric.png") + state.add_layer(flayer) + state.add_layer(elayer) + state.money = 40 + state.ship("position").x = 800 + state.ship\action(coroutine.create(game.ship_move_in_co)) + state.ship("sprite").source = "data/level_8.png" + t1 = flayer\mark_square(15,4,"liquid fuel thruster") + flayer\mark_square(14,4,"fuel pipe") + t2 = flayer\mark_square(15,6,"liquid fuel thruster") + flayer\mark_square(14,6,"fuel pipe") + t3 = flayer\mark_square(15,9,"liquid fuel thruster") + flayer\mark_square(14,9,"fuel pipe") + t4 = flayer\mark_square(15,11,"liquid fuel thruster") + flayer\mark_square(14,11,"fuel pipe") + p1 = flayer\mark_square(7,8,"liquid fuel tank") + for i = 4,11 do + flayer\mark_square(13,i,"fuel pipe") + + t5 = elayer\mark_square(11,6,"ion thruster") + t6 = elayer\mark_square(11,9,"ion thruster") + p2 = elayer\mark_square(3,7,"battery") + + elayer.node.hidden = true + state.selected_layer = flayer + state.update = () -> + flat_tiles = flayer\flat_tiles! + flat_tiles2 = elayer\flat_tiles! + path1 = graph.path(t1,p1,flat_tiles,true,flayer.tiles_adjacent) + path2 = graph.path(t2,p1,flat_tiles,true,flayer.tiles_adjacent) + path3 = graph.path(t3,p1,flat_tiles,true,flayer.tiles_adjacent) + path4 = graph.path(t4,p1,flat_tiles,true,flayer.tiles_adjacent) + + path5 = graph.path(t5,p2,flat_tiles2,true,flayer.tiles_adjacent) + path6 = graph.path(t6,p2,flat_tiles2,true,flayer.tiles_adjacent) + if path1 and path2 and path3 and path4 and path5 and path6 + state.ship\action(coroutine.create(game.ship_move_out_co)) + + ui.reload_ui_layers! + +mod |
