Monsters, Flying and Levitation

Q. What’s the difference between a bat and a rat?

A. A bat is a flying rat, but in essence behave like a rat (in essence)



When faced with a pit or trap or other obstacle, the rat can’t go any further, but the bat should be able to flap on regardless.

So… How would we code this?

Add a Levitate variable, default is false, levitating = true
if levitating then don’t check for pits, (I suppose ground based things like traps, water, etc) etc

– this way any movement is the same, we just don’t check it

So a bat is the same as a rat – but it has levitate as true

There is also something to note here. If we now have a levitate option. This can be used on any monster and also you – meaning you have a levitate spell, allows access to areas you couldn’t previously get access so (e.g over lava or a big pit).

Of course you could use a levitate var:

0 = no levitate
0 is levitate (decreasing by 1)

this would mean you now have a timed levitate option…


Things and Items

Screen Shot 2014-05-26 at 08.44.50

Here we can see some boxes of different sizes – these are things

What are items? Items are generally smaller things that you can pick up – gold, food, etc are items – they also have no height so you can walk over them.

Things can have height, so you can walk over them.

you can pick up small things like small boxes (only one at a time and move it – lowering your strength)

Each map cell has provision for 1 thing and 1 item.


What is a trap?

A trap is a variable on the map. < 0 and it is a hidden trap > 0 it is a visible trap

if we block our traps by 10 we can have 10 visibilities or styles of trap, so…

firetrap + 0 is very visible
firetrap + 1 is visible
firetrap + 3 is not so visible, etc

How do we check a trap?
When you draw a cell, if your man/monster position is the same as the cell then the trap is sprung:

Screen Shot 2014-05-25 at 08.06.23 Screen Shot 2014-05-25 at 08.06.44

in the above you can also see a particle ray of light, some twinkles and particle flame for the trap.

The light ray and twinkles highlight something nice that you probably want – bait the trap 🙂