tiistai 29. tammikuuta 2013

Now We Have Some Items in the Game World


Good evening, dear readers! I'm pleased to announce that Shiver Me Timbers has progressed a bit. I have now finished a rather essential part of the game engine - picking up items and showing the items that you're carrying on the status bar on the top of the screen. It shouldn't take long to get to the next phase - defining the exit blocks for the room. :)

Items and their effect on the game world

As I wrote in the previous part, items have an important role in an arcade adventure. Most puzzles involve you having the right item or items in order to progress further in the game. For example, if there's a dark room in the game, then a logical (And typical) solution for that is to have a torch in your inventory. If the room that is now lit turns out to be a shooting gallery (Example taken from Herbert's Dummy Run ;) ), then you should also have a slingshot with you (That example also from HDR :) ). That is an example of a puzzle where two items are needed.

John wanders about in an almost empty test room.
Above is a screen for which I've created three test items, just to test the item routines. What is that second inventory item, you ask? Hmmm.. don't know really, perhaps a miniature version of the MAD Productions logo? :)

Some items require you to have an another item in order to be picked up. In Pyjamarama, you need to have THE POUND COIN to get THE PENNY from the change machine.
Things could be arranged like this in the 0 page:
02 = Item 1 that you're carrying
03 = Item 2 that you're carrying
04 = Item in the current room
05 = Item required to pick up the item in this room

Our example items could be represented by the following values:


Since item 01 is required to get item 02, address $05 would have the value $01. When our guy is about to pick up the item, addresses $02 and $03 will be checked - either one of them should contain 01, otherwise nothing will happen.

If we have an item such as 03 (THE DOOR HANDLE), we don't need anything to pick it up so $05 is 00 in that case.

What's up next?

As I mentioned earlier, the next phase in our game could be coding the exit blocks for the rooms. An exit block is a block that takes the protagonist to a different room when touched.

Demonstration of an exit block.

A typical location for an exit block is the handle of a door. Sometimes this door can be locked, so we might need an item named THE KEY in order to enter it.

But I shall discuss this topic in more detail in the next blog update. Until then! Thanks for reading!

Ei kommentteja:

Lähetä kommentti