I'm trying to develop a fairly flexible routine to move text and images around a screen as part of a games library. There's a whole bunch of params that can be used so the position part might have X & Y and optionally a starting X & Y or perhaps no position info in which case it goes in the centre of the screen or perhaps it might reference one of the items on screen in which case the message will get printed near by. I have similar options on movement and timings and colours plus other random stuff. I don't want to have a single method with a 100 params. I tried defining different versions of the method that used different sets of params but I'd end up with 100's of methods instead. Today I started experimenting with passing a number of variable length arrays for the position, movement and timing info. This looked like a viable solution but
Is there a way of writing it like (A) that I'm missing?
Is there a better approach altogether?
The problem with (B) is that it looks messy and I'm not sure whether defining and creating all these arrays is efficient as it's used in various real time games.
Thanks for reading