Search the Community

Showing results for tags 'phaser3'.



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 121 results

  1. The game can be played at https://jablonskiwebdevelopment.com/rpg/objalinsk. This is a game I created using Phaser3 for my final project at my coding bootcamp last year which I converted from a Pygame version I created in the early weeks of my bootcamp. You could find a youtube video preview of the game at https://www.youtube.com/watch?v=YZhNVVPbvzI. You will need to create an account to play as your stats are saved for if you want to return to the game. (I ask for an email during signup but you could provide a fake one if you do not want to provide a real one as there is no email verification). The game is mostly complete aside from a few parts of the map that just randomly end. You could fight multiple enemies who all have different special attacks and buy items from the store at the beginning of the game.
  2. Hello, So I actually have the following code that works: var player; var box_tnt; function create (){ this.physics.add.collider(player, box_tnt, hitTnt, null, this); } //the function hitTnt stop the game because the player died function hitTnt (player, boxes){ this.physics.pause(); player.setTint(0xff0000); player.anims.play('default'); gameOver = true; } and I want to do something like: var player; var box_tnt; function create (){ this.physics.add.collider(player, box_tnt, hitTnt, null, this); } //the function hitTnt stop the game because the player died function hitTnt (player, boxes){ gameOver(); //other stuff here } function gameOver (){ this.physics.pause(); console.log('Game Over!'); textGameOver.setText('GAME OVER'); player.setTint(0xff0000); player.anims.play('default'); gameOver = true; } but I have the following message: Do you have please any ideas how to do it properly?
  3. Hello! I am using the following code (which is a simplified snippet in order to make it more readable): which is a simplified snippet in order to make it more readable var player; var box_tnt; function create (){ this.physics.add.collider(player, box_tnt, hitTnt, null, this); } //the function hitTnt stop the game because the player died function hitTnt (player, boxes){ this.physics.pause(); player.setTint(0xff0000); player.anims.play('default'); gameOver = true; textGameOver.setText('GAME OVER'); } Actual comportment: when the player hit the bomb: player die; end of the game Desired comportment: when the player hit the bomb: the bomb wait 3 secondes and then explode ! If the player is too close he die. But I stuggle a lot to use a timer even after reading a lot of example in the forum I am a newbie concerning Phaser so I didn't succeed to it so far. Any help would be appreciated, thank you in advance!
  4. I am making a top down RPG styled game using Tiled and Phaser 3. I have already made a map in Tiled for the city and store. Also, I have already set the objects for the location of the store where the player is suppose to go in order to enter the store and the location where the player is supposed to appear. The thing I am having trouble figuring out the code I am suppose to use in order to facilitate this action, as well as going back to city map. One more thing, If there are any other ideas on how to go about this I am all ears.
  5. Dear community, I would like inform you that "War IOM" v2 have been re-work graphics and added more feature to serve user experience. Here is my banner screenshot: You can access to the website and play it directly on your phone (Chrome mobile, Safari iPhone, iPad) or your Laptop Link to play: https://www.iomgame.com/wariom/ ++++ Game description: The rule to win the game is very simple: buy the soldiers, defeat the enemy army and then destroys the flag. Try to use fireball to wipe out the enemy. The game had the shop to buy new soldier, upgrade soldier and choose the team out. Game data be stored on both user's device and server so never lost data again. ++++ Here is the look and feel of War IOM icon on your Home-screen phone Rumor: You can get double gem receive if you beat the mini boss at level 3. Also win level 3 will give you a lot of Gem, use it to buy new solider and upgrade your army! My facebook page: https://www.facebook.com/Iomgame-245553622715070/ /******** Change log update 08/26 ********/ -- Add new game play for level 6. -- Improve camera. -- Improve game performance. /******** Change log update 08/31 ********/ -- Improve sound load time. No painful for waiting sound loading any more! /******** Change log update 19/09 ********/ -- Add level 7 with new game play. Regards, Gafami .
  6. rado9408

    Phaser 3 : Draw Circle style timer

    Hi guys who has experience with the drawing a timer in phaser 3, who can help ? what type of tools can I use ? Timer should look like this .
  7. Hi, I have problem with phaser performance. The phaser CPU usage is too high. Configuration : - game is on phaser 3 with vue - main page is on vue with game in iFrame this.gameInstance = new Phaser.Game({ width: properties.width, height: properties.height, resolution: PIXEL_RATIO, "callbacks.postBoot": function() { document.getElementsByTagName("canvas")[0].style.width = properties.width + "px" document.getElementsByTagName("canvas")[0].style.height = properties.height + "px" }, scaleMode: 0, type: Phaser.CANVAS, parent: document.getElementById('game'), title: '☕️ Brunch with Phaser and ES6', // 'My Phaser 3 Game' url: 'https://github.com/samme/brunch-phaser-es6', version: '0.0.1', banner: { background: ['#e54661', '#ffa644', '#998a2f', '#2c594f', '#002d40'] }, fps: { min: 10, target: 60, forceSetTimeout: true, }, loader: { path: 'static/phaser/', }, physics: { default: 'arcade', arcade: { debug: false, gravity: { y: 300 }, }, }, scene: [ LoaderScene, BootScene, DefaultScene, GameOverScene, ], }); CPU usage: - Phaser = 40% - Phaser with vue = 80-90% - main page without iframe = 5-10 % - main page with iframe = 100% js heap size: - Phaser = 50 - 70 MB - Phaser with vue ~ 70 - 100MB - main page without iFrame ~ 50 - 80 MB - main page with iFrame ~ 100 - 150 MB The game is equipped with 20-30 icons, 10 atlases, 19 mp3 sounds and 5 background image, with total size of assets about 3MB. Thank you in advance
  8. Morokkoikitai

    How to use tween.onUpdate in typescrpt

    hello. i want to know how to path context to tween.onupdate. i.e ----------------------------------------------------------- let t = this.tweens.add({ targets: this.follower, t:1, ease: 'Sine.easeInOut', duration: this.curve.getLength(), onUpdate: function() { this.player.x = this.follower.vec.x this.player.y = this.follower.vec.y }, }) ------------------------------------------------------ is not work. thanks.
  9. Hi everyone, Looking for some advice on the approach to coding multiple powerups/upgrades. I have googled how to do this but most answers are in c#/java or based on unity so I have trouble understanding what there doing. I am making a geometry wars/asteroids clone and I am giving the player upgrades when they defeat a boss or reach certain multipliers/kills. The problem is that I am having to change lots of code and using lots of if statements to see if a powerup has been activated then changing the bullet effect and then having to change the collision function for the bullets hitting the enemies so that each powerup does something different. For example in my powerup file (handles bullet changes when new power is activated and powerup pick ups) I add more if statements to the bullet logic to change for example the bullet speed and texture then I go into the file that handles collisions and make changes to the bullet / enemies function so that if the bullet is a fire bullet for example, the enemies particle effect is changed to red from blue. I know there are better ways to do this but I'm not sure how in javascript (or any language) any help would be really appreciated some code: powerups.js (bullet logic handler function for special bullets) const scene = this.scene; const utils = this.utils; const player = scene.player.sprite; if (bullet && utils.playerDied === false) { if(utils.explodingBullet) { if(utils.specialLevel > 1) { utils.bulletSpeedSpecial = 120; } else { utils.bulletSpeedSpecial = 250; } bullet.setTexture('explodeBullet'); } else if(utils.flameBullet) { utils.bulletSpeedSpecial = 75; bullet.setTexture('orange'); if(utils.specialLevelCheck === false) { utils.specialLevelCheck = true; scene.flameEmitter.explode(); } if(utils.specialLevel > 1) { player.setTexture('playerO'); scene.playerTrailEmitter.setFrame(['white', 'orange']); } } else { bullet.setTexture('bullet'); player.setTexture('player'); scene.playerTrailEmitter.setFrame(['white']); } bullet.fire(player, scene.reticle); utils.lastFiredSpecial = time + utils.bulletSpeedSpecial; scene.physics.add.overlap(scene.baddieGroup, bullet, scene.callBacks.shootingBaddies, null, scene);
  10. Hey All! I needed to display some dialog boxes in a recent game and the old 9-slice plugin wasn't ported to v3 yet so I wrote one (github repo). I have a live demo here and a gif of it in use follows. Would love to see this get some use outside of my projects so give it a spin. I'm pretty active on the discord and try to check in here weekly so feel free to ping if you have any questions! Happy hacking!
  11. locomotive

    looped timed event with random delay

    Hello , i am new to building games , started my phaser3 journey one week ago , i am trying to make a looped timed event run multiple times , each time a different delay , so for example instead of making the event run every 5 sec as this line of code does : phonecall = this.time.addEvent({ delay: 5000, loop: true, callback: onEvent, callbackScope: this }); i need it to run at random intervals from 5 to 30 secs ( ex : first time 5 sec second time 10 sec third time 7 sec) any value between the interval i set , i tried to do this : phonecall = this.time.addEvent({ delay: Phaser.Math.Between(5000,30000), loop: true, callback: onEvent, callbackScope: this }); but it seems that its not working .. sorry for my bad use of English , thanks
  12. Hi, I'm new with Phaser, I'm wondering how can I create a group of enemies that appears at the side of the screen in a random Y position between 550px and 745 px, after they appear they need to start to fire to my character Right now I have a function to create the bullets and how they will be fired: createBullets:function(laserToFire,track,offsetX, offsetY, bulletDirection,fireRate,bulletSpeed){ weapon = gameSP.add.weapon(10, laserToFire); weapon.bulletKillType = Phaser.Weapon.KILL_WORLD_BOUNDS; weapon.bulletSpeed = bulletSpeed; weapon.fireRate = fireRate; weapon.trackSprite(track, offsetX, offsetY); weapon.fireAngle = bulletDirection;right } So what I'm looking to do is to have each one of my enemies within the group to fire to my character. Thanks in advance.
  13. instantgame

    I need ListView For Phaser3 game

    I am coding new game for facebook instant game and need ListView (Scroll view) to make a leaderboard Where can i find that, for Phaser 3, thank so much!
  14. PappasBiology

    Stuck on First Phaser3 Game

    I’m having trouble with “Making your first Phaser 3 game.” I went through the “Getting Started with Phaser 3” steps…I downloaded WAMP and downloaded the repository from GitHub (I don’t really know what I’m doing with GitHub yet...I cloned the repository to GitHub desktop and then later, in attempt to get things working, downloaded the ZIP to my www WAMP directory). The test in step 5 (Hello World) worked without issue, both opened directly with Chrome and through the Brackets live preview. I downloaded the files (assets and parts 1-10), which I saved in a folder (Learning Phaser) in the WAMP www directory. I can open each part in Brackets, but I can’t run any of the parts in Chrome. The console gives the following errors: “ReferenceError: Phaser is not defined” and “Failed to load resource: net::ERR_FILE_NOT_FOUND” I assume I’ve missed something pretty straightforward…can anyone see what that something is?
  15. Hi, I'm using the arcade physics engine. I'm trying to move a cloud left and right via tweens but the problem is the arcade box isn't moving with it. Does anyone know how to fix this? createTweens() { this.scene.tweens.add({ targets: this, x: this.distanceX, duration: this.speed, yoyo: true, loop: - 1 }); }
  16. lucasg07

    Custom camera when falling down

    Hi, I'm basically making a doodle jump based game, but since I'm really new to Phaser and barely find any examples on how to handle a custom camera, I'm asking for help on this forum. I want the camera to follow the player when it goes up, but stop following the player as it goes down. I've looked at a lot of Phaser 2 examples but these confuse me only more. This is my code for the camera, right now it basically follows the player up and down. (the clouds are removed below the camera view, so the player keeps falling when it misses a cloud) cameraMovement() { this.cameras.main.setBounds(0, - this.player.yChange, 500, 800); this.cameras.main.startFollow(this.player); }
  17. Marine

    Get container by name

    I gave the names to my Containers and want to get them using that names(with setName ). For example, I have Container with name 'Container1', 'Container2' ... I want to find the container with 'Container2' name. How can I do that?
  18. Phaser 3 BOILERPLATES | STARTERS Unify, upgrade, use. Last updated: March 6 Table of contents: 1. Intro 2. create-phaser-app 3. List of existing boilerplates 4. What kind of features we need/want 5. What's the point Intro: Hello there everyone! As Phaser 3 came out I immediately started to look after some Boilerplate which would take care of basic stuff and speed up the development. If you don't know what I am talking about, think of create-react-app, but for Phaser. There are a few already, however I think that is one of the things that shouldn't be re-created every time, but I'd rather see one, powerful, generator that is community driven, updated, and has many options. Richard has mentioned that he prefers this to be created by community, and just highlighted on the Phaser website. I am aware that sometimes you need something really different and boilerplate X won't suit your needs, but that's where configuration comes in (for example question at the beginning which physics you want to use). Unless even that can help you - get a different boilerplate/create new one. I want to help and in my opinion boilerplates are great way to unify the community, show out the best practices and speed up the development. Let me know what do you think about it. create-phaser-app: So currently I am developing this generator, which follows the convention of create-X-app. It will be configurable with --options, or by default running a "wizard" where you select basic options. At the start there will be only plain JS and typescript probably, but later on I'm planning to add things like multiple examples (ping-pong, platformer, etc) and many other stuff, but also some --basic flag where you get 0 configuration small project without any webpacks or anything! https://github.com/phaser-contrib/create-phaser-app Here's the repo. Project will be open up for contributions after I prepare the base. Hopefully after everything's prepared community will be able to focus this one and stop creating new ones, unless they really need to. Existing boilerplates list: https://github.com/oliverbenns/phaser-starter - https://github.com/rblopes/generator-phaser-plus - by @rblopes https://github.com/lean/phaser-es6-webpack/tree/phaser3 - (phaser 3 on different branch, i think it's still in development for p3) by @leandro Boilerplates/examples (things that fall in into example category, but still can be a good foundation) https://github.com/nkholski/phaser3-es6-webpack - generic platformer template (mario in this case) and it's based on phaser-es6-webpack by @nkholski I'll keep the list updated, you can give links in the comments too! Features: What should the perfect boilerplate have Recognizable name ES6 transpilation with babel ES6, CoffeeScript or TypeScript Webpack, along with live and hot reload Environment variables Continuous delivery and continuous deployment Images compress JS minify Standard folder structure with basic scenes like preload screen, game Config file for game configuration with all possible options Maybe something that will make sprite bundles ES lint configuration? (not quite sure as many people have different ways of writing code, however maybe just a small base for further configuration?) CLI commands (like create new object) Popular building integrations (Cordova, Cocoon etc) at least on some level Easy way to update Phaser Configurable at the start: Provide bigger example? or just standard template (for example do you want only one example asset, or whole game generated) Physics selection List of some basic useful plugins? That's all coming to my mind for now, leave the comments what would you like to see in a boilerplate! The point?: I know this may be not immediately clear "what the hell this guy want to do with this topic". I think it would be nice if community choose one boilerplate that already is in a good shape and drop all the focus on it. I don't think that this will be better if every person creates a new boilerplate for no good reason and reinvents the wheel. So to summarize: Create a list of boilerplates to have it in one place Let's choose together a boilerplate which community would accept to take care of, becoming a kind of "official" boilerplate (again think of create-react-app that is used by most of the people). (and yes, I am aware that not everybody will want that, but in most cases unified standard is a good thing, I guess?) List of features that this boilerplate would ideally have. I want to hear your feedback about the whole concept, maybe I am dreaming too much. From my side: https://github.com/lean/phaser-es6-webpack/tree/phaser3 seems to be the most popular, however don't think it's phaser 3 ready yet? Haven't looked at it yet. https://github.com/rblopes/generator-phaser-plus is also looking great, I've used it at it seems it has most of the features. What would I like to hear from you guys: Do you like the idea? If yes, would you like to prefer to choose an existing boilerplate or create a new one How would you name it if new one? If new one, clean start or forked from other project? What features would you add to the list Do you know any other generators that should be on the list? So let me know what do you think about it, let the discussion begin. Yey. Best regards.
  19. Hey there, I am still struggling a lot with Phaser3 due to the documentation is still in work. I made two simple sprites, that collide, what I experience is that >body.blocked.down< nor the other properties (left, right, top) ever change. They are always: false. No matter if a collision happens or not. A bit of code: //These are the arcade configs: physics: { default: 'arcade', arcade: { gravity: {x: 0, y: 2000}, debug: true, overlapBias: 20 } } //TileA this.plat = this.physics.add.sprite(400, 1100, 'platform'); this.plat.displayWidth = 500; this.plat.body.allowGravity = false; this.plat.body.immovable = true; //TileB is a custom class which just extends this.physics.add.sprite this.minion = new tileB(this, 500, 200); //collision works well with: this.physics.world.collide(this.plat, this.minion); However, the body.blocked property is logged in my update of the custom (tileB) class - and it is always false. No matter if it's colliding. Here is the code of the tileB class: class tileB extends Phaser.Physics.Arcade.Sprite { constructor(config) { super(config.scene, config.x, config.y, 'minion'); this.scene.physics.world.enable(this); this.scene.add.existing(this); this.scene.layers.minions.add(this); this.controls = this.scene.input.keyboard.createCursorKeys(); //write controls class this.alive = true; this.body.maxVelocity.y = 1500; this.body.setSize(50, 100, false); this.body.setOffset(80, 60); this.scene.events.on('update', this.update, this); } update() { if(this.data.active) { console.log(this.body.blocked.down) if (this.controls.left.isDown) { this.setVelocityX(-200); this.anims.play('left', true); } else if (this.controls.right.isDown) { this.setVelocityX(200); this.anims.play('right', true); } else { this.setVelocityX(0); this.anims.play('turn'); } if (this.controls.up.isDown && this.body.blocked.down) { this.setVelocityY(-200); } } } } I have looked into the super mario example by @nkholski as he used body.blocked.down too. I had a hard time to find the point I am missing. Would be glad if someone helped me out nkholski's platformer boilerplate: Thanks in advance
  20. Like the Title says: I would like a game object (one) to become transparent only if another game object (two) is fully covered by the first object (one). What would be the best way about doing this? Thanks!
  21. Hi, I created a simple tilemap with tiled, and I'm trying to load it. The code and files can be seen here: https://codesandbox.io/s/qqq47wqv3w I'm not getting any errors in the console, but the canvas is just a black square. Any ideas what I am doing wrong? var game = new Phaser.Game(config); function preload() { this.load.image("tiles", "assets/tiles.png"); this.load.tilemapTiledJSON("World", "assets/tilemap2.json"); } function create() { this.map = this.add.tilemap("World"); var tileset = this.map.addTilesetImage("tiles", "tiles"); his.backgroundLayer = this.map.createStaticLayer("World", tileset); } The timemap.json from Tiles is below: { "height":100, "infinite":false, "layers":[ { "data":[3, 3, 3, 3, 3, 3, 3, 3, ...[data omitted]..., 3, 3], "height":100, "id":1, "name":"World", "opacity":1, "type":"tilelayer", "visible":true, "width":100, "x":0, "y":0 }], "nextlayerid":2, "nextobjectid":1, "orientation":"orthogonal", "renderorder":"right-down", "tiledversion":"1.2.1", "tileheight":8, "tilesets":[ { "columns":8, "firstgid":1, "image":"tiles.png", "imageheight":48, "imagewidth":64, "margin":0, "name":"tiles", "spacing":0, "tilecount":48, "tileheight":8, "tilewidth":8 }], "tilewidth":8, "type":"map", "version":1.2, "width":100 }
  22. This plugin will help you build paths for pathfollowers and path tweens. Draw and edit Lines, Bezier Curves, Splines and Ellipses at runtime and export them to Phaser. A useful tool for editing and building paths. Explore your scene while building paths. Draw your path in-game during runtime. Export path as JSON Data. Load them into Phaser and create awesome animations using pathfollowers! Maximum usage of Phaser API. More cool features will be added soon! Demo. Src & Docs NPM Submit an issue
  23. Hey All, I'm using WebPack to build my game and I've run into a scoping issue. I'll try and explain. Below is my TestScene scene/class. import 'phaser'; import Npcs from 'modules/Npcs.js'; const npcs = new Npcs() export class TestScene extends Phaser.Scene { constructor () { super('TestScene') } preload(){...} create(){ this.physics.add.collider( this.player, this.bombs, npcs.hitBomb, null, this ) } } Below is my npcs class import 'phaser'; const gameplayStates = new GameplayStates() export default class Npcs { hitBomb (player, bomb) { this.physics.pause(); player.setTint(0xff0000); this.entityDestroy() } entityDestroy () { console.log('destroyed') } } `this.player` and `this.bombs` are in place and work as expected in every way I intended. The callback in the collider method has `this`(testScene) as the context so, `this.entityDestroy()` no longer seems to work and fires app.bundle.js:116068 Uncaught TypeError: this.entityDestroy is not a function I suspect this is because the `npcs` class is not in the npcs class' scope when the method is called from the collider function. How can I get around this with the collider method? Your help would be much appreciated. Thanks all, Your help is much appreciatd.
  24. sammae

    Create a moving platform

    Hi, I've been stumped by this for quite awhile and I feel as if it's so simple. I'm simply trying to create a platform that moves back and forth that a player can jump on. I got a platform to move by doing something like this: platform = this.physics.add.sprite(300, 100, 'form'); platform.body.allowGravity = false; platform.body.immovable = true; platform.body.velocity.x = 100; But it just keeps moving in one direction and I can't figure out how to make it collide with the player. I tried the: this.physics.add.collider(this.player, platform); But that did not work. I just want a simple platform that moves back and forth that the player can jump on. Please any help is greatly appreciated, I'm ready to pull my hair out over this. 😞
  25. Play Link: Pixel Memory Find all card pairs, level your profile & unlock new cards in this “Memory” classic optimized for mobile! Play Link: Pixel Memory Welcome to the "Memory" classic, expanded with new features & optimized for mobile! Game Features: Play the “Memory” classic in this mobile game. 3 Difficulties: Easy, Medium & Hard. Level up your profile & unlock more cards. Browse your collection to see which cards you’ve already unlocked. 4 card deck skins: Choose the one you like best! View your profile for your game stats & best scores in all difficulties. Gameplay: Find all the matching card pairs on the table. Find them before you run out of guesses. Unlock all the card packages in the game. Controls: The whole game requires only click inputs and is perfectly optimized for mobile! Credits: The game was developed solely by me. All assets in this game were either done by me or from the CC0 assets linked below. These sources are also credited inside the game: Play Button Name: Cartoon Mobile Rounded Icon Buttons Author: Nathan "GDquest" Lovato, https://opengameart.org/users/gdquest, http://gdquest.com/ URL: https://opengameart.org/content/cartoon-mobile-rounded-icon-buttons Explosion Sprite: Name: 2D Explosion Animations #2 | Frame by frame Author: Sinestesia, https://opengameart.org/users/sinestesia, http://www.sinestesiastudio.com/ URL: https://opengameart.org/content/2d-explosion-animations-2-frame-by-frame http://bit.ly/2C6Bi8b Audio: http://www.freesfx.co.uk/sfx/ Play Link: Pixel Memory