Differences

This shows you the differences between the selected revision and the current
version of the page.


wmebook:ch4 2008/01/10 11:51 wmebook:ch4 2008/01/10 11:56 current
Line 38: Line 38:
By default you have the preset behavior that if you right click on a hotspot, little menu appears where you can choose from three actions. **Now do me a favor and delete those two lines.** We’ll try to go barebones. By default you have the preset behavior that if you right click on a hotspot, little menu appears where you can choose from three actions. **Now do me a favor and delete those two lines.** We’ll try to go barebones.
-But you may ask, what is a window? Window is a collection of graphical items (buttons, images, edit fields for textual input) which is very practical for forming GUI (graphical user interface). The big advantage is that it’s Scene independent so you can have it on screen for every scene without explicitly forming the elements every time. We’ll look on the windows building later, so let’s focus for now what those two lines mean. First loads a window file (which contains a definition of the graphical window) and second set it invisible. The window is attached to the Game object so scene changing can’t affect it. Note that windows are an exception. Entities use //Active//, Windows use //Visible//.+You may ask, what is a window? Window is a collection of graphical items (buttons, images, edit fields for textual input) which is very practical for forming GUI (graphical user interface). The big advantage is that it’s Scene independent so you can have it on screen for every scene without explicitly forming the elements every time. We’ll look on the windows building later, so let’s focus for now what those two lines mean. First line loads a window file (which contains a definition of the graphical window) and second sets it invisible. The window is attached to the Game object so scene changing can’t affect it. Note that windows are an exception. Entities use //Active//, Windows use //Visible//.
<code script> <code script>
Line 65: Line 65:
Now those are important lines. Variable “actor” is a global variable defined in base.inc which will now be filled with the definition of our .actor file. Again later on we’ll look how the actor files are constructed. For now let’s live with the fact that we have molly and she can do whatever we want. Now those are important lines. Variable “actor” is a global variable defined in base.inc which will now be filled with the definition of our .actor file. Again later on we’ll look how the actor files are constructed. For now let’s live with the fact that we have molly and she can do whatever we want.
-Also as a side note, we can use second function **Scene.LoadActor(actor);** which loads the actor but attaches it to the current scene and so the actor is destroyed when you leave the scene.+Also as a side note, we can use second function **Scene.LoadActor(actor);** which loads the actor but attaches it to the current scene and cthe actor is destroyed when you leave the scene.
Last we set up the attribute **MainObject** to our freshly loaded actor, which does the only thing – when actor moves and the scene is supposed to scroll, the scrolling is oriented to this actor. In case there were more switchable actors (like for example in Day of the Tentacle) this attribute will provide correct scrolling for selected character. You can set also null to this attribute. Last we set up the attribute **MainObject** to our freshly loaded actor, which does the only thing – when actor moves and the scene is supposed to scroll, the scrolling is oriented to this actor. In case there were more switchable actors (like for example in Day of the Tentacle) this attribute will provide correct scrolling for selected character. You can set also null to this attribute.
Line 214: Line 214:
</code> </code>
-Now test the game and you’ll see that it’s still running although we made quite some changes to it. And as we want to continue boiling our example game down to the necessary minimum, we need to look at the **game_loop.script** as well.+Now test the game and you’ll see that it’s still running although we made quite some changes to it. And as we want to continue boiling our example game down to the necessary minimum, we need to look at the **game_loop.script** (formerly named game_daemon.script) as well.
<code script> <code script>
 
wmebook/ch4.1199962312.txt.gz · Last modified: 2008/01/10 11:51 by metamorphium
Recent changes RSS feed Creative Commons License Driven by DokuWiki