Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm new to Construct 2 and trying to set up a connection with my own WebSocket server. I have communication both ways, but have not yet invoked action in response to input from the server. I currently have Action: Load from JSON string WebSocket.MessageText on Event: WebSocket On Message. I know that the On Message event receives data. What I need to know is how to write the JSON input to get a simple sprite to move right, left, up, down. It's fine if that's based on Keyboard methods, right, left, up, and down arrow. If I am right so far, simply receiving the right JSON string in MessageText should cause the sprite to move appropriately?

share|improve this question
 
What have you tried? –  Seth Battin Sep 9 at 1:19
 
I've done it now. Believe it or not, I just had a problem putting in double quotes. I've done a lot of JavaScript, and you can used single quotes inside double quotes ... but that didn't work out with JSON, at least not in C2. Simply escaping the inside double quotes (that needed to be sent in the string) rather than using singles did the trick. –  Roger F. Gay Oct 4 at 15:47

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.