1-- Lua script of map bugs/1353_water_no_flippers. 2-- This script is executed every time the hero enters this map. 3 4-- Feel free to modify the code below. 5-- You can add more events and remove the ones you don't need. 6 7-- See the Solarus Lua API documentation: 8-- http://www.solarus-games.org/doc/latest 9 10local map = ... 11local game = map:get_game() 12local hero = game:get_hero() 13 14-- add needed assert helpers 15function hero:assert_position_equal(other) 16 17 local x_1, y_1, layer_1 = hero:get_position() 18 local x_2, y_2, layer_2 = other:get_position() 19 assert(x_1 == x_2) 20 assert(y_1 == y_2) 21 assert(layer_1 == layer_2) 22end 23 24function hero:assert_state_ground_animation(state, ground, animation) 25 26 assert_equal(hero:get_state(), state) 27 28 local map = hero:get_map() 29 local hero_x, hero_y, hero_layer = hero:get_ground_position() 30 assert_equal(map:get_ground(hero_x, hero_y, hero_layer), ground) 31 assert_equal(hero:get_ground_below(), ground) 32 33 assert_equal(hero:get_sprite("tunic"):get_animation(), animation) 34end 35 36-- very important : define this 37function hero:on_movement_changed() 38end 39 40-- Event called at initialization time, as soon as this map is loaded. 41function map:on_started() 42 -- go down to do the jump 43 game:simulate_command_pressed('down') 44end 45 46function to_water:on_activated() 47 sol.timer.start(sol.main, 3000, function() 48 sol.main.exit() --quit test if done 49 end) 50end