Search the Community

Showing results for tags 'phaser 2'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • 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 24 results

  1. Hi, I'm making a dismemberment function of a sprite (human) when it died. This is how i see it : Get 6 bitmap (pooled) Copy with copyRect part of the sprite's texture (legs, torso, ...) and eventually resize these bitmaps Get 6 Image (pooled) and apply theses different textures Play some tweens to make parts fly randomly When tweens finished, free the 6 bitmaps and 6 image ( return to pool queue) Do you have any advices ( performance, ...) about this way ? Thanks
  2. Hi, Which is the most efficient way when you need to deal with many text to display (mobile/pc) ? Because i spent times on forum and didnt find a clear answer (sometimes Phaser.Text, but often BitmapText) : Thanks
  3. Hi All I've been working on a top down endless runner , where the player jumps from one platform to another and should not leave the screen. How to make a platform move horizontally I'm spawning platforms and adding x and y velocity its working but is it a right of doing it ? if not how to make it look better this.initX = this.x; this.body.velocity.y = -200; platform.prototype.update = function () { if (this.moving) { if (this.x > (this.initX + this.width)) { this.speed = -200; } if (this.x < (this.initX)) { this.speed = 200; } this.body.velocity.x = this.speed; }
  4. Hi all, I am new to Phaser game development. I want to build a game like this: https://studio.code.org/s/hero/stage/1/puzzle/1. The idea is that I want to use blockly to play the phaser game instead of keyboard input. Basically I want to write some javascript code that would make the Phaser game figure move (write code to play the game). My question is: is there any API in Phaser can help me achieve that? Or the only way to achieve that is to simulate keypress in browser? Thank you all! Update: I figure out I just need to set the cursors properties. This question has been resolved.
  5. this.game.physics.startSystem(Phaser.Physics.P2JS); this.game.physics.p2.setImpactEvents(true); var wallCollisionGroup = this.game.physics.p2.createCollisionGroup(); var playerCollisionGroup = this.game.physics.p2.createCollisionGroup(); var doorCollisionGroup = this.game.physics.p2.createCollisionGroup(); this.game.physics.p2.updateBoundsCollisionGroup(); // I've created all the necessary collisions as in expamle: https://phaser.io/examples/v2/p2-physics/collision-groups and it works perfect. player.body.collides(wallCollisionGroup); player.body.collides(doorCollisionGroup, wrongDoor, this); cursors = this.game.input.keyboard.createCursorKeys(); } wrongDoor() { player.body.velocity.x = 0; player.body.velocity.y = 0; //player.body.setZeroVelocity(); //player.body.velocity.x = -20000; //player.body.velocity.y = -20000; //player.body.static = true; result = 'You last hit: The wall :)'; this.game.displayDialogLine('Message', 'text'); } update() { player.body.velocity.x = 0; player.body.velocity.y = 0; if (cursors.left.isDown) { player.body.velocity.x = -300; } else if (cursors.right.isDown) { player.body.velocity.x = 300; } if (cursors.up.isDown) { player.body.velocity.y = -300; } else if (cursors.down.isDown) { player.body.velocity.y = 300; } } Hello. I'm making a game where player have to reach the right door and created all the necessary collisions and it works almost perfect, except the call back function wrongDoor. I want to create a dialog line when player collides wrong door and make his velocity = 0 while dialog line is on screen, but I can't. Every time player colldes the door dialog line displays on screen but the player sprite still moves. How can I make him stop on collision with door? All the //commented stuff I've tried and it didn't help. I tried to add this function in Update function but it triggers wrongDoor all the time and displays dialog line again and again from the start of the game. I've tried set velocity = -20000 but it doesn't set -20000 velocity, like it doesn't see the player. On screenshots I press up and right buttons so character moves up and right after wrongDoor triggers.
  6. We moved our game from Phaser 2.6.2 "Kore Springs" to 2.10.3 and encountered this error in Firefox and Internet Explorer: IndexSizeError: Index or size is negative or greater than the allowed amount The exception is trown from PIXI.Sprite.prototype._renderCanvas: renderSession.context.drawImage(this.texture.baseTexture.source, cx, cy, cw, ch, dx, dy, cw / resolution, ch / resolution); The arguments are: cx : 803 cy : 899.37 cw : 168 ch : 0 dx : -0 dy : -0.6299999999999955 resolution : 1 Everything was fine in "Kore Springs" but we wanted to take advantage of all the fixes and updates on tilemaps in CE.
  7. KungFuFlames

    What are the major changes in Phaser 3

    I resently started working with Phaser 3 and so far I learn some of the differences compared to Phaser 2: Scenes No pixi engine Is there any other notable differences at this point?
  8. Hi guys, Im kinda new here but I need help with Phaser 2 (PhaserCE 2.10.3) and loading videos.. My code is : main.prototype = { preload: function(){ game.load.video("earth_1", "assets/video/earth_1.mp4"); }, create: function(){ var video = game.add.video("earth_1"); video.play(true); video.addToWorld(); var flare = spawner.spawn(g.sprites.flare) var ring = spawner.spawn(g.sprites.ring) var highly_recommended = spawner.spawn(g.sprites.highly_recommended) var logo = spawner.spawn(g.sprites.logo) ... it works fine when I run it in web using a local server.. but when I compile it with cocoon using canvas+, i get an error. using the cocoon developer app i get the errors attached.. i tried my best to google it out and also look at the https://photonstorm.github.io/phaser-ce/ docs as well as the main site but i just cant crack this running out of ideas.. does the video resolution have an effect? im using an .mp4 video as an animated background
  9. Hi, so I'm trying make a doodle jump type of a game , so far I've created the infinity world and added 6 ledges. now I want to kill and revive the ledges with the new X and Y coordinates, but somehow can't get it to work. I've managed to kill the ledges as they go out of camera bounds by using (forEachAlive)but got issues with reviving them. I've tried getFisrtDead and reset but nope, cant get it to work. Does anyone know how I could solve this? so this is how I create the platforms: generatePlatforms: function(){ //grouping the platforms platformPool = game.add.group(); platformPool.enableBody = true; var ground = game.add.sprite(0, game.world.height -32 ,'ground' ); platformPool.add(ground); ground.scale.setTo(3,2); ground.body.immovable = true; for (var i= 0; i < 6; i++){ var randomX =game.rnd.integerInRange(0, game.world.width -50); var randomY = game.world.height -100 *i; ledge = game.add.sprite(randomX,randomY,'ground'); platformPool.add(ledge); ledge.scale.setTo(0.3,0.3); ledge.body.immovable =true; } }, and this is how I kill the ledges under the update function: platformPool.forEachAlive(function(el){ var platformYMin = el.y; if(el.inCamera == false){ el.kill(); } },this); Thanks in advance
  10. EpicKingdom_

    Is it still acceptable to use Phaser 2?

    I am thinking about just using Phaser 2 for my games since there are so many available examples online unlike Phaser 3.
  11. Hello, I'm using Phaser CE trying to make a very simple game were two cowboys shoot them but in the middle there is a Cactus which gets destroyed with every shot. I followed this example https://phaser.io/tutorials/coding-tips-002 run nice in every browser. So I have almost everything working in chrome but in Firefox I cant see anything drawn over the BMP. It's hard to simplify my original code. So I tried to build a very simple one to showcase my problem by extracting code from the example link. I just want to draw a whole when pressing key A. I also tried with different blending modes. It still does run ok in chrome but not in FF nor safari. Has it anything to do with my code or with the browsers...? var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update }); var background; var landBMP; function preload() { game.load.image('land','assets/images/land.png'); game.load.image('background','assets/images/background.png'); } function create() { boomKey = game.input.keyboard.addKey(Phaser.Keyboard.A); boomKey.onDown.add(drawBoom, this); // Load Background background = this.add.sprite(0, 0, 'background'); // Load bmp data landBMP = this.add.bitmapData(992, 480); landBMP.draw('land'); landBMP.update(); landBMP.addToWorld(); } function drawBoom(){ landBMP.blendDestinationOut(); landBMP.circle(300, 400, 60, 'rgba(0, 0, 0, 255'); landBMP.blendReset(); landBMP.update(); } function update() { } Any help is apreciated PS: I attached my results with chrome and firefox after pressing A key
  12. elkranio

    Exoplanet Express

    Hey hey. We've just finished our new game - Exoplanet Express. It's a very distant Lunar Lander relative You need to deliver the cargo from point A to point B and try to get it there in one piece. There are 50 levels on 5 different planets. Each planet has it's own theme and offers new challenges. Simple trailer: Standard version: http://overhype.com/games/exoplanet_express/ All levels unlocked: http://overhype.com/pub/exoplanet_express/ Feel free to drop us a line if you're interested in buying a license: contact@overhype.com
  13. I've seen a gantt chart with a planned "phaser 2 to 3 migration guide" but now it seems to be deleted. I have a lot of 2.x code and I would love to migrate to 3.x in an ordered way. So, will there be any migration guide or should I just start seeing the examples and tutorials and figure out the best way to do it? It's nice to have such amazing library!
  14. dartheater

    6 x 6 grid

    I need to know how to program a really simple 6x6 grid in Phaser - I can't figure out how to do it and I've been trying for ages! I am planning on further developing it with some friends later but I need to get this sorted first
  15. Hello, i am new to using Phaser, and i would love to know if i am able to use DOM elements within my Phaser stage (canvas). I have a div which is styled to look like a ball and i would like to use this ball in the phaser game to physicly bounce on any of the ledges i will define in the future. My question: can i use this DOM element to do so? Or should i use a sprite/image? Because whenever the ball hits any of the ledges, i want it to change color. (I know this is possible with sprites and sprite recoloring) Greetings, Regentix
  16. ugajin

    is the Phaser 2 repo closed?

    I was about to file a bug report on gitHub and saw a notice that the repo is for Phaser 3 related issues only. So, is the Phaser 2 repo closed? The bug relates to the beginFill(...) and arc(..., true) methods see below. Perhaps this has been fixed in v3? Here is the issue... let myGraphic = game.add.graphics(game.world.centerX, game.world.centerY); myGraphic.beginFill(0xFF3300, 0.5); myGraphic.arc(0, 0, 135, game.math.degToRad(0), game.math.degToRad(90), true); let myGraphic = game.add.graphics(game.world.centerX, game.world.centerY); myGraphic.beginFill(0xFF3300, 0.5); myGraphic.arc(0, 0, 135, game.math.degToRad(0), game.math.degToRad(90), true); The issue may be reproduced with the above code using the bool direction parameter set to true [anticlockwise] together with beginFill(...). Rather starting the arc at due east 0º, the fill is begun from about 7º. Oddly if rendered using lineStyle(...) only and without beginFill(...) it draws correctly, beginning at 0º The same issue may be seen in the example at: https://phaser.io/examples/v2/display/arc -u
  17. I was wondering is there function in Phaser that will allow me to generate pixel data object from current Phaser Scene (cover the whole canvas or part of it) and pass this object in I don't know which form to the second Phaser Stage and display it as it is at certain position? Something like this: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Pixel_manipulation_with_canvas Or I just fall back to plain Canvas API and use ImageData object?
  18. I am struggling to make Phaser text field show special characters like these: [ {"str":"ā","codeValue":257,"analog":"-a", "analogCodes": [45, 97]}, {"str":"ī","codeValue":299,"analog":"-i", "analogCodes": [45, 105]}, {"str":"ū","codeValue":363,"analog":"-u", "analogCodes": [45, 117]}, {"str":"ṛ","codeValue":7771,"analog":"r.", "analogCodes": [114, 46]}, {"str":"ṝ","codeValue":7773,"analog":"-r.", "analogCodes": [45, 114, 46]}, {"str":"ḷ","codeValue":7735,"analog":"l.", "analogCodes": [108, 46]}, {"str":"ḹ","codeValue":7737,"analog":"-l.", "analogCodes": [45, 108, 46]}, {"str":"ṁ","codeValue":7745,"analog":".m", "analogCodes": [46, 109]}, {"str":"ṃ","codeValue":7747,"analog":"m.", "analogCodes": [109, 46]}, {"str":"ḥ","codeValue":7717,"analog":"h.", "analogCodes": [104, 46]}, {"str":"ñ","codeValue":241,"analog":"~n", "analogCodes": [126, 110]}, {"str":"ṅ","codeValue":7749,"analog":".n", "analogCodes": [46, 110]}, {"str":"ṭ","codeValue":7789,"analog":"t.", "analogCodes": [116, 46]}, {"str":"ḍ","codeValue":7693,"analog":"d.", "analogCodes": [100, 46]}, {"str":"ṇ","codeValue":7751,"analog":"n.", "analogCodes": [110, 46]}, {"str":"ś","codeValue":347,"analog":"'s", "analogCodes": [39, 115]}, {"str":"ṣ","codeValue":7779,"analog":"s.", "analogCodes": [115, 46]} ] People call them Sanskrit:IAST letters, romanic version for letters from Devanagari alphabet. Some of them are not show at all, apart from those that are near code 256. Ones that are bigger like 7773 or such are not shown. Which font should I use or are there some style settings I could use?
  19. I'm completely new to Phaser and am coming to it from a general Web Development background. I need to be sure I understand a few of the terms/nouns used when defining/answering "What am I looking at/rendering?". Currently, it seems to me that: State (as in the StateManager) - the difference between booting, loading, login, main menu, tactical game map, full-screen mini map Scene - the difference between the tactical map when the player is in sector A1 vs. B1 vs. C1 Level - really only related to game design and a subset of Scene changes World (Phaser.World) - little more than a container for everything in the game; mostly used to use the default Stage, bound the Camera, and potentially affect physics Camera - the portion of the Stage which is currently being rendered in Phaser's web browser element (e.g. using WebGL/canvas) Stage - the subset of the World which stores and controls renderable stuff 1. Am I correct that a tactical game map and a game minimap would be different State objects? 2. Going through the initial tutorial and looking at the paucity of World examples implies to me that the world is a relatively background object, only incidental to the game insofar as it is used as a method to bound the stage, camera, and physics. Is that really it, or is the World probably the key point to, for example, manage dynamically adding and removing data about nearby stuff in a particularly large game map? 3. Could a Scene be validly defined in the context of Phaser as "the set of things to be rendered"? If so, then what meaningful difference is there between a Scene and a World? Otherwise, is a Scene really more "about" the graphic/art/audio side of game design the way a Level might be mostly about the game mechanics, difficulty curve, and narrative flow? Looking at some videos of game creation with tools like Unity, "Scene" seems to have a fairly specific and technical connotation within the context of game design, but Google has not provided me any indication of exactly what that definition and connotation is. I do see that the Phaser 2 docs don't reference "scene". 4. Are there terms I am missing that I should make sure I understand because they might not mean quite what I think they mean (e.g. I expect the verb "render" to approximately mean "putting stuff on screen", and the noun "view" to mean something along the lines of "view" in MVC).
  20. Hey friends, I'm incredibly fond of Phaser and it's flexibility for making games, both big and small. The included Arcade Particles are really slick, too. One thing I really liked about 2.4.4 was that Particles.Arcade.Emitter.emitParticle enabled me to specify a key and frame when shooting a single particle out. Right now I'm making a platformer where I'm emitting a few deliberate particles at specific events. An example is below: All of my particles use the same sheet, but different particles can have different images, velocities, and lifespans. At the moment, I typically have to achieve this by doing: emitter.setXSpeed(dX, dX);emitter.setYSpeed(dY, dY);emitter.lifespan = someLifespan;emitter.emitParticle(x, y, key, frame); I'd prefer to have one emitter that I can pass parameters to individual particles. I could wrap emitParticle in a new function, but I was curious if anyone had a better solution I'm not aware of. I've also created a pull request for adding lifespan as an optional parameter to emitParticle as well. It's not exactly for the original intended use case of Emitter, but I think that would help developers in a similar situation to myself. Cheers!
  21. jorge.graca

    Multi-hitbox Phaser Button

    Hi all, I am trying to extend the Phaser.Button to have different hit-areas depending on it's state: this.onInputDown.add(() => {this._isDown = true;let tempPhaserFrame = game.cache.getFrameByName(key, frameDown);if (tempPhaserFrame instanceof Phaser.Frame) {this.hitArea = tempPhaserFrame.getRect();// this.hitArea.offset(-this.anchor.x * this.hitArea.width, -this.anchor.y * this.hitArea.height);console.log(this.hitArea);}});However, when I do this the button immediately gets unpressed once the hitArea is changed. Why is this? How could I achieve a variable sized button hit check? Thanks.
  22. So yes I did try to export for Android using Intel XDK/Crosswalk and the exported file was 20+ megabytes. Let just say I am building a variant of Tetris which is classic arcade game, contained of 80% code and alghorithm and 20 percent of assets, sounds/images/GUI. So you are expecting it to be less 5MB all in all. I mean when we talk about mobile and web games we think of small games. So building with Crosswalk aka 20+ megabytes of added weight seems silly. I also tried Cordova for Android but the build was sluggish. I have Nexus 7 with nVidia Tegra and Intel quad core processor. This seem damn stupid Should I bother with JavaScript builds for Android at all? How about JS builds for iOS or Windows Phone, or other smart phones? This leads me to building a game as a true/native non hybrid Android application and of course iOS app. Any thoughts about that Firefox OS thing?
  23. I am sure I miss something. I did this to scale my game to available space in my Nexus 7: window.document.addEventListener('deviceready', function (event) {'use strict'; WML.gameObject.scale.scaleMode = Phaser.ScaleManager.EXACT_FIT; WML.gameObject.scale.forceOrientation(true, false); WML.gameObject.scale.pageAlignHorizontally = true; WML.gameObject.scale.pageAlignVertically = true; WML.gameObject.scale.setScreenSize(true); console.log("deviceready " + event);});So yes this event is fired, I get the last log command printed in console. But still the game doesn't fit all into the screen. Anything I should consider further? Plus on my real nexus7 it also goes into protrait and landscape but want it only in landscape. I also have this line in my index.html <script src="cordova.js"></script>Does XDK imports is automatically or I have to include this script in my folder? Not sure where to find it?
  24. Hello. I searched some of the project templates in Phaser Gituhub but it seems the assets/images are not available for download. Can you please suggest me some link where can I find free to use finished Phaser game that I can convert into Cordova/Android mobile game just for testing purposes? I already started something with cordova and managed to deploy emulator and working environment. But when I run my game I just see the background color of index.html file. I assume the game is out of viewport so I kind of need help to understand what is going on. Also what docs/books can you refer me when speaking about Cordova/Phaser? There is nothing in the phaser docs.