Module: TyranoDsl::ParsingWords::StartScene

Includes:
ParsingWordsModule
Defined in:
lib/tyrano_dsl/parsing_words/start_scene.rb

Instance Method Summary collapse

Instance Method Details

#start_scene(scene_name) ⇒ void

This method returns an undefined value.

Parameters:

  • scene_name (String)

Raises:



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/tyrano_dsl/parsing_words/start_scene.rb', line 12

def start_scene(scene_name)
  if context.world.scenes.key? scene_name
    raise TyranoDsl::TyranoException, "Duplicated scene [#{scene_name}]"
  end
  unless context.world.title_screen.first_scene_name
    context.world.title_screen.first_scene_name = scene_name
  end
  context.world.scenes[scene_name] =
      TyranoDsl::Elements::Scene.new(
          scene_name,
          context.world.scenes.length + 1
      )
  add_parsed_word(
      TyranoDsl::Vocabulary::START_SCENE,
      name: scene_name
  )
end