google / blockly-games

Games for tomorrow's programmers.
https://blockly.games/
Apache License 2.0
1.29k stars 605 forks source link

Multiplayer - editable: true #230

Open SmileImagine opened 2 years ago

SmileImagine commented 2 years ago

For use with my students, I'd love a web-hosted version of Pond where student-coded ducks could compete. I've built a local copy on my personal computer and simply set the 'editable' attribute to 'true' in the 3 bot avatars in ducks.js, and that works pretty well, but it has to be hosted for my students. I haven't been able to get an edit of the file using DevTools to stick – I'm sure there's an obvious reason, but I'm a noob. Would it be possible to offer an option to select a ducksMultiplayer.js file where all four avatars are editable? It would dramatically enhance usability in the classroom.

timarcosdias' forked, hosted version doesn't support ES6, which is essential for me.

Thank you!

SmileImagine commented 2 years ago

Ah, just figured out how to use DevTools Overrides to edit the ducks without building the whole game. Still, multiplayer would be a gamechanger.

cpcallen commented 2 years ago

Multiplayer support is very definitely on the roadmap.

Darkry commented 1 year ago

@SmileImagine Hi! I am also using this with students and would love multiplayer - but I'm no expert in JS and the libraries used here. Could you give me a quick help with how can I build my own version locally? Just like you, I found the 'editable' attribute and changed it for the bot avatars but then I am not sure how to build it. Thanks!

SmileImagine commented 1 year ago

@Darkry no need to build it! Just use the Overrides feature of Chrome DevTools or a similar feature in another browser. Open blockly pond, open the inspector, browse through the filesysem to find the ducks.js file, right click and select "save for overrides". This will locally save a copy of the file. Then go to the overrides tab, modify the three ai ducks so that the "editable" attribute is set to "true" for each duck you want to edit, save the file, reload the page, and then you'll be able to edit the code of the three other ducks. Let me know if it works!

Darkry commented 1 year ago

@SmileImagine That's amazing, thanks for the tip! It works great!

romw314 commented 11 months ago

How about adding a Multiplayer checkbox.