User Tools

Site Tools


places:progtuti

Programming Tutorial I - Tree backgrounds

You've seen that pretty background that you sometimes get in the jungle. You know, the one with all the trees in silhouette. Nice, isn't it? You've got a garden in your Place, and having that as a background would really help set the scene. That's what this page will help you do.

Remember what we said in the Introduction, Contraptions do things, and in this case you need a 'Tree Shadows' Contraption. You need to use this in a program for your garden. So make sure that you've got a 'Tree Shadows' Contraption in your backpack, click on Programs from anywhere in your Place, and then click on the Room where your garden is described. There's your Logic Grid for that Room. Rename it as something like: 'Trees in garden' so you can find it again easily.

<note tip>Contraptions (and Contrivances) have to be in your backpack to be used. You cannot access them directly from a Place's inventory while looking at the Logic Grid. But if you decide not to use it, don't forget to put it safely back in a Place inventory before you go Drive hunting! </note>

Beneath the Grid there is a list of all the Contraptions and Contrivances in your backpack. Click on the 'Tree Shadows' Contraption. The Contraption will be moved from your backpack and appear to the right of the Logic Grid. Click on the top left square in the Grid and the Contraption will be moved there.

Don't worry about that “Any-Pass” dial there yet. Leave it as it is. We'll come on to those later.

It should look like this:

Making tree shadows appear.

And that's all. Well done. You've just achieved your first bit of programming. Now go into the room and spend a little while admiring it.

<note> Note for budding programmers

You've been introduced to your very first Contraption. Wahay! What you've seen here is that Contraptions do things. If you want a Contraption acting on a Room in some way, then put it in a program for that room.</note>

Lighten the background a bit.

You're busy admiring your handiwork with the tree background, but then you remember something. It said on the description of the 'Tree Shadows' Contraption that this works best when used with the 'Page Lighter' Contraption. Well let's go for that shall we?

Get a 'Page Lighter' Contraption in your backpack and go and have a look at your program again. Put this new Contraption in the Logic Grid next to the one already there, click on the Contraption and then on the square in the Logic Grid. It should look like this:

 Tree shadows on a lighter background.

Now go back and look at your garden again. There, that's better. A nice, light, tree filled garden. How lovely.

<note> Note for budding programmers.

What you've learnt here is that you can have more than one Contraption in a program. Put two together, and the program will do one and then the other. Also, you've reinforced that Contraptions do things.</note>

It may occur to you to wonder if it matters if you put the second Contraption beside or below the first one. Good question! For now it doesn't matter. We'll talk more about that later. For now just remember to not leave an empty line between them.

Exercises to think about.

i) Suppose you have a fountain somewhere in your Place, and you'd like to have light 'raindrop' splashes as a background graphic. How would you go about that?
hint: There are two 'raindrop' Contraptions, 'Rain' and 'heavy rain'.
ii) Suppose that you have an underground waterfall, and you'd like to have fairly heavy 'raindrop splashes' as a background graphic. Also, it's pretty dark down there. How would you go about this?
hint: There are two levels of darkness Contraptions, 'Page Darker', and 'Page Darkest'. Which one you use is a matter of taste.

Go to next tutorial.
Tutorial Contents Page
Return to Introduction to Programming.
Return to Places Overview.

places/progtuti.txt · Last modified: 2023/11/21 18:04 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki