FLATLAND TUTORIAL Flatland home
texture styles orientation guide tips,tricks more blocks actions sprites popups lighting sound linking orientation textures navigation mulitilevels body tag head tag starting welcome
8 | THE <CREATE> TAG: ORIENTATION

In addition to changing textures, the <CREATE> tag can also be used to change the orientation of a block, or turn it to face another direction.

Orientation is accomplished by specifying two different values. First, you specify what direction you want the TOP of the block to face (up,down,north,south,east,or west). Then you specify an angle of rotation around that axis.

Lets look at a new block called the CURVEIN block, and turn it around to see how orientation works.

NEW BLOCKS
The CURVEIN Block ":"

The CURVEIN block looks like a FULL block that has been "scooped out" to be concave on the top and south sides.

Now if you want to turn the CURVEIN block around so that the scooped out side faces the top and north, you would use the following tag:

<CREATE SYMBOL="A" BLOCK="curvein">
<PARAM ORIENT="up,180"/>
</CREATE>

Now every time the browser encounters an "A" in the map, it will take a CURVEIN block, leave its top pointing "up", and turn it 180 degrees clockwise, (around the Y axis) making the curved side of the block face up and north.

Now, if you were standing to the south of a CURVEIN block, and you wanted to tip it over to the right, so its top faced east, you would use this code:

<CREATE SYMBOL="A" BLOCK="curvein">
<PARAM ORIENT="east,0"/>
</CREATE>

So Rover will make the top of the block face "east", and will rotate it "0" degrees around that axis.

Now imagine that you want the "scooped out" part to face down and east. You'll need to point the top of the block towards the "east", and then rotate "270" degrees. That is a 270 degree clockwise rotation, if you were looking at the original top of the block, which is now pointing east.

Rotation is limited to values of 0, 90, 180, or 270. Rotation is always clockwise around what was originally the y axis. Imagine that you are standing on the top of the block, and you remain there as the block is tilted to the "east". You are now standing on the east side of the block, looking at what used to be the top of the block. The rotation will take place in a clockwise direction from where you are standing. Having a physical block to play with on your desk may be of some help. Here are some examples to help you visualize all this topsy turvy-ness.

Without any rotation, blocks are designed to look "right" to a visitor who is facing north. This is just a general rule that hopefully will make building a little easier. For instance, the CURVEIN and CURVEOUT blocks both have their curves on the south side, so that you can see them when you are facing north. The front door of the house blocks (in the Village Blockset) all face south, so that they look correct to a visitor who is facing north.

A Note about Ramps

In the Basic Blockset, we have gone ahead and provided north, south, east and west orientations of the Ramp blocks, just to make life a little easier. So to get a ramp that goes up to the south, you can just use the SRAMP Block, rather than having to use an ORIENT tag on an NRAMP block.

Change the orientation of a block
First, lets just put a few different CURVEIN blocks in your spot just to see how they work.

Add the following code just after the <BODY> tag in tallspot.3dml:

<CREATE SYMBOL="A" BLOCK="curvein">
</CREATE>

<CREATE SYMBOL="B" BLOCK="curvein">
<PARAM ORIENT="up,90"/>
</CREATE>

<CREATE SYMBOL="C" BLOCK="curvein">
<PARAM ORIENT="down,0"/>
</CREATE>

<CREATE SYMBOL="D" BLOCK="curvein">
<PARAM ORIENT="west,90"/>
</CREATE>

And change Level 1 of tallspot.3dml to look like this:

<LEVEL NUMBER="1">  
###..D###  
#.......#  
##...C..#  
##......#  
#K...B..#  
#h......#  
#k...A..#  
#.......#  
#########  
</LEVEL>  

Orienting your spot. Save the file and open it in your browser. Take a look at how each orientation tag changed the different CURVEIN blocks.

Show me the code so far

Making orientation useful
Now lets do something useful with this orientation nonsense:
Go back to the four <CREATE> tags for blocks A,B,C, and D, and change them to look like this:

<CREATE SYMBOL="A" BLOCK="curvein">
<PARAM ORIENT="east,0"/>
</CREATE>

<CREATE SYMBOL="B" BLOCK="curvein">
<PARAM ORIENT="west,0"/>
</CREATE>

<CREATE SYMBOL="C" BLOCK="curvein">
<PARAM ORIENT="north,90"/>
</CREATE>

<CREATE SYMBOL="D" BLOCK="curvein">
<PARAM ORIENT="north,270"/>
</CREATE>

Change Level 1 of tallspot.3dml to look like this:

<LEVEL NUMBER="1">
###...###
#A.....B#
##......#
##......#
#K......#
#h......#
#k......#
#D.....C#
#########
</LEVEL>

Orienting your spot. Save the file and open it in your browser. The room should now have nice curved corners.


code spot next

 



Copyright 1999, 2000 Flatland Online, Inc.