Advertisement
Guest User

Untitled

a guest
Sep 17th, 2015
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 12.14 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
  2. <ws>
  3.     <settings>
  4.         <stage width="900px" height="460px" create="yes" center="yes" resize="yes" />
  5.         <triggers>
  6.             <trigger name="game_menu_key_trigger" event="keyup" key="ESCAPE" function="savegames" />
  7.             <trigger name="next_on_right" event="keyup" key="RIGHT_ARROW" special="next" />
  8.             <trigger name="next_on_space" event="keyup" key="SPACE" special="next" />
  9.             <trigger name="sub_scene_by_key" event="keyup" key="UP_ARROW" sub="custom_event_scene" />
  10.         </triggers>
  11.         <setting name="host.stage.resize" value="true" />
  12.         <setting name="host.inspector.enable" value="true" />
  13.     </settings>
  14.     <assets>
  15.         <textbox name="tb_main" x="5px" y="355px" width="890px" height="100px" speed="50"></textbox>
  16.         <textbox name="tb_top" x="0" y="0" z="30000" width="100%" height="100%" cssid="bla"></textbox>
  17.        
  18.         <rectangle name="rect" x="20px" y="20px" height="50px" width="100px" color="green" />
  19.            
  20.         <textbox name="tb_nvl" behaviour="nvl" cssid="NvlTb" names="no"
  21.            width="890px" height="450px" x="5px" y="5px"></textbox>
  22.        
  23.         <audio name="music" loop="true" fade="true">
  24.             <track title="legend">
  25.                 <source href="tests/audio/chaos-circus.mp3" type="mp3" />
  26.                 <source href="tests/audio/chaos-circus.ogg" type="ogg" />
  27.             </track>
  28.         </audio>
  29.        
  30.         <character name="n" textbox="tb_main"></character>
  31.         <character name="nn" textbox="tb_top"></character>
  32.        
  33.         <imagepack name="backgrounds" x="0" y="0" z="0">
  34.             <image src="assets/images/daytime_clouds_A_01.jpg" name="clouds01" />
  35.             <image src="assets/images/Evening_clouds_C_01.jpg" name="clouds02" />
  36.         </imagepack>
  37.        
  38.         <imagepack name="backgrounds2" x="0" y="0" z="0">
  39.             <image src="assets/images/Rainbow_A_01.jpg" name="rainbow" />
  40.         </imagepack>
  41.        
  42.         <curtain name="fog"></curtain>
  43.        
  44.         <curtain name="flash" color="white"></curtain>
  45.        
  46.         <button name="sg_button" text="S/L" function="savegames" x="862px" y="320px" z="100000" />
  47.        
  48.         <animation name="anim">
  49.             <group>
  50.                 <do asset="backgrounds" action="move" x="-300px" y="-200px" duration="2000" easing="easeOutBounce" />
  51.                 <transform asset="tb_main" property="border-top-width" from="1" to="5" unit="px" />
  52.             </group>
  53.             <group>
  54.                 <transform asset="tb_main" property="border-top-width" from="5" to="1" unit="px" />
  55.                 <transform asset="backgrounds" property="left" from="-300" to="0" unit="px" duration="2000" easing="easeOutBounce" />
  56.             </group>
  57.             <group>
  58.                 <do asset="backgrounds" action="move" x="-300px" y="0px" duration="2000" easing="easeOutBounce" />
  59.             </group>
  60.             <group>
  61.                 <transform asset="backgrounds" property="left" from="-300" to="0" unit="px" duration="2000" easing="easeInQuint" />
  62.             </group>
  63.         </animation>
  64.        
  65.     </assets>
  66.     <scenes>
  67.        
  68.         <scene id="start">
  69.             <trigger name="next_on_right" action="activate" />
  70.             <trigger name="next_on_space" action="activate" />
  71.             <!-- <trigger name="sub_scene_by_key" action="activate" /> -->
  72.             <trigger name="game_menu_key_trigger" action="deactivate" />
  73.            
  74.             <show asset="rect" />
  75.             <show asset="sg_button" />
  76.            
  77.             <wait />
  78.            
  79.             <hello />
  80.            
  81.             <move asset="rect" x="200px" y="200px" />
  82.            
  83.             <wait />
  84.            
  85.             <choice>
  86.                 <option label="Continue">
  87.                     <var name="main_menu_choice" value="continue" />
  88.                 </option>
  89.                 <option label="Load">
  90.                     <var name="main_menu_choice" value="load" />
  91.                 </option>
  92.             </choice>
  93.            
  94.             <show asset="tb_main" />
  95.            
  96.             <hide asset="rect" />
  97.            
  98.             <globalize name="main_menu_choice" />
  99.             <global name="globals_test" value="worked" />
  100.            
  101.             <line s="n">
  102.                 Your choice: {$main_menu_choice}<br />
  103.                 Your choice as global: {$$main_menu_choice}<br />
  104.                 Globals test: {$$globals_test}
  105.             </line>
  106.            
  107.             <show asset="tb_top" />
  108.            
  109.             <line s="nn">
  110.                 WebStoryEngine Docs: <a href="http://webstoryengine.org" target="_blank">Click here</a>
  111.             </line>
  112.            
  113.             <hide asset="tb_top" />
  114.            
  115.             <line s="n">
  116.                 Localize (before): {$globals_test}
  117.             </line>
  118.            
  119.             <localize name="globals_test" />
  120.            
  121.             <line s="n">
  122.                 Localize (after): {$globals_test}
  123.             </line>
  124.            
  125.             <hide asset="tb_main" />
  126.             <clear asset="tb_main" />
  127.             <trigger name="game_menu_key_trigger" action="activate" />
  128.            
  129.             <goto scene="game_start" />
  130.         </scene>
  131.        
  132.         <scene id="game_start">
  133.            
  134.             <var ifstate="set" name="increase_test" action="print" />
  135.            
  136.             <line s="n" stop="false">
  137.                 Welcome to the WebStory Engine demo!
  138.             </line>
  139.            
  140. <!--             <alert title="A test alert" message="This is a test alert!" /> -->
  141.             <var name="demo_started" value="true" />
  142.             <var ifstate="unset" name="increase_test" value="0" />
  143.            
  144.             <set asset="backgrounds" image="clouds02" duration="0" />
  145.             <set asset="music" track="legend" />
  146.            
  147.             <wait />
  148.            
  149.             <play asset="music" />
  150.             <show asset="backgrounds" duration="500" />
  151.             <show asset="tb_main" effect="slide" direction="bottom" easing="easeOutBounce"  />
  152.            
  153.             <wait />
  154.             <wait duration="1000" /> <!-- Waits another second after all effects are finished. -->
  155.            
  156.             <prompt title="Who are you?" message="Please enter your name:" var="player_name" />
  157.            
  158.              <wait />
  159.              
  160.              <line s="n">Hello, {$player_name}!</line>
  161.            
  162.             <confirm title="Really?" message="Is this really your name? Are you sure?" var="player_name_is_correct" />
  163.            
  164.             <wait />
  165.            
  166.             <prompt ifvar="player_name_is_correct" ifvalue="false" title="What's your REAL name?"
  167.                message="Please enter your real name now. Don't lie! Lies are bad." var="player_name" />
  168.            
  169.             <wait />
  170.            
  171.             <line s="n">Hello again, {$player_name}!</line>
  172.            
  173.             <flash asset="flash" duration="500" />
  174.            
  175.             <wait />
  176.            
  177.             <hide asset="tb_main" effect="slide" direction="bottom" />
  178.            
  179.             <wait />
  180.            
  181.             <show asset="tb_main" effect="slide" direction="bottom" easing="easeOutBounce" />
  182.             <var name="increase_test" action="increase" />
  183.            
  184.             <line s="n">
  185.                 The increase_test variable is {$increase_test}.
  186.             </line>
  187.            
  188.             <flicker asset="flash" duration="2000" times="10" opacity="0.5" />
  189.            
  190.             <wait />
  191.            
  192.             <var name="increase_test" action="decrease" />
  193.            
  194.             <line s="n">
  195.                 Variable decreased. The increase_test variable is {$increase_test}.
  196.             </line>
  197.            
  198.             <stop asset="music" />
  199.             <start asset="anim" />
  200.            
  201.             <sub scene="sub_scene_test" />
  202.             <var name="increase_test" action="increase" />
  203.             <clear asset="tb_main" />
  204.            
  205.             <line s="n">
  206.                 To start, click on the screen or press <b>space</b> / <b>right arrow</b> key.
  207.             </line>
  208.            
  209.             <hide asset="tb_main" effect="slide" direction="bottom" />
  210.            
  211.             <wait />
  212.            
  213.             <show asset="tb_main" effect="slide" direction="bottom" easing="easeOutBounce" />
  214.            
  215.             <line s="n" stop="false">
  216.                 What are you interested in?
  217.             </line>
  218.            
  219.             <choice>
  220.                 <option label="I want to learn more!">
  221.                     <var name="learn_more_pressed" value="true" />
  222.                 </option>
  223.                 <option label="No, thanks.">
  224.                     <var name="learn_more_pressed" value="false" />
  225.                 </option>
  226.             </choice>
  227.            
  228.             <choice>
  229.                 <option label="I want green!">
  230.                     <var name="color" value="green" ifvar="learn_more_pressed" ifvalue="true" />
  231.                     <var name="color" value="red" ifvar="learn_more_pressed" ifvalue="false" />
  232.                 </option>
  233.                 <option label="I like blue!">
  234.                     <var name="color" value="blue" ifvar="learn_more_pressed" ifvalue="true" />
  235.                     <var name="color" value="red" ifvar="learn_more_pressed" ifvalue="false" />
  236.                 </option>
  237.             </choice>
  238.            
  239.             <line s="n">
  240.                 You get this color: {$color}
  241.             </line>
  242.            
  243.             <line s="n" ifvar="learn_more_pressed" ifvalue="true">
  244.                 You want to learn more.
  245.             </line>
  246.            
  247.             <line s="n" ifvar="learn_more_pressed" ifvalue="false">
  248.                 You don't want to learn more, so we gave you red instead! Haha!
  249.             </line>
  250.            
  251.             <goto scene="restart" />
  252.         </scene>
  253.        
  254.         <scene id="sub_scene_test">
  255.             <wait />
  256.             <show asset="fog" effect="slide" direction="right" />
  257.            
  258.             <wait />
  259.            
  260.             <set asset="backgrounds2" image="rainbow" duration="0" />
  261.             <show asset="backgrounds2" duration="0" />
  262.            
  263.             <wait />
  264.            
  265.             <hide asset="fog" effect="slide" direction="right" />
  266.            
  267.             <wait />
  268.            
  269.             <line s="n">
  270.                 Hello from the sub scene!
  271.             </line>
  272.            
  273.             <fn name="savegames" />
  274.            
  275.             <line s="n">
  276.                 A sub scene is a scene that is called from within another scene, but
  277.                 not using the goto command; instead the sub command is used.
  278.             </line>
  279.            
  280.             <line s="n">
  281.                That means that after all of the sub scenes commands have been executed,
  282.                the story continues from the point where the sub scene was called.
  283.             </line>
  284.            
  285.             <line s="n">Let's go even one level deeper...</line>
  286.            
  287.             <sub scene="sub_scene_test_2" />
  288.            
  289.             <line s="n">And now we are back at the first sub scene.</line>
  290.            
  291.             <hide asset="backgrounds2" duration="500" />
  292.         </scene>
  293.        
  294.         <scene id="sub_scene_test_2">
  295.             <line s="n">
  296.                 This line is part of another sub scene called from within the previous sub scene.
  297.             </line>
  298.         </scene>
  299.        
  300.         <scene id="custom_event_scene">
  301.             <line s="n">
  302.                 A custom event has been triggered.
  303.             </line>
  304.         </scene>
  305.        
  306.         <scene id="restart">
  307.             <hide asset="backgrounds" duration="1000" />
  308.            
  309.             <wait />
  310.            
  311.             <clear asset="tb_main" />
  312.             <move asset="backgrounds" x="0" y="0" duration="0" />
  313.             <stop asset="sounds" />
  314.             <stop asset="anim" />
  315.            
  316.             <wait />
  317.            
  318.             <restart />
  319.         </scene>
  320.        
  321.     </scenes>
  322. </ws>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement