Copy link to clipboard
Copied
Gane was designed in flash to accept user input from keyboard arrow keys. When published to Android, the user has no way to manipulate objects. I'm new to Animate CC or Flash, and I would like some ideas on how to make my game work. Ideally I would like to move objects around by touching the mobile's display. An suggestions would be greatly appreciated.
Thanks so much,
‌
Copy link to clipboard
Copied
Hi,
You can use code as below:
function movePlayer(e: Event): void {
player.x = stage.mouseX;
//Doesn't go off the right or left side
if (player.x < 0) {
player.x = 0;
} else if (player.x > (stage.stageWidth - player.width)) {
player.x = stage.stageWidth - player.width;
}
}
Such type of handling in code allows us to move object by touching the mobile's display.
Thanks,
Adobe AIR Team
Copy link to clipboard
Copied
Thanks so much,