as a teacher I wanted to create an Among-Us-like-Game where my students have to do tasks to save a computer but there is a virus who deactivates them. My special idea: I can upload my own tasks with a JSON Document, so they have to do some maths e.g. to win the game.
Now everything works fine with a keyboard but many of my student just have smartphones and I’m struggeling with implementing mobile controls. The movement works by clicking on the edges of the screen. But I can’t implement a touch-zone which imitates clicking the spacebar.
All I want to do is adding a zone in the bottom right corner that triggers cursors.space.isDown. So there should be no difference if you hit the spacebar or click in the bottom right corner to start the taskScene, deactivate a player etc. Reminder: All that works already with onOverlap and the spacebar.
I would be so happy about some suggestions? I did all the hard work with many many tutorials and online threads but can’t find a solution for this easy sounding problem
Is there an easy way to connect both? I couldn’t find the term to ask at the station, if the pointer and or space is down. Can I just call startTask() instead of the console.log in the interactive zone? There are some more functions like deactivating and reporting a deactivated player. So I think it’s not possible to start all these functions every time I press the zone.
I can’t get rid of the feeling that the answer is too obvious for my twisted mind and too easy to google the problem.
Believe me I know how hard it is to do online classes with students so no worries
Aight after checking your code a bit I can tell:
this.zone_space.setInteractive();
this.zone_space.on('pointerdown', () => {
// you can use it like this.
// You just need to find which `zone` selected
this.startTask(this.container, ?selectedZone);
// maybe find the zone by checking if player on top of any of the zones?
})
In this way startTask function should work for both ways