Programming language: Pseudocode
In my program there will be (among others) two variables, called varX and varY. They will have only positive values, but they may be of varying length. They will represent the players position. When the player says that he wants to go 1 left, the program should check first if varX = (varX + 1),varY is an obstacle.
So I had thought that there would be a file containing all the impassable coordinates. Is there any way of having a file that can be read or written to very fast, containing the values for varX and varY that are obstacles? Something like a file full of paired numbers representing coordinates, in which the program would search, and if a pair in the file would be similar to varX + 1 varY (for 1 left move), then the program would not allow the player to move there.
What bothers me is that entities in the game that would move would be unpassable, too, so their new position coordinates should be added to the file, whilst their previous position, currently freed up, should be erased from the file...
Well, I hope you understand me, for I am as bad at explanations as it gets.