• Content Count

  • Joined

  • Last visited

About Rafaelx

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi all this is our first game, and it is still in Beta and development, it is our first time making one of our games public, we have worked on 4 games and this is the first one to go out, like I mention we are still working on it. https://play.google.com/store/apps/details?id=com.gamelandx.ufodarkness&hl=en unnamed (2).webp unnamed.webp unnamed (1).webp
  2. Rafaelx


    ok looks like it has something to do with the naming, I was naming 2 different backgrounds changing the name made the difference, even if they are in different folders, if you have 2 images with same name it messes things on android, the computer is still smart enough to see the difference on them, also I lean that a Cap letter can have similar results, computer can still find the file if you put a cap on name and actual name has no cap, but Android cannot find it, so its fix, thanks man.
  3. Rafaelx


    No nothing :( this is my code below, all related to background: preload here: this.load.image("Backgame", "assets/stage/back.png"); this in my update function: this.BackGame.tilePosition.x -= 1; this is on my create function: this.BackGame = this.game.add.tileSprite(0, 0, 6000, 720, 'Backgame'); and it works fine on Desktop like I said even in Emulator but once I build the apk, its a black background.
  4. Rafaelx


    Hi all, Is support for these gone? looks like my tilesprites stopped working after updating Phacer to CE any ideas? I get no erros, and Im able to see it on a Desktop browser, but I'm unable to see it on the Android device what could cause this? Im using this because of the repeating background thing.
  5. us canvas, make sure you tell phaser to use canvas.
  6. here you go, https://github.com/gomobile/template-phaser-landscape even if it is missing it still works great. You also may want to update the phaser library to latest, that is what I did.
  7. Hi all, I'm trying to have my bullets group that already collides with the enemies, both of them are a group, but now that I want to add a static block or obstacle, it simply wont collide or overlap or nothing, what I want is that when the bullet collides or overlaps it gets destroyed or at least bounce into the obstacle, see code below: ////////////////My Bullets//////////These work fine and collide correctly with my enemies.////// createBullets: function() { this.bullets = this.game.add.group(); this.bullets.enableBody = true; this.bullets.physicsBodyType = Phaser.Physics.P2JS; this.bullets.createMultiple(100, 'bulletSprite', 0, false); this.bullets.setAll('anchor.x', 0.5); this.bullets.setAll('anchor.y', 0.5); this.bullets.setAll('outOfBoundsKill', true); this.bullets.setAll('checkWorldBounds', true); }, fireBullet: function(){ if (this.bulletTimer < this.game.time.time) { this.bulletTimer = this.game.time.time + 500; this.bullet = this.bullets.getFirstExists(false); if (this.bullet) { this.bullet.reset(this.tanke.x, this.tanke.y - 20); this.bullet.body.setCollisionGroup(this.bulletCG); this.bullet.body.collides([this.figuraCG]); this.bullet.body.velocity.y = -3500; } } }, //////This is the block or obstacle this just wont work no matter what I try/////////// makeOneBloque: function(){ this.bloque = this.game.add.sprite(500, 950, 'Blokes'); this.bloque.enableBody = true; this.game.physics.p2.enable(this.bloque, true); this.bloque.body.kinematic = true; this.bloque.body.collides(this.bullets, this.collisionBulletBloque, this); //////I tried overlaps and it just crashes the lvl }, collisionBulletBloque: function(bullet) { bullet.sprite.destroy(); }, I would greatly appreciate any help or suggestions.
  8. Rafaelx


    I see so is it possible to give them a body?
  9. Rafaelx


    Trying to create a group, but keeps saying it is undefined got any suggestions? Please see code below. this is defined in the create function: this.bloqueCG = this.game.physics.p2.createCollisionGroup(); makeOneBloque: function(){ this.bloque = this.game.add.group(); this.bloque.enableBody = true; this.bloque.physicsBodyType = Phaser.Physics.P2JS; this.bloque.create(200, 950, 'Blokes'); this.bloque.create(550, 950, 'Blokes'); this.bloque.create(900, 950, 'Blokes'); this.bloque.body.setCollisionGroup(this.bloqueCG); <<<<----I get error here :( this.bloque.body.collides(this.bulletCG, this.hitBloke, this); this.bloque.body.kinematic = true; this.bloque.setAll('anchor.x', 0.5); this.bloque.setAll('anchor.y', 0.5); this.bloque.setAll('outOfBoundsKill', true); this.bloque.setAll('checkWorldBounds', true); },
  10. I'm just about to finish my very first game but I'm having issues adding Amazon ads on it. I'm working on the game using Intel Xdk and Phaser of course, I find phaser to be very superior and a good engine, now everything I think is clean and work smoothly so far. I have completed 80% of my game, the problem I'm having is, I would like to ad Amazon ads into my game. Why Amazon and not google you may ask, well I got banned from google apparently cause of invalid traffic or something like that, funny thing I live in Cayman Islands and I'm unable to display the ads here, so I was sending to friends to test, maybe they messed up for me who knows. I downloaded the Amazon Mobile ads for Cordova and successfully added the ads plug in into my project, in there there inside the www folder I find AmazonMobileAds this is its content: /* * Copyright 2014 Amazon.com, * Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the * "License"). You may not use this file except in compliance * with the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0/ * * or in the "license" file accompanying this file. This file is * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and * limitations under the License. */ var cordova = require('cordova'); var exec = require('cordova/exec'); var AmazonMobileAds = function() { } var serviceName = 'AmazonMobileAdsPlugin'; AmazonMobileAds.prototype = { listeners : [], addListener: function(eventId, listener){ if (typeof this.listeners[eventId] == "undefined") { this.listeners[eventId] = []; } this.listeners[eventId].push(listener); console.log('Listener was added for an event'); }, removeListener: function(eventId, listener) { if (typeof this.listeners[eventId] != "undefined") { for (var i = this.listeners[eventId].length; i--; ) { if (this.listeners[eventId][i] == listener) { this.listeners[eventId].splice(i, 1); } } } }, fire: function(event) { if (typeof event == "string") { event = JSON.parse(event .replace(/\n/g, "\\n") .replace(/\r/g, "\\r") .replace(/\t/g, "\\t") .replace(/\f/g, "\\f")); } if (!event.eventId) { throw new Error("Event object missing 'eventId' property."); } console.log('Event received'); if (this.listeners[event.eventId] instanceof Array) { var listeners = this.listeners[event.eventId]; for (var i = 0, len = listeners.length; i < len; i++) { listeners[i].call(this, event); } } } }; AmazonMobileAds.prototype.setApplicationKey = function(successCallback, errorCallback, options) { exec(successCallback, errorCallback, serviceName, 'setApplicationKey', options) }; AmazonMobileAds.prototype.registerApplication = function(successCallback, errorCallback, options) { exec(successCallback, errorCallback, serviceName, 'registerApplication', options) }; AmazonMobileAds.prototype.enableLogging = function(successCallback, errorCallback, options) { exec(successCallback, errorCallback, serviceName, 'enableLogging', options) }; AmazonMobileAds.prototype.enableTesting = function(successCallback, errorCallback, options) { exec(successCallback, errorCallback, serviceName, 'enableTesting', options) }; AmazonMobileAds.prototype.enableGeoLocation = function(successCallback, errorCallback, options) { exec(successCallback, errorCallback, serviceName, 'enableGeoLocation', options) }; AmazonMobileAds.prototype.createFloatingBannerAd = function(successCallback, errorCallback, options) { exec(successCallback, errorCallback, serviceName, 'createFloatingBannerAd', options) }; AmazonMobileAds.prototype.createInterstitialAd = function(successCallback, errorCallback, options) { exec(successCallback, errorCallback, serviceName, 'createInterstitialAd', options) }; AmazonMobileAds.prototype.loadAndShowFloatingBannerAd = function(successCallback, errorCallback, options) { exec(successCallback, errorCallback, serviceName, 'loadAndShowFloatingBannerAd', options) }; AmazonMobileAds.prototype.loadInterstitialAd = function(successCallback, errorCallback, options) { exec(successCallback, errorCallback, serviceName, 'loadInterstitialAd', options) }; AmazonMobileAds.prototype.showInterstitialAd = function(successCallback, errorCallback, options) { exec(successCallback, errorCallback, serviceName, 'showInterstitialAd', options) }; AmazonMobileAds.prototype.closeFloatingBannerAd = function(successCallback, errorCallback, options) { exec(successCallback, errorCallback, serviceName, 'closeFloatingBannerAd', options) }; AmazonMobileAds.prototype.isInterstitialAdReady = function(successCallback, errorCallback, options) { exec(successCallback, errorCallback, serviceName, 'isInterstitialAdReady', options) }; AmazonMobileAds.prototype.areAdsEqual = function(successCallback, errorCallback, options) { exec(successCallback, errorCallback, serviceName, 'areAdsEqual', options) }; AmazonMobileAds.prototype.AdType = { FLOATING:'FLOATING', INTERSTITIAL:'INTERSTITIAL' } AmazonMobileAds.prototype.Dock = { TOP:'TOP', BOTTOM:'BOTTOM' } AmazonMobileAds.prototype.HorizontalAlign = { LEFT:'LEFT', CENTER:'CENTER', RIGHT:'RIGHT' } AmazonMobileAds.prototype.AdFit = { FIT_SCREEN_WIDTH:'FIT_SCREEN_WIDTH', FIT_AD_SIZE:'FIT_AD_SIZE' } module.exports = new AmazonMobileAds(); So then I have no idea how to call my ad in my code. All I want to do is maybe display a Floating ad when the player dies, this is all HTML5 and I cannot find a single example out there. I been trying different things using the reference on the results of this google search but I still find my self unable to add the ad, my base template that I use to make my game is found here: Intel XDK Template I used, I would really appreciate any help or suggestion or a single tip to guide me to add this into my project.
  11. thanks so If I want to pass parameters will this works? onLevelSelected: function(levelnr) { // determine which state to start var statename = 'Level' + levelnr; // pass levelnr variable to 'Game' state this.game.state.states[statename]._levelNumber = levelnr; this.state.start(statename); },
  12. thanks I will try to use your approach to send data to same state, but mainly the problem is that some states have completely different set of rules not just time difference, also have different sprites, and things.
  13. Hi guys just making my first game and I manage to incorporate most of your code in this example, unfortunately I'm obligated to use different states so how do I approach adding 2 or more states like in this section here? Is my idea below correct? then I guess I declare the this._levelNumber = 0; as 1 and 2 and so on on each state? I'm a bit confused any help? also let me note that Level1 is on a separate .js all together but it works fine. onLevelSelected: function(levelnr) { console.log('onLevelSelected ---> levelnr=' + levelnr); // pass levelnr variable to 'Game' state this.game.state.states['Level1']._levelIndex = levelnr-1; this.game.state.start('Level1'); this.game.state.states['Level2']._levelIndex = levelnr-1; this.game.state.start('Level2'); // etc. } };
  14. Hi all I have a small problem, I'm trying to determine my score by the type of sprite that you hit with your bullets, this type is defined to the player by a small sprite on top of the screen, kind of like if you hit matching one you get 100 points if not 50 points see my code below. Can someone correct me in what I'm doing wrong? ///////I load my atlas this.load.atlas('Monsters', 'asset/game1/Monstruos/monstruos.png', 'asset/game1/Monstruos/monstruos.json'); //////This is my sprite that determines the type createFiguraCompare: function(){ // create a sprite, random frame 0..4 this.figuritaspega = this.game.add.sprite(0, 0, 'Monsters'); this.figuritaspega.frame = this.rnd.integerInRange(0,4); // create a group this.figuritaspegaG = this.game.add.group(); // <- function call this.figuritaspegaG.add(this.figuritaspega); // scale entire group and reposition group this.figuritaspegaG.scale.set(0.5 , 0.5 ); // notice that the sprite position is relative to the group position this.figuritaspegaG.x = 800; this.figuritaspegaG.y = 140; }, ////////this is my moving sprites that you must hit with the bullets makeOneFigura: function() { this.figura = this.game.add.group(); this.figura.enableBody = true; this.figura.physicsBodyType = Phaser.Physics.P2JS; // for (var i = 0; i < 5; i++){ this.figura.createMultiple(100, 'Monsters', 0, false); // } this.figura.setAll('anchor.x', 0.7); this.figura.setAll('anchor.y', 0.7); this.figura.setAll('outOfBoundsKill', true); this.figura.setAll('checkWorldBounds', true); }, makeFiguras: function(x, y){ if (this.timerFiguras) { this.figuras = this.figura.getFirstExists(false); if (this.figuras) { this.figuras.reset(500, 0); this.figuras.frame = this.game.rnd.integerInRange(0,4); this.figuras.body.setCollisionGroup(this.figuraCG); this.figuras.body.collides(this.bulletCG); this.figuras.body.velocity.y = 1400; } }; }, ////and my collision handler My problem is mainly here collisionBulletFigura: function(bullet, figura, score, scoreText, figuritaspegaG) { if (this.figura.currentFrame === this.figuritaspegaG.currentFrame){ figura.sprite.kill(); bullet.sprite.kill(); this.score += 100; this.scoreText.text = this.score; }else { figura.sprite.kill(); bullet.sprite.kill() this.score += 50; this.scoreText.text = this.score; } },