Search the Community

Showing results for tags 'phaser'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 3,299 results

  1. At the moment I'm just trying to switch in between game states by having the user press the spacebar. However, when the user holds down the spacebar, it continues to change. Is there a simple way to have the state change only once even when the spacebar is held down? I came across something called JustPressed, but it seems to be behaving in the same fashion as isDown. (rather than cycling through them infinitely when the spacebar is held down) I am brand new to Phaser and Javascript so a simple solution that's easy to understand would be amazing! // define game var game = new Phaser.Game(900, 500, Phaser.AUTO); // define MainMenu state and methods var MainMenu = function(game) {}; MainMenu.prototype = { preload: function() { console.log('MainMenu: preload'); }, create: function() { console.log('MainMenu: create'); game.stage.backgroundColor = "#facade"; }, update: function() { // main menu logic if(game.input.keyboard.isDown(Phaser.Keyboard.SPACEBAR)) { game.state.start('GamePlay'); } } } // define GamePlay state and methods var GamePlay = function(game) {}; GamePlay.prototype = { preload: function() { console.log('GamePlay: preload'); }, create: function() { console.log('GamePlay: create'); game.stage.backgroundColor = "#ccddaa"; }, update: function() { // GamePlay logic if(game.input.keyboard.isDown(Phaser.Keyboard.SPACEBAR)) { game.state.start('GameOver'); } } } // define GameOver state and methods var GameOver = function(game) {}; GameOver.prototype = { preload: function() { console.log('GameOver: preload'); }, create: function() { console.log('GameOver: create'); game.stage.backgroundColor = "#bb11ee"; }, update: function() { // GameOver logic if(game.input.keyboard.isDown(Phaser.Keyboard.SPACEBAR)) { game.state.start('MainMenu'); } } } // add states to StateManager and start MainMenu game.state.add('MainMenu', MainMenu); game.state.add('GamePlay', GamePlay); game.state.add('GameOver', GameOver); game.state.start('MainMenu');
  2. matias_ini

    How to know if a device is muted

    Hi, Does anyone know how to know if a device is muted? If it can not be done in Phaser how can I do it using javascript? Cheers, Matias Ini
  3. Hi, I am trying to use a FB Share Dialog in my Phaser 3 game, but i assume since the pointerdown does not just get called directly on mouse click, the Dialog gets blocked by the browser: let someButton= this.add.sprite(200, 500, 'someButton', 0).setInteractive(); buttonLeaderboard.on('pointerdown', () => { FB.ui({ method: 'share', href: 'https://mydomain.com' }); }, this); Does anyone have a solution for this, or for popups in general? Opening a new window would also be fine (using sharer.php instead), but that one gets blocked too: window.open(url, windowName, [windowFeatures])
  4. Hello everyone! TLDR; I'm trying to get the plugin 'phaser-input' (made by Orange Games) to be loaded and running properly in a webpack + ES6 style environment. I'm fairly new to the phaser game dev environment, and I really like how someone has created a boilerplate project that has ES6 style coding enabled [ phaser-es6-webpack]. But I think phaser2 by default was never meant to be coded in this style, with importing dependencies from a package manager; you are suppose to load the library and any plugins in the index.html's header area via script tags, so that it can do it's thing with the global namespace. (I didn't realize this until I got too far ahead in development) In my project, I have added to the webpack.config.js file to make the plugin 'phaser-input' ES6 compatible, and importable into my project. // webpack.config.js const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); // Phaser webpack config const phaserModule = path.join(__dirname, '/node_modules/phaser-ce/'); const phaser = path.join(phaserModule, 'build/custom/phaser-split.js'); const pixi = path.join(phaserModule, 'build/custom/pixi.js'); const p2 = path.join(phaserModule, 'build/custom/p2.js'); const phaserInput = path.join(__dirname, '/node_modules/@orange-games/phaser-input/build/phaser-input.js'); module.exports = { mode: 'development', entry: { app: ['babel-polyfill', path.resolve(__dirname, 'client/src/main.js')], vendor: ['pixi', 'p2', 'phaser', 'phaser-input', 'webfontloader'], }, output: { pathinfo: true, path: path.resolve(__dirname, 'client/build/js'), publicPath: './js', filename: '[name].js', }, devServer: { contentBase: path.resolve(__dirname, 'client'), }, watch: true, plugins: [ new HtmlWebpackPlugin({ filename: '../index.html', template: './client/src/index.html', chunks: ['vendor', 'app'], chunksSortMode: 'manual', minify: { removeAttributeQuotes: false, collapseWhitespace: false, html5: false, minifyCSS: false, minifyJS: false, minifyURLs: false, removeComments: false, removeEmptyAttributes: false, }, // hash: false, }), ], module: { rules: [ { test: /\.js$/, use: ['babel-loader'], include: path.join(__dirname, 'client/src') }, { test: /pixi\.js/, use: ['expose-loader?PIXI'] }, { test: /phaser-split\.js$/, use: ['expose-loader?Phaser'] }, { test: /p2\.js/, use: ['expose-loader?p2'] }, { test: /phaser-input\.js$/, use: ['exports-loader?PhaserInput=true'] }, ], }, node: { fs: 'empty', net: 'empty', tls: 'empty', }, resolve: { alias: { phaser, pixi, p2, 'phaser-input': phaserInput, }, }, }; The documentation recommends that the plugin be added using [ game.add.plugin(PhaserInput.Plugin); ] But I've seen other plugins use [ game.plugins.add(PhaserInput.Plugin) ]. I have this snipped added to my game state file. (the other code has been removed for clarity) import Phaser from 'phaser-ce'; import PhaserInput from '@orange-games/phaser-input/build/phaser-input'; export default class Game extends Phaser.State { preload() { this.game.plugins.add(PhaserInput.Plugin); } } The documentation simply shows the use of the plugin using the snipped [ var input = game.add.inputField(10, 90); ]. Where the function 'inputField' has been added to the framework. This is where I get stuck, the plugin function (inputField) that is suppose to be added never actually gets added at all to [ game.add ]. This in results in an error. import Phaser from 'phaser-ce'; export default class FormOverlay extends Phaser.Group { constructor({ game }) { super(game); this.testInput = game.add.inputField(10, 90); } } Is there a proper way of loading plugins in this webpack + ES6 style? I've wasted an afternoon trying to figure out how to get this plugin to work, I must be missing something here. If you know the answer to this issues, I would greatly appreciate if you can share the answer. Thanks for reading!
  5. Hi, I have built a mini games app in Adobe Air (in iOS and Android). It features lots of swf animations and lots of games. Now since the future of Adobe Air is circumspect. I want to hedge my bets by rebuilding the games in another platform which has a better future outlook. I had a few questions: 1) Which platform is better for building an app- OpenFL or Phaser ? I found OpenFL online which seems to be the best way to port flash games into html5. 2) Can I have a multi platform app in which suppose 100 games are there - 50 made in Phaser and 50 made in OpenFL? 3) I had read in one website that Phaser is not good for resolutions above 600x400 px. Is this true? 4) Since we want to support all resolutions in Android and iOS- we need vector graphics (the core strength of AIR). Do Phaser/CoreFL support Vector? Thanks, Nish
  6. ddabrahim

    Hosting multiplayer games?

    Hi. I'm currently developing a single player game in Phaser and occurred to me to make it online multiplayer instead but I would prefer not to run my own server and wondering what solutions are out there for hosting online multiplayer games? I searched the web and did come across 4 solutions. PlayerIO, AppWarp, Photon and using platforms like Heroku and Amazon.... At the moment I'm more likely go with PlayerIO because the pricing is better, the free package allow me to get started with no obligations and the paid packages also seems cheap compared to other hosts but I would like to get some feedback if it any good or not, should I consider using something else? I would be grateful for any opinion on this or even links to articles I could learn something from. Thank you.
  7. laduree77

    Sprite keeps spawning in same place

    var game = new Phaser.Game(400, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update }); //creating score value and onscreen text var score = 0; var scoreText; //creating random spawning place for diamond var diamondX = game.world.randomX(); var diamondY = game.world.randomY(); function preload() { // preload assets game.load.image('sky', 'assets/img/sky.png'); game.load.image('ground', 'assets/img/platform.png'); game.load.image('star','assets/img/star.png'); game.load.image('diamond', 'assets/img/diamond.png'); game.load.spritesheet('baddie', 'assets/img/dude.png', 32, 48); } function create() { // place your assets //enabling Arcade Physics system game.physics.startSystem(Phaser.Physics.ARCADE); //adding a background game.add.sprite(0, 0, 'sky'); //a group containing the ground and platforms to jump on platforms = game.add.group(); //enabling physics for any object in this group platforms.enableBody = true; //creating the ground var ground = platforms.create(0, game.world.height - 64, 'ground'); //scaling to fit the width of the game ground.scale.setTo(2, 2); //stops ground from falling once player jumps on it ground.body.immovable = true; //create five ledges var ledge = platforms.create(-300, 400, 'ground'); ledge.body.immovable = true; ledge = platforms.create(200, 400, 'ground'); ledge.body.immovable = true; ledge = platforms.create(100, 300, 'ground'); ledge.body.immovable = true; ledge = platforms.create(-200, 200, 'ground'); ledge.body.immovable = true; ledge = platforms.create(300, 100, 'ground'); ledge.body.immovable = true; //create the player and its settings player = game.add.sprite(32, game.world.height - 150, 'baddie'); //enabling physics on player game.physics.arcade.enable(player); //giving player a slight bounce player.body.bounce.y = 0.2; player.body.gravity.y = 300; player.body.collideWorldBounds = true; //walking left and right animations player.animations.add('left', [0, 1, 2, 3], 10, true); player.animations.add('right', [5, 6, 7, 8], 10, true); //create group for stars stars = game.add.group(); stars.enableBody = true; //creating 12 stars evenly spaced apart for (var i = 0; i < 12; i++) { //create a star inside of the 'stars' group each 33 px apart var star = stars.create(i * 33, 0, 'star'); //giving it gravity star.body.gravity.y = 20; //giving each star a random bounce value star.body.bounce.y = 0.7 + Math.random() * 0.2; } //create diamond and apply physics diamond = game.add.sprite(diamondX, diamondY, 'diamond'); game.physics.enable(diamond, Phaser.Physics.ARCADE); diamond.body.gravity.y = 25; diamond.body.bounce.y = 0.7 + Math.random() * 0.2; //displays score text on screen scoreText = game.add.text(16, 16, 'Score: 0', {fontSize: '32px', fill: '#000'}); } function update() { // run game loop //collide player and platforms var hitPlatform = game.physics.arcade.collide(player, platforms); //built in keyboard manager cursors = game.input.keyboard.createCursorKeys(); //reset players velocity (movement) player.body.velocity.x = 0; //moving with arrow keys if (cursors.left.isDown) { //move to left player.body.velocity.x = -150; player.animations.play('left'); } else if (cursors.right.isDown) { //move right player.body.velocity.x = 150; player.animations.play('right'); } else { //stand still player.animations.stop(); player.frame = 2; } //allow player to jump if touching ground if (cursors.up.isDown && player.body.touching.down && hitPlatform) { player.body.velocity.y = -350; } //checking for collision with stars and platforms game.physics.arcade.collide(stars, platforms); //checking if player overlaps with star game.physics.arcade.overlap(player, stars, collectStar, null, this); //checking for collision with diamond and platforms game.physics.arcade.collide(diamond, platforms); //checking if player overlaps with diamond game.physics.arcade.overlap(player, diamond, collectDiamond, null, this); } function collectStar (player,star) { //function for updating score for collecting stars //removes star from screen star.kill(); //add and update score for stars score += 10; scoreText.text = 'Score: ' + score; } function collectDiamond (player, diamond) { //function for updating score for collecting diamond //remove diamond from screen diamond.kill(); //add and update score for diamond score += 25; scoreText.text = 'Score: ' + score; } It's my first time trying out Phaser and what I want to do is have the 'diamond' spawn at random locations on the screen. I've managed to get the diamond to spawn on screen, but it doesn't seem to be spawning in different locations when I reload the game each time. I'm assuming that I'd need to put something in the update function, but I need a little help with that part!
  8. var game = new Phaser.Game(400, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update }); //creating score value and onscreen text var score = 0; var scoreText; function preload() { // preload assets game.load.image('sky', 'assets/img/sky.png'); game.load.image('ground', 'assets/img/platform.png'); game.load.image('star','assets/img/star.png'); game.load.spritesheet('baddie', 'assets/img/baddie.png', 32, 48); } function create() { // place your assets //enabling Arcade Physics system game.physics.startSystem(Phaser.Physics.ARCADE); //adding a background game.add.sprite(0, 0, 'sky'); //a group containing the ground and platforms to jump on platforms = game.add.group(); //enabling physics for any object in this group platforms.enableBody = true; //creating the ground var ground = platforms.create(0, game.world.height - 64, 'ground'); //scaling to fit the width of the game ground.scale.setTo(2, 2); //stops ground from falling once player jumps on it ground.body.immovable = true; //create five ledges var ledge = platforms.create(-300, 400, 'ground'); ledge.body.immovable = true; ledge = platforms.create(200, 400, 'ground'); ledge.body.immovable = true; ledge = platforms.create(100, 300, 'ground'); ledge.body.immovable = true; ledge = platforms.create(-200, 200, 'ground'); ledge.body.immovable = true; ledge = platforms.create(300, 100, 'ground'); ledge.body.immovable = true; //create the player and its settings player = game.add.sprite(32, game.world.height - 150, 'baddie'); //enabling physics on player game.physics.arcade.enable(player); //giving player a slight bounce player.body.bounce.y = 0.2; player.body.gravity.y = 300; player.body.collideWorldBounds = true; //walking left and right animations player.animations.add('left', [0, 1], 10, true); player.animations.add('right', [2, 3], 10, true); //create group for stars stars = game.add.group(); stars.enableBody = true; //creating 12 stars evenly spaced apart for (var i = 0; i < 12; i++) { //create a star inside of the 'stars' group each 33 px apart var star = stars.create(i * 33, 0, 'star'); //giving it gravity star.body.gravity.y = 6; //giving each star a random bounce value star.body.bounce.y = 0.7 + Math.random() * 0.2; } scoreText = game.add.text(16, 16, 'Score: 0', {fontSize: '32px', fill: '#000'}); } function update() { // run game loop //collide player and stars with platforms var hitPlatform = game.physics.arcade.collide(player, platforms); //built in keyboard manager cursors = game.input.keyboard.createCursorKeys(); //reset players velocity (movement) player.body.velocity.x = 0; //moving with arrow keys if (cursors.left.isDown) { //move to left player.body.velocity.x = -150; player.animations.play('left'); } else if (cursors.right.isDown) { //move right player.body.velocity.x = 150; player.animations.play('right'); } else { //stand still player.animations.stop(); player.frame = 2; } //allow player to jump if touching ground if (cursors.up.isDown && player.body.touching.down && hitPlatform) { player.body.velocity.y = -350; } //checking for collision with stars and platforms game.physics.arcade.collide(stars, platforms); //checking if player overlaps with star game.physics.arcade.overlap(player, stars, collectStar, null, this); } function collectStar (player,star) { //removes star from screen star.kill(); //add and update score score += 10; scoreText.text = 'Score: ' + score; } I can't seem to figure out why, but once I changed the sprite (which has fewer animation frames than the original), some strange errors popped up. The two error messages say: Uncaught TypeError: Cannot read property 'getFrameIndexes' of null Uncaught ReferenceError: stars is not defined The animation frame ranges don't seem to go out of bounds and I've already defined my 'stars' variable in the create function. Any ideas on why I'm getting these weird error messages? (the spirtesheet of the player is attached below)
  9. Good afternoon, I was hoping that the community could look over my code and see if something needs to be adjusted. I recently started learning Javascript and I just started learning Phaser and easystar yesterday so this might all look ridiculous. At the moment all I am trying to accomplish is pathfinding the way it is done in a point and click adventure game such as Monkey Island or Day of the Tentacle from Lucasarts. I am trying to achieve it much how AGS(Adventure Game Studio) allows the user to set it up. Basically, you import a room image and then you draw over the room with a chosen color(Sort of like drawing a mask) all the area's that a character can walk and find a path to and from. What I am trying to achieve in my code is the same principle above and I am trying to use easystar and Phaser to accomplish this. Let me explain my code: I have three images: the 'background' image which will load up the image of the room the character will be in. 'walkablepath' will be the image that contains the image mask. Anything that is hot pink is where the character can walk. 'maincharacter' is the player character that will find the path when we click on a part of the screen we want the player to go to. At start we will create a 'bmd' object, create the walkable grid and then destroy the bmd object. The 'bmd' object is what will hold the walkable mask information. It will match the same size as the room image. It will have complete transparency and will be overlaid over the background image, but not visible to the user. 'walkableGrid' will be the grid data that easystar will use to calculate the walkable paths. 'walkableRGB' will contain the RGB value of Hot Pink so that we can find the hot pink pixels. 'gridCollection' will collect the X and Y pixel data in the 'bmd' object and push it to the 'walkableGrid' as it goes through each pixel line from top to bottom. The code will do this by iterating through each X and Y pixel in a loop. After that is completed, the mask will be destroyed, easystar will have a setup to determine the acceptable tiles in the grid. Function calculateWalkPath() will be called each time the user clicks on the screen and the game will try and calculate the path for the user to walk and move him to his destination. Please see the code below: //Set the initial game paramters - Will start with 800x600 resolution and will use WebGL as a renderer and default back to Canvas if WebGL is not present. var game = new Phaser.Game(800,600, Phaser.AUTO, '', { preload: preload, create: create, update: update}); var easystar = new EasyStar.js(); //Lets get easy star in here. var bmd; //This will be the object that will take the pixel data of the scene. //Assets that will be preloaded at start function preload(){ game.load.image('background', 'assets/room1.png'); //The game room background that will be loaded. game.load.image('walkablepath', 'assets/walkablepath.png'); //The room's walkable area. game.load.image('maincharacter', 'assets/character.png', 32, 48); //The main characters animated spritesheet who will be walking around the room. } //The first function called when we start our game function create(){ //We are going to obtain the width and height of the background room. var backWidth = game.cache.getImage("background").width;var backHeight = game.cache.getImage("background").height; bmd = game.make.bitmapData(backWidth, backHeight); //Getting ready to determine the room size and get the pixel data of the walkable path. game.add.sprite(0,0,'background'); // Will add the room background to the desktop. It will place the upper left part of the image to the upper left part of the screen. bmd.alpha = 0; //Let's make sure the image is completely invisible to the users eyes. bmd.draw('walkablepath', 0, 0); //Will overlay the transparent walkable path over the background image. var walkableGrid = new Array(); //Lets make the grid that easy star will define as the walkable points. var gridCollection; //This will collect the 2 dimensional array grids and push it to the walkableGrid. var walkableRGB = "255105180"; //This is the RGB value of the area's the user can walk on. - Hot Pink is the RGB Color //Following code will begin at the top left corner of the walkable area and check each pixel for the hot pink color. If it finds it, it will add a 0. If not, 1. for (i = 0; i < backWidth; i++) { gridCollection = "["; for (j = 0; j < backWidth; j++) { if (bmd.getPixelRGB(i, j) == "255105180"){ gridCollection = gridCollection + "0"; } else { gridCollection = gridCollection + "1"; } //If there is still more width in the image, it will add a comma. Otherwise it won't and the array can be closed off. if (j != backWidth) { gridCollection = gridCollection + ","; } } //Close up and then Push the Array to the walkable grid gridCollection = gridCollection + "]"; walkableGrid.push(gridCollection); } bmd.kill(); //let's destroy the walkable area path we created from view - we need to find a better way to do this process. easystar.setGrid(walkableGrid); //Let's add the 2 dimensional grid array we just created to Easy star's pathfinding grid. easystar.setAcceptableTiles([0]); //Let's also make sure that easy star is aware that the 0 tiles are the tiles that the player can walk on. } function update(){ } function calculateWalkPath() { //This function will be called every time the user clicks on a path to walk to. //Now let's calculate the path and presumably use tweening to move the character from it's current x and y position to it's next calculated position easystar.findPath(xClickDest, yClickDest, playerXpos, playerYpos, function( path ) { if (path === null) { //Do something like a shrug animation from the character for not being able to find a path. } else { game.add.tween(maincharacter).to( { x: path[0].x }, 2000, Phaser.Easing.Linear.None, true); game.add.tween(maincharacter).to( { y: path[0].y }, 2000, Phaser.Easing.Linear.None, true); } }); //Let's get this party started. easystar.setIterationsPerCalculation(1000); easystar.calculate(); } I have to admit, I did not test this code yet. I rather have a fresh pair of eyes on this as I spent a good half hour trying to figure this out today and feel rather brain dead. Now, my questions are these: Will this code operate correctly? Did I use Phaser and Easystar correctly? What about memory management and speed and what is a better way to manage this? How would you improve it? Also, can I set more than one acceptable tile for easystar and how? Thanks for looking and for your assistance.
  10. rafaeldelboni

    Phaser3 Es6 Webpack4 Boilerplate

    Hi guys I spent some time creating a small boilerplate to use the new Phaser 3 with ES6 and Webpack 4. Plain webpack 4 Boilerplate with Babel, SASS and Phaser3 on board Some cool features: webpack 4, chunks and minifies; webpack-dev-server, development server that provides live reloading and fast in-memory access to assets; @babel/core and @babel/preset-env; eslint; updated, tried to use the latest version of everything (until this post ). I hope it helps, any sugestions, feedbacks or pull requests would be amazing!
  11. Hello, is there any way to complete current tween in the timeline and then remove following tweens? I'm inserting tweens like this: tweens.push({ targets: this.sprite, x: { value: 50, duration: 1000 }, y: { value: 50, duration: 1000 } }); this.tweens.timeline({ tweens }); Then after some event I need to finish current tween and clear all following (if any). This seems to stop tweens: this.tweens.killAll(); but I can't find anything to finish current tween at first. Thanks
  12. Hey folks, New version of Phaser CLI is here: https://github.com/phaser-cli/phaser-cli. Phaser CLI is based on the latest versions of Create React App and vue-cli, and is designed to provide a zero-config setup for your Phaser projects. Getting started: npm install -g @phaser-cli/cli # or yarn global add @phaser-cli/cli phaser create my-project cd my-project npm start # serves your project at localhost:8080 npm run build # builds for production Currently implemented: Basic template with Babel support Linting with Standard Webpack 4 Webpack Dev Server Ability to eject from Phaser CLI Coming soon™️: Support for additional templates (e.g TypeScript, CoffeeScript) Support for multiplayer games via socket.io More linting options (e.g ESLint, ESLint + Standard, ESLint + AirBnB) Add some tests into the templates Integrate Travis/AppVeyor for automated testing/deployment of Phaser CLI And likely a few other things yet to be decided. Phaser CLI is still a work in progress (read: bugs!) so please yell if you're having any issues. Any contributions to the code and other suggestions are very much appreciated 🙂
  13. Hemanthraj

    How to smooth tween animation

    How to smooth the tween animation in the android devices.
  14. Infamous Flames

    Fire Hungry

    http://www.firehungry.online About [Fire Hungry] Fire Hungry is a friendly, fun 2d shooter io game. Play as your favourite snack and burn up others with your powerful rapid flames with a simple mouse click. Players must strive to reach the highest score! Have fun! Fire Hungry was created by Infamous Flames How to Play [Fire Hungry] Unlock a character or use the default skin. Type in a name of a choice and click the blue play button to start. Move your player around the mouse. Click to shoot. [Fire Hungry] Strategy Moving your player carefully with the mouse will make dodging fire bullets a lot easier from other players.
  15. angeltrickz

    multiplayer collision

    for (var i in Game.playerMap) { for (var e in Game.weaponMap) { game.physics.arcade.collide(Game.playerMap[i], Game.weaponMap[e].bullets,Game.colision(i), null, this); } }; Game.colision = function(id){ //console.log(id); //Client.socket.emit('colision',"colision"); }; I want to make collisions and send them via socket to the server ... but for now I have a problem because it constantly sends me collisions without detecting between the shot and the enemy .. any ideas?
  16. Thunderfist

    Map not appearing

    My game isn't loading the map I made using tiled. The file, testroom1.json, is called properly, but something in my game.js is keeping the game from loading the map itself. var RPG = RPG || {}; RPG.GameState = { init: function (currentLevel) { //Needed to keep track of the level this.currentLevel = currentLevel || currentLevel === 'testroom1'; //movement speed constants this.PLAYER_SPEED = 90; //no gravity in top down games this.game.physics.arcade.gravity.y = 0; //keyboard cursors for input this.cursors = this.game.input.keyboard.createCursorKeys(); }, create: function () { this.Game.onscreenControls = this.game.plugins.add(Phaser.Plugin.OnscreenControls); this.loadLevel(); }, update: function () { }, loadLevel: function () { //create the tilemap object this.map = this.add.tilemap(this.currentLevel); //Join the tile images to the .json data this.map.addTilesetImage('tileset', 'tilesheet'); //create tile layers this.backgroundLayer = this.map.createLayer('backgroundLayer'); //this.collisionLayer = this.map.createLayer('collisionLayer'); //set background to the back of screen this.game.world.sendToBack(this.backgroundLayer); //Collision Layer... if only I made it earlier //this.map.setCollisionBetween(1, 16, true, 'collisionLayer'); //resize the world to fit the layer //this.collisionLayer.resizeWorld(); }, gameOver: function () { this.game.state.start('Game', true, false, this.currentLevel); } }; I never made the collision layer. I plan on doing that AFTER getting the map to appear first. Does anyone have any advice on how to tackle this?
  17. Hi everyone, Video (mp4 or webm) doesn't play on firefox android -> "NS_ERROR_NOT_AVAILABLE" I use Phaser CE v2.10.0 and CANVAS , I unlock the videos before. does not work on examples either : https://phaser.io/examples/v2/video/play-video Thank you in advance !
  18. 1pixelarmy

    Promote your html5 games playing

    Hi all! I own a small html5 gaming site, so far I have 4 finished games. I thought as a way to increase plays and help other small developers to add a sort of cross-promotion feature. Signing up (you can do it with your Twitter or Google account), you can add a free promo banner that would be showed while users play. The more you play, the more your banner will be shown. My site is 1 Pixel Army What do you think about this idea? David.
  19. Hey all, I'm using tween for my game in the android device it is too lacking and slowly working tween, then i tried with physics both too slow how to solve.
  20. syed samoon

    Remove the layout of physics editor

    Hi Everyone, i'm using physics editor software for apply p2 physic in phaser. i will apply the JSON in phaser game.load.physics('Physics', 'assets/sprites/newSize.json'); but i will get this layour in my png how to hide the marked area of the JSON
  21. Thunderfist

    Property 'width'

    I can't figure this out. My game code keeps saying that it can't read the property 'width' of undefined. There's nothing my code declaring a property width. Most of the locations are different lines in the phaser.js, but two of them are in the game.js: game.js lines 25, and 32. Line 25 is this.loadLevel(); and line 32 is this.map = this.add.tilemap(this.currentLevel); Here's the code: /*global Phaser*/ var RPG = RPG || {}; RPG.GameState = { init: function (currentLevel) { //Needed to keep track of the level this.currentLevel = currentLevel || currentLevel === 'testroom1'; //movement speed constants this.PLAYER_SPEED = 150; //no gravity in top down games this.game.physics.arcade.gravity.y = 0; //keyboard cursors for input this.cursors = this.game.input.keyboard.createCursorKeys(); }, preload: function () { //this.map.loadTilesetImage('terrain'); }, create: function () { this.game.onscreenControls = this.game.plugins.add(Phaser.Plugin.OnscreenControls); this.loadLevel(); }, update: function () { }, loadLevel: function () { //create the tilemap object this.map = this.add.tilemap(this.currentLevel); //Join the tile images to the .json data this.map.addTilesetImage('terrains', 'terrain'); //create tile layers this.backgroundLayer = this.map.createLayer('backgroundLayer'); //this.collisionLayer = this.map.createLayer('collisionLayer'); //set background to the back of screen this.game.world.sendToBack(this.backgroundLayer); //Collision Layer... if only I made it earlier //this.map.setCollisionBetween(1, 16, true, 'collisionLayer'); //resize the world to fit the layer //this.collisionLayer.resizeWorld(); }, gameOver: function () { this.game.state.start('Game', true, false, this.currentLevel); } }; What do I do to fix this issue? I only have a month until my project is due!
  22. angeltrickz

    help problem hitarea

    how can I define the hit area of a single bullet and a sprite
  23. Hi all, Could you help how i can stop detecting collision between two sprites after detecting? this.game.physics.arcade.collide(this.animal, this.animal, this.stopanimzwierz, null, this); After collision i have function which is stop moving sprites, but sprites still staying in collision so i am not possible to start next function which is moving those sprites. Could you help me to find solution? In simple way i want to stop sprites, stop collision between them to move it again with automatically function.
  24. SirFizX_ELHS

    Huntin and Fishin

    This is something I put together this afternoon for my students to play with. Live demo.
  25. Hexone

    Black Screen every time.

    Hello, I have start to use phaser 3, i have setup all the basic things and follow some tutorial, but every time i use phaser 3 on my local or my web server, i have this : The code : My local file : If you can help me ^^ I thinks is just a things i don't get or something.. Thanks you.