Inventory and rooms complete

You can officially move from room to room now. It took forever to implement because I realized that not only does the door element have to store the information for the next room, but it has to sync up with whatever door you’ll be coming out of in the next room. Doors now have ids, titles and classes to account for all this. Here’s a comment I made to myself when writing the door code:

Rules for creating new rooms/doors: you must have the following classes: exit, roomX, and door-XX. The roomX is the room number the door leads to, and the door-XX corresponds with the connecting door in the next or previous room.

Inventory is also done. When an element you interact with has a class of “mobile”, it grabs the element from the room and puts it in the first empty inventory li and strips the positioning information. Then it sizes it down and centers it. I might have to change the sizing code since if the object’s width and height are bigger than they should be it will only account for one dimension. I don’t think I’ll have an objects that will be that big though.

Leave a Comment

Name: (Required)

E-mail: (Required)