Bonjour à tous,
J'ai fait une map avec Solarus et je voudrais savoir comment faire pour mourir après l'avoir ouvert, s'il vous plaît. Voici mon code :
-- Lua script of map caves/hyrule.
-- This script is executed every time the hero enters this map.
-- Feel free to modify the code below.
-- You can add more events and remove the ones you don't need.
-- See the Solarus Lua API documentation:
-- http://www.solarus-games.org/doc/latest
local map = ...
local game = map:get_game()
-- Event called at initialization time, as soon as this map is loaded.
function map:on_started()
-- You can initialize the movement and sprites of various
-- map entities here.
end
-- Event called after the opening transition effect of the map,
-- that is, when the player takes control of the hero.
function map:on_opening_transition_finished()
end
function wrong_chest:on_opened()
hero:freeze
game:start_dialog("out.f6.chest_game.wrong_chest")
sol.timer.start([map], 1000)
hero:unfreeze
game:set_life(0)
end
Et ça me génère une erreur :
Info: Solarus 1.6.0
Info: Opening quest 'C:/Users/Hpo/Desktop/The legend of Zelda Hyrule Adventure'
Info: Sound volume: 100
Info: Music volume: 100
Info: Joypad support enabled: true
Info: 2D acceleration: yes
Info: Turbo mode: no
Info: Video mode: normal
Info: LuaJIT: yes (LuaJIT 2.0.3)
Info: Language: fr
Info: Lua console: yes
Info: Simulation started
Error: Failed to load script 'maps/caves/hyrule': maps/caves/hyrule.lua:28: function arguments expected near 'game'
Info: Simulation finished
Pourriez-vous m'aider, s'il vous plaît?