Is javascript capable if listening for input? If so is it more efficent to listen for keyboard, touch, ect. Input, than it is to check if a variable has changed as the result of input?
Listening for input vs checking for variable change?
Javascript/Plugin SupportWell, I'm sure there's a better explanation for this, but if you're changing a variable by input, aren't you already checking for input? So therefore by checking for input and then checking the variable, you're doing more work, no?
Also depending on the type of variable you're changing, you might need another variable to store the last value so you can compare the two, which would result in even more work and memory storage.
Unless I'm missing something, seems it'd just be easier to just check the input directly. However, if you're checking the same input in multiple different places, then I'm not sure if a variable would be more efficient in that case. but I'm sure it's highly negligible, so whichever way is easiest for you is what can work fine here.
Also depending on the type of variable you're changing, you might need another variable to store the last value so you can compare the two, which would result in even more work and memory storage.
Unless I'm missing something, seems it'd just be easier to just check the input directly. However, if you're checking the same input in multiple different places, then I'm not sure if a variable would be more efficient in that case. but I'm sure it's highly negligible, so whichever way is easiest for you is what can work fine here.
I completely over looked that step when i asked the question. Thank younfor pointing that out.
Original thread: https://forums.rpgmakerweb.com/threads/listening-for-input-vs-checking-for-variable-change.63912/