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…
Here you can see the world rotating around the central figure.
It’s just simple 2D x,y rotation with a quad texture filler.
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.
All good dungeon have secrets. but how do we find these secrets?
Here we can see a secret door…!
How do we know it’s secret, because some mist is seeping through the secret door
The wall height has been increased (by a factor of 0.5) and walls above doors added
Feedback suggested that the walls didn’t look solid, but paper thin Blocks have been added to the tops of walls to give them some depth
All of this is just simple pre-calculations, moving from 2d to 3d would give more freedom
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:
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 🙂
Here’s a nice debug view showing the day/night cycle – looks like it’s nearly midday?
As it’s a cave dungeon, there is no light apart from light from torches.
On the right you can see the debug lightmap with the two torches (and your position – in green) visible.