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
    • 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 31 results

  1. Hi! character in my game is this cat: The cat is class extending group and contains torso and head, both are sprites with arcade physics enable on it. In the game, the cat is pushed up by applying velocity on it and it collects certain items (gameplay is similar to Flip the Gun game, check it out for better understanding). THE PROBLEM: In update method, I am constantly checking for collisionse between cat and the items: this.game.physics.arcade.overlap(this._cat, this._sceneObjectsLayer, this.onObjectCollision, null, this); My onObjectCollision method looks like this: onObjectCollision(cat: Phaser.Sprite, item: GeneratedItem) { console.log("COLLISION SOURCE IS " + cat.key); console.log("COLLISION! OBJECT ID IS " + item.ItemID + "... UPDATE FRAME IS " + this._updateFrameCnt); this._items++; this._UI.showCount(this._items); item.KillItem(); //inside this method I call item.kill() this._sceneObjectsLayer.remove(item); } Basically, it should just update the total amount of items taken in player UI. The problem is that same item is sometimes collected multiple times. That makes sense - one collision for torso, one for head, but I would expect it not to call this method for the same item after item.kill() is called. I already debugged this and I put the variable this._updateFrameCnt to update method. Result is this. You can see that the item with certain ID is collected, then it is killed and after few frames it is collected again like no kill() was called on it: State_game.ts:451 COLLISION SOURCE IS catHead State_game.ts:452 COLLISION! OBJECT ID IS 0... UPDATE FRAME IS 2034 GeneratedItem.ts:52 KILLING ITEM WITH ID 0 //called from item.KillItem //and after few frames: State_game.ts:451 COLLISION SOURCE IS catTorso State_game.ts:452 COLLISION! OBJECT ID IS 0... UPDATE FRAME IS 2040 GeneratedItem.ts:52 KILLING ITEM WITH ID 0 //called from item.KillItem Moreover, this sometimes happens for the same sprite (for example it is called twice for head sprite). Is this expected behaviour due the reasons how Phaser handles physics? Seems really strange for me, I would expect to make physics computation after each frame and therefore no second collision should occur, because the item should be dead at the time. Am I missing something here? Thanks in advance for your responses!
  2. tanmoy749

    Loading assets

    How to load images or assets from local address instead of phaser assets through web? Whenever I try to load assets from my local drive it doesn't show the contents.I want to load my assets offline. Thanks in advance.
  3. Need to make a drawing tool where sprites would be pipes of different shapes and they need to be controlled through drag and drop and virtual joystick.
  4. Hello I made a game by phaser 2. Ragnarok Triple Triad is a strategy game design base on Triple Triad : a card game originating from Final Fantasy VIII Ragnarok Online : massive multiplayer online role-playing game Game Play Ragnarok Triple Triad is played on a three-by-three (3x3) square grid of blank spaces where monsters will be placed as the game progresses Each monster has lv, hp numbers placed in top, bottom; Monsters can have elemental alignments that affect the gameplay if there are elemental icons on the game board. FEATURES - Reset Game. You could start the game from the start at any time you want. - Upgrade Monster. You could obtain stronger monster by exchange numbers of low lv monsters - PVP : Working on. The Design is on working so it's a little off. Website Demo Link : http://cbr-game.com/tripletriad/index.html This game purpose design to play in mobile so it's rotate 90 degree You should play it in your mobile with lock enable. You could try it here. Android link : https://play.google.com/store/apps/details?id=com.ragnarok.trtr Demo Play Link Some Images. Having any problems? Any suggestions? I would love to hear from you! Please contact me: bacsojin.1102@gmail.com
  5. Hi, recently i moved from Phaser 2 to Phaser 3 and i started some new project. Here is my problem: In Phaser 2 its easy to add text to sprite like this: var sprite = game.add.sprite(...); var button_style = { font: "27px Verdana", fontWeight: "bold", align: "center", fill: "#000000", stroke: '#ffffff', strokeThickness: 2 }; button_text = game.add.text(0, 0, 'blabla', button_style); sprite.addChild(button_text); After few days i am very tired of searching to get solution on Phaser 3 to add text on sprite. Can anybody help me please ? Thanks in advance.
  6. Reservoir Cleansing. Short arcade type game, just kill the enemies each level: ARROWS (UP & DOWN) - Switch character Z - Attack X - Heal C - Power up (Character upgrades when bar fills) (MAX is Golden armour) It was just a small project to take a break from a big one (kaeBLUE). Won't be doing much to this , but any feedback will help improve any future versions, or even other games. - PLAY ON KONGREGATE - Thanks 😀
  7. AzraelTycka

    What happened to Lazer?

    Hi, I've been off the grid for a quite a while. I'd like to ask what happened to Lazer project? Is it now Phaser 3 or is that a branch of Phaser 2? Thank you guys.
  8. 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
  9. 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
  10. 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; }
  11. 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.
  12. 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.
  13. 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.
  14. 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?
  15. 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
  16. 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
  17. 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.
  18. 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
  19. 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
  20. 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!
  21. 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
  22. 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
  23. 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
  24. 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?
  25. 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?