I'm looking into developing a sidescroller style game in Storyline.
I've been able to set up a scenario where the player moves left and right when the user presses those keys on the keyboard.
Is it possible to configure the triggers in any way (or by any other method) to enable the user to hold down the key to continue walking? So that they don't have to press a button repeatedly in order to move forward?
I don't think there is. I tried doing that in the comet landing scene in my Guru Entry but Storyline doesn't recognize "holding down" a key, just the press and letting go. I thought it might be possible using javascript but I didn't dig to deep on that.
I'm wondering if there is something you can do by using a down state or something. But there isn't really a "While" construct in the triggers that could accommodate that.
Hi, James -- Thanks for your question! While I will defer to your fellow community members to weigh in with some design ideas you can try, I also wanted to mention that you are welcome to post your question over in our Building Better Courses forum, as well.
I'm considering looking into this. I'm redesigning all of my company's compliance courses, I don't know much javascript but it's a huge project for me and I'd love to have this kind of functionality.
There is a key down and key up event in javascript you can use. You can use these to change variables in storyline and set up triggers to respond to these changes.
If you are using motion paths to move the character left and right, to loop the movement you should have it repeat the motion if the keydown variable is "true".
Hi, James -- I just thought I'd share in case you were considering using JavaScript as Jerson mentioned, that is not something for which we'd be able to provide support, but there are lots of gurus here in the community who are usually more than willing to assist. And if you wanted to check it out, here is our JS Best Practices sheet. :)
10 Replies
I don't think there is. I tried doing that in the comet landing scene in my Guru Entry but Storyline doesn't recognize "holding down" a key, just the press and letting go. I thought it might be possible using javascript but I didn't dig to deep on that.
I'm wondering if there is something you can do by using a down state or something. But there isn't really a "While" construct in the triggers that could accommodate that.
Hi, James -- Thanks for your question! While I will defer to your fellow community members to weigh in with some design ideas you can try, I also wanted to mention that you are welcome to post your question over in our Building Better Courses forum, as well.
I'm considering looking into this. I'm redesigning all of my company's compliance courses, I don't know much javascript but it's a huge project for me and I'd love to have this kind of functionality.
I'll let you know if I find a solution using JS!
Many thanks Christie, I've posted it there as well. Fingers crossed!
There is a key down and key up event in javascript you can use. You can use these to change variables in storyline and set up triggers to respond to these changes.
If you are using motion paths to move the character left and right, to loop the movement you should have it repeat the motion if the keydown variable is "true".
Hi, James -- I just thought I'd share in case you were considering using JavaScript as Jerson mentioned, that is not something for which we'd be able to provide support, but there are lots of gurus here in the community who are usually more than willing to assist. And if you wanted to check it out, here is our JS Best Practices sheet. :)
Keydown event is inconsistent across browsers you may want to use a library like Keydrown
https://jeremyckahn.github.io/keydrown/
Yay! I knew there would be a solution. Looks like it's time for me to learn javascript :) Many thanks Jerson!
I've just tested the example on that page and I can see why it's important. Will definitely try and incorporate this - thanks a lot Phil.
This discussion is closed. You can start a new discussion or contact Articulate Support.