I'm creating a simple maze-like game on my fx-9860GII, but there's one thing taking a huge amount of data and time. The goal of the game is to move a dot (.) between the crosses (X) towards the exit (O). There are also fake exits (looks exactly the same as a real exit). Touching a cross or fake exit adds 1 to the death counter (which decreases your score after completing all of the levels by 2500 per death) and resets the level. Every step you take also decreases 100 from your final score.
The problem is not the positioning of the crosses, (fake) exits and the dot, but the death system is. Level 1 and 2 are respectively 3220 and 5344 in size. They just contain this bit of code, repeated over and over again:
(Everything between {} is either a command I can't type or a number that differs throughout the code and [] are comments)
I was wondering whether there is a more efficient way to do this instead of repeating this (with variations for completing the level and hitting a fake exit). I'm asking because I also recently learned how to get rid of the tracks the dot leaves behind without being required to draw all of the crosses and (fake) exits again per step.
Thanks in advance!