redrory

Members
  • Content Count

    12
  • Joined

  • Last visited

  1. redrory

    New Buttons doesn't work on Mobile browsers

    Hey, That was actually a typo that I made when adding code to this forum, as I also have a moreBut button. I've updated the code to reflect me calling the correct button. Still not working on moble, the following works perfectly on Web even with the touchstart, just not on mobile moreBut.touchstart = moreBut.click = function() { window.location.href = "http://awesomesuace.com"; }
  2. redrory

    New Buttons doesn't work on Mobile browsers

    Hey Phempt, Thanks for your reply, I've tried above, and it's still not recognizing the click when using Safari on iPhone or any other mobile browsers
  3. Hey, So I'm customizing the Flying Dog game, on death; When the score and restart screen appears, I have added additional buttons, this work perfectly on desktop browsers but not on mobile browsers (iPhone, Andriod and iPad). I followed how the restartButton was added to add the others, however it's not recognized on mobile. I added the others like this - var moreBut = new game.Sprite('media/info.png', -100, 275);moreBut.interactive = true;box.addChild(moreBut);moreBut.click = function() { window.location.href = "http://awesomesuace.com"; }On web, I'm taken to the link no problem, but on mobile it doesn't recognize the click
  4. redrory

    Select different Players/plane in Flying Dog

    Hey, Got it working, in a hackish way. Thanks again
  5. redrory

    Select different Players/plane in Flying Dog

    Hey, So I've created another scene, pretty much by copying the default scene. So on my button click I'm now loading that different scene, which is half the problem however, I'm still unsure how to load a different sprite within that new scene. Mostly because objects aren't handled within the scene.js but within objects. I'm not even seeing, where I'm calling my sprite from scene, for me to me able to call a different one.
  6. redrory

    Select different Players/plane in Flying Dog

    When I do that, I get the following : Uncaught TypeError: Cannot read property 'player' of undefined As i assume I don't have scene by that name. My scene name seems to be game.scene - as I use the following to add buttons to it. game.scene.stage.addChild(box);I'm thinking do I have to create a SceneMain scene or can I use the one that I have below?
  7. redrory

    Select different Players/plane in Flying Dog

    I have to ask, while file would that be in?
  8. redrory

    Select different Players/plane in Flying Dog

    Removed it, however still not incrementing the sprite number. To me, it seems that I should be passing the incremented value somewhere in setScene game.system.setScene(SceneGame);
  9. redrory

    Select different Players/plane in Flying Dog

    Hey, So I fixed that undefined erorr. I've added the Sprite code to objects.js, my issue is that it doesn't seems to be incrementing by the time it gets to the new or restarted scene. I've added the global variable game.scene.player = 1; to my objects.js right above where I add my sprites. My question is - in my restartButton, when I increments how does that ++ value reach back to my sprite to then show the new player. scenes.js this.restartButton = new game.Sprite('media/restart.png', game.system.width / 2, game.system.height / 2 + 225, { anchor: {x:0.5, y:0.5}, scale: {x:0, y:0}, interactive: true, mousedown: function() { game.analytics.event('restart'); console.log('Before number ' + game.scene.player); game.scene.player = 1; if (game.scene.player === 0) game.scene.player++; else game.scene.player = 0; game.system.setScene(SceneGame); console.log('Random number is ' + game.scene.player); } });objects game.scene.player = 1; this.sprite = new game.MovieClip([ game.Texture.fromImage('media/player' + game.scene.player + '.png'), game.Texture.fromImage('media/player' + game.scene.player + '.png'), ]);
  10. redrory

    Select different Players/plane in Flying Dog

    I beleive that I already have created or using the default scene in the flying dog code (in scenes.js). Do I still have to create?
  11. redrory

    Select different Players/plane in Flying Dog

    Hey, Thanks for your reply, I have a high level understanding. A few questons: When I try to set the global variable - SceneMain or SceneGame game.SceneMain.player = 1;I get the following error - Cannot read property 'player' of undefined Also the player sprite line - is that handled during scenes or objects?
  12. Good day guys, I'm customizing Flying Dog, I've gone throught the tutorials and documentation. Still a bit unclear on how to implement something. After the round ends, when I click restart. I want another plane to be used for the reminder of the game. I know I have to add it to assets.js, and then objects.js under this.sprite. However I'm not sure how to enable the new plane on a button action or restart. On restart button click - it's loads game.system.setScene(SceneGame); So I was trying to however load another scene, however I think that would be overkill, all I want is a different player/sprite for the same scene. Any assistance would be much appreicated. Cheers