• Content Count

  • Joined

  • Last visited

Everything posted by Doyban

  1. @Noel tried there as well and basically Firebase might give a little delay based on the answers there (not too many though). Wanted to try different source to compare opinions, tried also Stack Overflow, but completely nothing there. In terms of solution it seems to be Colyseus will be the preferred choice.
  2. Planning to develop 1 realtime multiplayer game, which would target Facebook Instant Games with further possibility to extend this into Cordova-wrapped Android/iOS app. The FPS must be rather high, as half second of a delay in the could influence the final battle result. Therefore, for the backend wondering between Firebase, or Colyseus and looking for an opinion of someone experienced with that topic what would perform best for this scenario.
  3. With exactly the same codebase I have perfectly working Facebook events on Android. However, on iOS it doesn't works. I'm using for this and tried to set some alerts to see the error code or something (note `alert` in the code, for debugging purposes), but there is no action. In essence, I can't see any error, it just doesn't works. The following code: this.options = { method: 'apprequests', message: 'Play YellowSidd with me!' }; this.onSuccess = function(result) { alert("Success with invite, result: " + result); }; this.onError = function(msg) { alert("Failed with invite, msg: " + msg); }; facebookConnectPlugin.showDialog(this.options, this.onSuccess, this.onError); In the Xcode in Build Phases -> Compile Sources I do have FacebookConnectPlugin.m. In Build Phases -> Link Binary with Libraries I do have also the following: libsqlite3.dylib (added by me), Security.framework (added by me), Accounts.framework (added by me), Social.framework (added by me). Also, the FBSDKCoreKit.framework, FBSDKLoginKit.framework and FBSDKShareKit.framework. These last 3 were already in that project.
  4. After successful delivery In-App Purchases (IAPs) on Android using Apache Cordova and I can't get it working properly on iOS. The problem is that once the item is clicked the price shows its details etc., but if use clicks "Cancel" then the user can't purchase anything anymore. Unless restarting the game, as far as I'm aware I should handle rejection/cancellation events. Tried these, but so far no success. This is how I was trying to handle these events (rejection/cancellation), including playing with store.refresh() in different locations of the code and without it as well: // Handle rejection and cancel events. store.when("com.XX.YY.gems5").rejected(function(order) { store.refresh();"GemsState"); store.refresh(); }); store.when("com.XX.YY.gems5").cancelled(function(order) { store.refresh();"GemsState"); store.refresh(); }); Code, which correctly works on Android (the handling wasn't required there in order to work properly): 'use strict'; var that = this; // Prepare product. store.register({ id: "com.XX.YY.gems5", alias: "Gems 5", type: store.CONSUMABLE }); // Purchase product. store.order("com.XX.YY.gems5"); store.refresh(); store.when("com.XX.YY.gems5").approved(function (order) { order.finish(); store.refresh(); // Add extra gems. localStorage.gems = parseInt(localStorage.gems) + 5; // Add 5 gems.; // Play upgrade sound."GemsState"); that.menu_items[1].select(); // Select second item. }); I'm using Phaser 2 & ES5.
  5. Is it possible to make Firebase working on apps compiled by Cocoon? Followed tutorial, tested on the device with error that cordova-plugin-inappbrowser is not installed. Tried to many plugins, all of those which are available throughout “Plugins” in Cocoon’s developer account. Really it seems to be there is actually NO plugin, which can handle Firebase for Cordova, really?! Some of them had issues during complication, some of them after - including cordova-plugin-inappbrowser. Errors after compilation with error “cordova-plugin-inappbrowser is not installed”: @d2d/cordova-plugin-inappbrowser @types/cordova-plugin-inappbrowser cordova-plugin-inappbrowser-progressed cordova-plugin-inappbrowser-custom cordova-plugin-auth-dialog cordova-inappbrowser appgn.plugin.custominappbrowser appgn.plugin.customappbrowserbeta2 archriss-cordova-inappbrowser-ios archriss-cordova-inappbrowser-android Errors during compilation: com.brainfall.cordova-plugin-inappbrowser custom-inapp-browser-plugin cordova-plugin-sscinappbrowser cordova-plugin-inappbrowser-wkwebview cordova-plugin-inappbrowser-popup-bridge cordova-plugin-inappbrowser-orcas cordova-plugin-inappbrowser-notification cordova-plugin-inappbrowser-location-editable cordova-plugin-inappbrowser-engage-irishferries cordova-plugin-inappbrowser-engage-if cordova-plugin-inappbrowser-engage cordova-plugin-inappbrowser-bypassssl cordova-plugin-inappbrowser-adv cordova-plugin-ete-inappbrowser cordova-fork-inappbrowser-allow-all cordova-customplugin-inappbrowser com.taxiapps.cordova-plugin-inappbrowser com.shoety.cordova.plugin.inappbrowserxwalk com.dt-workshop.inappcrossbrowser
  6. Found temporary solution, the problem is actually I won't destroy the player in most cases, as once the player dies the most often times the gameplay (not whole game) is restarting, only after reaching some point in the game there is classical "Game Over" with possible back to menu, it took me too many hours already, I think will stay with that solution, at least it works. For others, if you'd have similar issues, maybe just in my case architecture is hard-coded already, and would need to change too much, including idea. // WORKING this.stick.visible = 0; this.buttonFireball.visible = 0; // OLD, THROWING AN ERROR // this.stick.destroy(); // this.buttonFireball.destroy();
  7. I tried to destroy it in many places, I see a hope that you know what can be wrong, I'm gonna to send you a bit longer code. Player.js YellowSidd.Player = function (game_state, name, position, properties) { ... this.pad =; // Initialize VirtualJoystick Plugin. this.stick = this.pad.addStick(60, 340, 45, 'generic'); // Add stick for Virtual Joystick. }; YellowSidd.Player.prototype.update = function () { "use strict"; // Check player collision., this.game_state.layers.collision); // Layers collisions., this.game_state.groups.enemies, this.hit_enemy, null, this); // Enemies collisions. // The player automatically dies if in contact with invincible enemies or enemy fireballs., this.game_state.groups.invincible_enemies, this.die, null, this);, this.game_state.groups.enemy_fireballs, this.die, null, this); if (this.stick.isDown) { // console.log(this.stick.forceX); if (this.stick.forceX >= 0) { // TODO: HERE IS THE ERROR // Move right. this.body.velocity.x = this.walking_speed; this.direction = "RIGHT"; this.scale.setTo(1, 1); } else if (this.stick.forceX < 0) { // TODO: HERE IS THE ERROR // Move left. this.body.velocity.x = -this.walking_speed; this.direction = "LEFT"; this.scale.setTo(-1, 1); }'walking'); // Play walking animation. // Play sound only if player button sound is as "on" mode. if (PLAY_SOUND) {; // Play walking sound. } if (this.body.blocked.down) { this.body.velocity.y = this.stick.forceY * this.jumping_speed; // TODO: HERE IS THE ERROR AS WELL // Play sound only if player left button sound as on mode. if (PLAY_SOUND && this.stick.angleFull > 210 && this.stick.angleFull < 330) {; // Play jump sound. } } } else { // Stop. this.body.velocity.x = 0; this.animations.stop(); this.frame = 3; } // Dies if touches the end of the screen. if (this.bottom >= { this.die(); } } YellowSidd.Player.prototype.die = function () { "use strict"; this.lives -= 1; this.shooting = false; // Destroy VirtualJoystick elements. this.stick.destroy(); this.buttonFireball.destroy(); // Play sound only if player left button sound as on mode. if (PLAY_SOUND) {; // Play lost heart sound. } if (this.lives > 0) { this.game_state.restart_level(); // Player lost 1 life, but still have more then 0, so restart level eventually checkpoint. } else { this.game_state.game_over(); // Player lost all lives then game over. } }; TiledState.js (for restart_level and game_over methods) YellowSidd.TiledState.prototype.restart_level = function () { "use strict"; // Restart the game only if the checkpoint was not reached. if (this.prefabs.checkpoint.checkpoint_reached) { // Respawn the player in the last reached checkpoint. this.prefabs.player.x = this.prefabs.checkpoint.x; this.prefabs.player.y = this.prefabs.checkpoint.y; } else { localStorage.removeItem('heart_plus_one_once'); // Remove heart_plus_one_once from localStorage. localStorage.removeItem('jump_plus_one_once'); // Remove jump_plus_one_once from localStorage. localStorage.removeItem('speed_plus_one_once'); // Remove speed_plus_one_once from localStorage., false, this.level_data); // Restart TiledState state. } }; YellowSidd.TiledState.prototype.game_over = function () { "use strict"; localStorage.removeItem('heart_plus_one_once'); // Remove heart_plus_one_once from localStorage. localStorage.removeItem('jump_plus_one_once'); // Remove jump_plus_one_once from localStorage. localStorage.removeItem('speed_plus_one_once'); // Remove speed_plus_one_once from localStorage.'BootState', true, false, 'assets/levels/game_over.json', 'GameOverState'); // Start MenuState. // Play sound only if player left button sound as on mode. if (PLAY_SOUND) {; // Play game over sound. } }; I'd say that this game went through many tests, has been deployed to and Facebook, so more or less it should be fine, just the stick causes problem, which I can't figure out...
  8. I did, the following snippet is in my die method. // Destroy VirtualJoystick elements. this.stick.destroy(); this.buttonFireball.destroy(); When destroy is commented this error doesn't occurs, however obviously the stick is multiplied every new initialisation of new game.
  9. Trying to implement Phaser Virtual Joystick (, however once player will die the game crashes with the following error Uncaught TypeError: Cannot read property 'length' of null at Phaser.VirtualJoystick.Stick.get (phaser-virtual-joystick.js:1042) at Phaser.VirtualJoystick.Stick.get (phaser-virtual-joystick.js:1063) at YellowSidd.Player.update (Player.js:90) It happens when joystick will be used at least once, while joystick is just added to the game, not used, the game works fine, on dead game is reseting. However, if I'll use at least single movement using joystick it throws an error on player dead. Player.js:90 and related code, line 90 is exactly on second if, more precisely "if (this.stick.forceX => 0)", while I'll remove it there is later on forceX, which has exactly the same behaviour. if (this.stick.isDown) { // console.log(this.stick.forceX); if (this.stick.forceX >= 0) { // Move right. this.body.velocity.x = this.walking_speed; this.direction = "RIGHT"; this.scale.setTo(1, 1); } else if (this.stick.forceX < 0) { // Move left. this.body.velocity.x = -this.walking_speed; this.direction = "LEFT"; this.scale.setTo(-1, 1); } ... Any ideas? Tried to write, but no answer unfortunately, although it was send around 20 hours ago, hope so will got it finally During that time, maybe anyone here played with the joystick? The following game is on Phaser 2.6.2, tried 2.3.1 (default in joystick doc) and it's the same.
  10. Still, thanks for trying and feedback.
  11. @rich will try next time, maybe with Phaser 3?
  12. Looking for feedback for new game available at the moment on 3 platforms: Android Facebook Done with Phaser, includes sharing integration, FB invites, Firebase integration (not working on Android - please take a look, LocalStorage, AdMob as ads and in-app purchases included also at the end wrapped with Cocoon.
  13. Hello Everyone! I'm so glad to present multiplatform game, which is playable through Android smartphones/tablets and Facebook. Technology stack: Apache Cordova, Cocoon, HTML5 Audio, Local Storage, Phaser. Integrations: Sharing, inviting friends, Admob, In-app purchases - for both versions, Android and Facebook. Link to game post: Direct link to Google Play: Direct link to Facebook: Looking for feedback, positive and negative, especially for bugs Ahh, didn't want to spam here with images, screenshots are visible through the first link to game post, HTTPS secure connection. Thanks!
  14. Free Multiplatform Game available on Android, Facebook and Chrome Web Store.Soon iOS and Windows Phone versions will be added.Project website: PlayStore: Web Store: comments and suggestions are welcome!
  15. Is there any way to implement ads on Chrome Web Store? Anybody tried? I'm not asking about in-app purchases, I know it's working, just can't find anything about ads in official documentation for Chrome Web Store.
  16. Hey guys, Anyone knows App Links on Facebook is working with HTML5 games? In official Facebook documentation I found solution only for native apps. Ref:
  17. Please close the topic, nobody helped =(
  18. Nobody? Now I see only one solution, that's add #fb_invite div in index.html, invite function inside .html and onclick call the function invite with request code. But maybe anybody know how to do it inside Phaser state? =(
  19. After many hours of looking on this forum and not only it's time to ask directly for help. So guys my problem is how to integrate game request after click on exactly button. Here is integration with Facebook via .html file and it works correctly, the problem is how to do request acction after click button. When I applied code for request in .html file it was good, the problem is, directly after login there was window to send request - I don't want like that, I want after click. <script> window.fbAsyncInit = function() { FB.init({ appId : '611658819003576', xfbml : true, version : 'v2.6' }); // ADD ADDITIONAL FACEBOOK CODE HERE function onLogin(response) { if (response.status == 'connected') { FB.api('/me?fields=first_name', function(data) { var welcomeBlock = document.getElementById('fb-welcome'); welcomeBlock.innerHTML = 'Hello, ' + data.first_name + '!'; }); } } FB.getLoginStatus(function(response) { // Check login status on load, and if the user is // already logged in, go directly to the welcome message. if (response.status == 'connected') { onLogin(response); } else { // Otherwise, show Login dialog first. FB.login(function(response) { onLogin(response); }, {scope: 'user_friends, email'}); } }); }; (function(d, s, id){ var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); = id; js.src = "//"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script> Now it's time for phaser code, I tryed many many ways, it seems to me this is the closest create : function () { // this.onClick(); this.invite(); }, onClick : function () {""); }, invite : function () { window.fbAsyncInit = function() { FB.init({ appId : '611658819003576', xfbml : true, version : 'v2.6' }); FB.ui({method: 'apprequests', message: 'Play with me in InfiniteHell!' }, function(response){ console.log(response); }); }; (function(d, s, id){ var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); = id; js.src = "//"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); } I guess it should be something with "window", the test "onClick" works perfectly. With Twitter share here should be just link, but with Facebook API I can't get it... - Intel XDK Debugger after click (with active "invite" function) doesn't show any errors, just blank page, - Firefox doesn't do anything, just stays in the same state - Menu, also without any errors in console - Chrome just shows this kind of error, nothing more, but I'm not sure it's about that... sdk.js:88 Uncaught TypeError: Cannot set property 'innerHTML' of null sdk.js:88 Uncaught TypeError: Cannot set property 'innerHTML' of null Any tips for beginner? It's my second game and first in Phaser, everything is working well expect integration with FB, maybe wanna help?
  20. Hello,We would like to present our first, very simple game created in HTML 5, used Quintus framework.Here you have:- 7 different levels,- many different enemies,- 150 coins to collect,- and more!Game is available HERE.All tips and comments are useful.Best,Doyban PS. Quintus is old, know, right now working on Phaser game