I'm assuming it's a problem with how Superpowers integrates with it all because using anything else with cordova seems to work,I really wanna add in some of those plugins :(
NinjaDJ
Recent community posts
Hey, is there anyway to decrease the load time on mobile devices? I'm running on a high end Android device and the splashscreen lasts a good 20 seconds... Is it just the way the engine is being loaded?
If I can't increase the time is there anyway I can switch splashcreens midway to make it seem like something is going on?
It's me again! I was just wondering how I could monetize my game? This would be through banner ads, full screen ads and possibly in app purchases. I'm assuming Cordova would be used but then I'd have to use this after exporting it in XDK but then how could I, for example, run an in app purchase after clicking a specific button? I'm just confused on how to add logic to display my ads at certain points before exporting it.
Any help would be appreciated!
It still doesn't work, this is my code
declare let document;
let inGameMusicPlayer = new Sup.Audio.SoundPlayer("Sound", 1.0, { loop: true });
class MouseCoordsBehavior extends Sup.Behavior {
update() {
// Mouse coordinates returned by .getMousePosition() are normalized to (-1, 1)
let { x, y } = Sup.Input.getMousePosition();
x = (x + 1) / 2 * Sup.Input.getScreenSize().x;
y = (1 - (y + 1) / 2) * Sup.Input.getScreenSize().y;
this.actor.textRenderer.setText(`X = ${Math.round(x)}\nY = ${Math.round(y)}`);
if (x >= 0 && x <= 170 && y >= 0 && y <= 170 && Sup.Input.wasMouseButtonJustReleased(0)) {
this.actor.textRenderer.setText("OMG BUTTONS");
handleVisibilityChange();
}
}
}
Sup.registerBehavior(MouseCoordsBehavior);
function handleVisibilityChange() {
if (document.hidden) inGameMusicPlayer.pause();
else inGameMusicPlayer.play();
}
document.addEventListener("webkitvisibilitychange", handleVisibilityChange, false);