Upcoming Events
Unite 2010
11/10 - 11/12 @ Montréal, Canada

GDC China
12/5 - 12/7 @ Shanghai, China

Asia Game Show 2010
12/24 - 12/27  

GDC 2011
2/28 - 3/4 @ San Francisco, CA

More events...
Quick Stats
101 people currently visiting GDNet.
2406 articles in the reference section.

Help us fight cancer!
Join SETI Team GDNet!
Link to us Events 4 Gamers
Intel sponsors gamedev.net search:

Creating Virtual Worlds


Section 4 - Another Brick in the Wall

Okay, but there is still that nasty wall! Let's do some destruction!

$room2 = cell ( name => "Room 2", size => 16, 
  nowall => aNorth(), );                                 # line 1

We just tell room 2 that it shouldn't have a wall at the north side. Well, that won't work like you'd expect. Can you guess why? Because room1 still has its wall at the south side. But if we add nowall => aSouth() to room 1, its entire south wall will be left off. That won't look good, since room 1 is much bigger than room 2 and thus we would have a distorted room 1.

Two solutions:

  • Split room 1 into two rooms, and leave only the wall of the left room off. Not so optimal.
  • Add clobberwall => aNorth() to room 2. This does exactly what we want, it just clobbers up the wall to the northern room 1.
    $room2 = cell ( name => "Room 2", size => 16, 
      nowall => aNorth(), clobberwall => aNorth(), );        # line 1
    


    4: Two rooms, with corner and no wall between them

    That's all! Onwards!



    Doorways to Heaven


  • Contents
      Introduction
      What you need
      How it was...
      A single room
      Two rooms
      Three rooms over the edge
      Another brick in the wall
      Doorways to Heaven
      Redefine the world
      Links, routes, etc.
      More ideas
      Afterword

      Printable version
      Discuss this article