Hi there Hikaru!! Welcome to DIV-ARENA :D
Okay, well as far as I can tell, Adherbals Wolfenstein 3D remake uses two techniques. One for collisions, another for the walls themselves.
For the walls themselves - they are rows of narrow sprites. This is why they appear jagged at the edges, zig zagging sort of, it's because theyre
turning to face the camera when you move, as sprites do :p these sprites are so close together that you can't see between them, this is done in a long
row.
And for the collisions with those sprites - I believe it's likely to of been done using a hardness map. So, what this will mean is that the
player/camera process will constantly refer to a graphic stored in the memory every frame, and will check what colour is beneath it. This will be sort
of like a permissable/non-permissable areas map for the player. If the colour beneath the player is a certain colour, then the player will be reset to
their last X and Y coordinate, which is easy enough to do (just put old_x=x; old_y=y; just after the main LOOP in the player/camera process, and then
use " if (get_map_pixel(x, y)==whatever the colour is) x=old_x; y=old_y; End " below it.
Then, each one of the sprites in the sprite bar probably places a block of that specific colour on that graphic in the memory.
You could also use the same technique to create areas with water, areas that turn on alarms, or open doors, etc. Hardness maps + mode 7 work really
well together :D
Happy coding!!!
/BC
[Edited on 22-12-2016 by BreadCaster] |