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,298 results

  1. JoseDu

    [Phaser] Zlotnan

    Hi everyone, I just finished new small game using Phaser: http://zlotnan.strangevillage.com/ So check it out and any feedback will be appreciated. Thanks!
  2. temporalix

    tweening to set positions

    Hello. I've been trying to setup some way to tween my sprite to 3 set areas on the screen, but it ends up going from 1 side to the other. left = game.input.keyboard.addKey(Phaser.Keyboard.LEFT); left.onDown.add(function () { pos > -2 ? pos-- : pos; if (pos == 1) { game.add.tween(ufo).to({ x: 400 }, 1000, Phaser.Easing.Linear.None, true, 0); } else { game.add.tween(ufo).to({ x: 250 }, 1000, Phaser.Easing.Linear.None, true, 0); } }, this);right = game.input.keyboard.addKey(Phaser.Keyboard.RIGHT); right.onUp.add(function () { pos<2?pos++:pos; if(pos==-1) { game.add.tween(ufo).to({ x: 400 }, 1000, Phaser.Easing.Linear.None, true, 0); } else { game.add.tween(ufo).to({ x: 950 }, 1000, Phaser.Easing.Linear.None, true, 0); } }, this); what am I doing wrong?
  3. Gamma

    Collision Question

    In an example, using timers to spawn an object, the objects themselves drop to the bottom of the "world bound". How would I implement collision detection to the bottom of the world bound. In other words, how do I identify when the object touches the bottom of the world bound. My plan was to replicate this timer and remove the object when it touches the bottom of the world bound. How would I implement this. So far I've created a 'remove' function for when I figure this out. Pseudo code of what I was trying to do is down below: update function: this.game.physics.collide(objectGoesHere, [BOTTOM OF WORLD BOUND GOES HERE] , this.REMOVEFUNCTIONHERE, null, this);What would go in the "Bottom of World Bound Goes Here" to make it so that the object when colliding with the bottom of the world bound, like in the link given above, executes and then I can call a function to remove it. Thank you in advance.
  4. Salvatore

    It's mandatory to use tiles?

    Hi! I'm researching the Phaser Framework and my question is: To use Phaser it's required to buid my game is tilemaps? I can't use sprite based graphics? Example: Shank, Rayman, Braid, etc are sprite based. Or, i'll have to use tilemap, but only the invisible collision rectangles will be tile based? Thanks!
  5. turnA

    [Phaser] Vivirus

    Hi folks! Another week, another new HTML5 games from me, Vivirus! Vivirus is a simple arcade/chain-reaction type of games where you must eat all the virus that invade your body. Tap at the correct moment to eat virus in your radius, and continue to do so until all the virus is eaten. Different virus has different influence on your eating radius and speed, so choose carefully who you will eat next. Link: j.mp/vivrus Alternate Link: https://dl.dropboxusercontent.com/u/47459072/vivirus/index.html If you have any problem or feedback, do let me know! I will really appreciate it!
  6. John

    [Phaser] Shear Genius

    The title refers to the mad-scientist based contraption in the game, not the game itself which is silly bordering on inane. :-) http://jotson.itch.io/shear-genius Hey. This is a non-violent high-score action game about shearing sheep. I created it mainly as an exercise to learn Phaser and to see if Phaser and I would get along (we do—Phaser is awesome). I haven't spent any time optimizing it for mobile at all yet but it runs well enough on the desktop. I'll optimize and add leaderboards and CocoonJs-ify it later. Anyway, I'm putting this away for now while I work on #cyberpunkjam and #7drl. The best score I've been able to get is about 120,000. Feedback is welcome. Thanks!
  7. mtburdon

    Blurred images on iPhone

    Hi guys, I've been playing around with Phaser for the last couple of weeks and I'm really loving it, very easy to work with and fun too! I have come across an issue however, I'm sure I'm probably doing something silly so I'm hoping someone can point me in the right direction. The issue: I come from a web dev background, so for my images, I've made them double the size and then using scale.setTo(0.5,0,5) to shrink them to the size I want them to display at. That's all fine, however when I use the game on my iPhone the images appear rather blurry instead of nice and crisp. Can anyone point me in the right direction here, am I doing something wrong? Thanks, Martin
  8. Hello everyone, I have a question on optimizing a Phaser game for mobile use. Recently I made a new game, but for now it can only be used on the Desktop. How do you optimize the game in order to place it on IOS without going on a mobile browser? I currently was thinking about using Phonegap, does anyone have any other recommendations except this one? Also, I have been having an awkward situation with the font system for the engine. Can anyone help me with this issue? I do not want to repeat my post again, and so the post to the original, which includes source code, is down below: http://www.html5gamedevs.com/topic/4104-font-problems/ Thank you all in advance.
  9. Hi, I'm using game.time.elapsed to update my game entities. They are expecting frame delta time in milliseconds (ms). It seems to work. On all platforms, will elapsed be in milliseconds? Am I using game.time.elapsed correctly? Thanks for the awesome engine.
  10. sphimau

    Problem with tileSprite

    Hi everybody, I am a newbie to phaser and I am trying to build a world for a game project. I would like to make a parallax background and to make that I'm using tileSprite. The problem is that when I create a tile of 256x256 its renders but when the size changes I'm getting black square and in the console log I'm getting this message I'm using phaser v1.1.5 from the CDN http://cdnjs.cloudflare.com/ajax/libs/phaser/1.1.5/phaser.min.js. Also I would like to know if it's possible to add some movement on the z-axis. Thank you very much for your help
  11. Hi guys, I am back with another noobish question. I have created a text object in my game. this.text1 = this.add.text(63, 50, "Option 1", style);and added some fancy tween animation to it. and now in the update function I want to access its position, console.log(this.text1.x);But it only returns "63" i.e the initial position that I created it at, and not the dynamic position. How can I make it return the real time position of the text object ? /*======================================================================*/ I basically wanted to check the position of text to make sure whether it was overlapping with my main character. I went through the docs and I though that maybe I should use the overlap function for this . So I added the following in the update function. this.game.physics.overlap(this.bird, this.text1, this.restart_game, null, this);But sadly that didn't work either.
  12. I have been working on a tile-based rogue-like exploration game that is supposed to be very relaxing and peaceful. A lot of it is procedurally generated, and I wanted to procedurally generate the music, too. So I loaded two octaves of notes in the pentatonic scale: this.game.load.audio('notec', ['../wp-content/themes/toolbox/js/assets/music/notec.ogg','../wp-content/themes/toolbox/js/assets/music/notec.mp3']);this.game.load.audio('noted', ['../wp-content/themes/toolbox/js/assets/music/noted.ogg','../wp-content/themes/toolbox/js/assets/music/noted.mp3']);this.game.load.audio('notee', ['../wp-content/themes/toolbox/js/assets/music/notee.ogg','../wp-content/themes/toolbox/js/assets/music/notee.mp3']);this.game.load.audio('noteg', ['../wp-content/themes/toolbox/js/assets/music/noteg.ogg','../wp-content/themes/toolbox/js/assets/music/noteg.mp3']);this.game.load.audio('notea', ['../wp-content/themes/toolbox/js/assets/music/notea.ogg','../wp-content/themes/toolbox/js/assets/music/notea.mp3']);this.game.load.audio('notec2', ['../wp-content/themes/toolbox/js/assets/music/notec2.ogg','../wp-content/themes/toolbox/js/assets/music/notec2.mp3']);this.game.load.audio('noted2', ['../wp-content/themes/toolbox/js/assets/music/noted2.ogg','../wp-content/themes/toolbox/js/assets/music/noted2.mp3']);this.game.load.audio('notee2', ['../wp-content/themes/toolbox/js/assets/music/notee2.ogg','../wp-content/themes/toolbox/js/assets/music/notee2.mp3']);this.game.load.audio('noteg2', ['../wp-content/themes/toolbox/js/assets/music/noteg2.ogg','../wp-content/themes/toolbox/js/assets/music/noteg2.mp3']);this.game.load.audio('notea2', ['../wp-content/themes/toolbox/js/assets/music/notea2.ogg','../wp-content/themes/toolbox/js/assets/music/notea2.mp3']);And then I called a function every time the person took a step: sound_track: function() { // random music generation if ((stepcounter % 2) == 1) { ckey = game.add.audio('notec'); dkey = game.add.audio('noted'); ekey = game.add.audio('notee'); gkey = game.add.audio('noteg'); akey = game.add.audio('notea'); c2key = game.add.audio('notec'); d2key = game.add.audio('noted'); e2key = game.add.audio('notee'); g2key = game.add.audio('noteg'); a2key = game.add.audio('notea'); ckey.volume = .3; dkey.volume = .3; ekey.volume = .3; gkey.volume = .3; akey.volume = .3; c2key.volume = .3; d2key.volume = .3; e2key.volume = .3; g2key.volume = .3; a2key.volume = .3; console.log("this part's working"); var randtime = Math.floor(Math.random()*8)+1; var randmusic = Math.floor(Math.random()*12)+1; if ((randtime == 1) || ((stepcounter % 4) == 1)) { // guaranteed beat console.log(randmusic); if (randmusic == 1 || randmusic == 11) ckey.play(); if (randmusic == 2) dkey.play(); if (randmusic == 3) ekey.play(); if (randmusic == 4) gkey.play(); if (randmusic == 5) akey.play(); if (randmusic == 6) c2key.play(); if (randmusic == 7) d2key.play(); if (randmusic == 8) e2key.play(); if (randmusic == 9) g2key.play(); if (randmusic == 10) a2key.play(); } } },Which seemed to work fine! (Albeit a bit random: I need to write a few more rules, perhaps a bassline, to give the song more structure. But it's already very zen!) Anyway, this works great for the first hundred or so steps, but then the audio starts to get all staticky. Eventually, it stopped playing at all, and I had to reload the window. I thought maybe I could fix this by making the files shorter and more compressed, and I did that, and it seemed to help a bit, but the audio still got pretty corrupted-sounded and eventually stopped all-together. This affects all audio played by the code, even sound effects which have not been played more than a few times, and does not go away if I wait. I am not a programmer, and this is just a side project for me. So it's very possible that I am doing something silly, or stupid, or preposterously round-about. If so, please correct me! I have really enjoyed the experience of coding in Phaser, and it's been a lot of fun, but this kind of bug (which throws no errors in the console!) totally perplexes me, as it falls outside the realm of internal code-logic and into the realm of technical know-how, of which I have none. (If you would like to test the game out, you can find it a http://www.koanoftheday.com/trails, and the password is trails. It's not completely finished, though, so there might be other bugs!) Also, a PS: I have lurked in these forums and used people's advice to solve a number of issues already. This seems like a great place, and you all seem like great people, and I'm excited to finally register and start contributing (even if my first contribution is a request for help!). Thank you all. EDIT: Well, I think I've figured it out! The problem was that I was doing the "ckey = game.add.audio('notec');" stuff (I'm not actually sure what this is called, only how it functions!) every single time the sound effects were called. This was overloading something and making the sound sound horrible. Hopefully somebody else will do the same stupid thing and this post will serve as helpful information to them!
  13. shahbazk30

    Click On An Image not working

    Hi All, I have recently started exploring phaser. I am struggling with the sprite.events.onInputDown event. Problem is that the click event is not firing after every click. It fires after clicking sprite multiple times. I have even tried phaser example "02 - click on an image.js" which comes with the download but i am facing same issue with the example. I have also tried same example from following link but problem is the same there too . http://gametest.mobi/phaser/examples/_site/view_full.html?d=basics&f=02+-+click+on+an+image.js&t=02%20-%20click%20on%20an%20image I am testing on my PC (window 7) on chrome and firefox. here is my code window.onload = function () { var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create}); function preload() { game.load.image('einstein', 'phaser.png'); } var image; function create() { image = game.add.sprite(0, 0, 'einstein'); image.inputEnabled = true; image.events.onInputDown.add(listener, this); } var n = 0; function listener() { alert('a'); n++; } };
  14. panovsky

    some item in some group

    hi all I have some item in some group. How can i find parent group of my item and index of item in this group?
  15. GrimPanda

    [Phaser] Space Flight

    Space Flight Hi! We just finished up another game, this one is called Space Flight. Use your finger to trace a path from incoming ships to the appropriate colored stations. As the game progresses, you will get more ships, stations, and unique upgrades that make managing your space port easier, but more challenging at the same time! Manage the universe's busiest space station! Help Mr. Warply figure out how to land all the ships coming to land at his stations. Several different stations, ship colors and additional challenges await you as you progress! Can you master this skill? Please let us know your thoughts! Play Space Flight Right Here! Play Space Flight Right Here!
  16. turnA

    [Phaser] Louie's Dog

    Hi there, just want to share my HTML5 games, Louie's Dog. Although this is my first time posting here, this is not my first HTML5 games. Maybe I can share the other games here later. Louie's Dog is a grid sliding puzzle games where you must reunite Louie and his missing white dog. Beware though, there are other special tile to consider, and Angry Dog & Animal Control Officer to avoid. You can also find hidden gold bones under the ground to increase your completion rating. There are no timer or score here, so just sit back, relax, and solve all the level with all the time in the world Link: j.mp/louiedog Alternate Link: https://dl.dropboxusercontent.com/u/47459072/louiesdog/index.html If you have problem playing the games, do let me know. Any feedback will be appreciated!
  17. plicatibu

    Cocoon JS - In app purchase

    Have anyone successfully used in-app purchase with CocoonJS and Phaser (for Android platform) ? Could you pinpoint some tutorial, tips and tricks, regarding this matter? Thank you.
  18. plicatibu

    Kiwi.js vs Phaser

    It seems a naive question but is kiwi.js an ancestor of Phaser, is it a borther of Phaser or what? I came across this post and this other one and I didn't get it. Also here you see in kiwi.js the statement Phaser.js (Kiwi Lite). Isn't Phaser suitable for mobile devices too? Why 2 projects? Thanks.
  19. Hello, I have a problem with sprites with a body set as immovable. When my player collide with two immovable bodies, one of these bodies moves. You can try with the two bushes under the player. 1- Go on top of the left bush and collide with it2- While still colliding, try pushing the right bush http://folia-game.herokuapp.com/index-dev.html The code for the player and the bush are easely readable with DevTools (player.js and bush.js, you can read obstaclesgroup.js too). I don't understand what I'm doing wrong so if someone can help me to fix it, I'll owe him one. Thank you.
  20. I want to move a text object , this.option1 = game.add.group();this.option1 = this.game.add.text(width-200, 20, "Option 1", { font: "30px Arial", fill: "#ffffff" });this.option1.velocity.x = -200;But it throws a TypeError saying Uncaught TypeError: Cannot set property 'x' of undefined
  21. kavun

    A way to tween font size?

    Is there a way to tween some text's font size?
  22. zenista

    [WIP] [Phaser] Sharp Shooter

    Hi, Here is the game i am working on. Please check it out and provide feedback. Specially try it in a mobile browser. Link: http://www.breakfail.com -regards update: latest version uploaded
  23. As you might have seen a few days ago, I've been trying to work out what is needed to get Phaser working as best as possible on an Ouya using CocoonJS. It has been a very frustrating road and, while I have had some successes, I've also finally hit a point where I really want some other people's opinions on where to go next. First, though, some solutions. So, as it turns out, I was only partially right in the additional property to test for in my change to the "pollStatus" code for gamepad input. It actually needs to test for the property and call the function too. Here is the code for that. var rawGamepads = (navigator.webkitGetGamepads && navigator.webkitGetGamepads()) || navigator.webkitGamepads || (navigator.getGamepads && navigator.getGamepads());(This has the added benefit of working in Firefox Aurora too now, but more on that a little later in this post.) Through my testing, I was at first surprised and then highly annoyed to learn that the 'index' property of gamepads in CocoonJS is unreliable. While the specification states indices start at zero, it doesn't include how counting should happen between gamepads being connected, disconnected, or reconnected. The result of this is inconsistency is that, in CocoonJS anyway, you might get "0, 1, 2" for the first three controller indices, or you might get "0, 5, 8" sometimes. (It also doesn't help that the CocoonJS Custom Loader remembers the last index as long as it is running. I was up to an index of 25 at one point yesterday.) To combat this issue, and hopefully not break the existing Phaser code for other systems, I have the following patch for "ongamepadconnect." this._ongamepadconnected = function(event) { var newPad = event.gamepad; _this._rawPads.push(newPad); for (var i in _this._gamepads) { if (!_this._gamepads[i].connected) { _this._gamepads[i].connect(newPad); break; } } };Instead of trusting the index of the gamepad, it looks for the first open slot within the four gamepads (as of 1.1.5 in Phaser) and 'connects' it. If all are connected, "_gamepads" is not updated. And here is the patch for "ongamepaddisconnected" too. this._ongamepaddisconnected = function(event) { var removedPad = event.gamepad; var removedPadIndex = 0; for (var i in _this._rawPads) { if (_this._rawPads[i].index === removedPad.index) { _this._rawPads.splice(i,1); removedPadIndex = i; } } _this._gamepads[removedPadIndex].disconnect(); };This time, instead of removing according to the "removePad.index" (as was previously the case), it finds the index of the pad to remove from "_rawPads" and uses that. Because I wanted to test the above code on another system, I turned to running in Aurora (since I knew it supported the two events). This became a very Good News / Bad News situation. Good News: Aurora passes the same "(navigator.getGamepads && navigator.getGamepads())" test CocoonJS does. No changes there. And there is now a new 'connected' property per gamepad built in too. Bad News: Gamepads no longer have a 'timestamp' property and buttons are now "GamepadButton" objects. The former is a fairly easy fix. Test if the index of the button array is an object and then look for its 'value' (float) or 'pressed' (boolean) property. The later is more complicated, and a problem I've recently learned CocoonJS suffers from too. (After the Aurora testing, I used the same code on my Ouya in CocoonJS. It has a 'timestamp' per gamepad, it turns out, but it remained a '0' during all of my testing. Not helpful. At all.) All of this explanation and code now brings me to some questions: Should the Phaser code be re-written to match these two systems? And if so, what is the best way to go about it?It should be possible to use "this.game.time.now" to record our own timestamps. And I think this could even happen as part of "pollStatus" function somehow. But I really want some second, third, and maybe even fourth opinions about how to go about it, or if it should even be done in the first place. After all, the Aurora and CocoonJS timestamp issues might work themselves out in their next versions. Or they may not. I don't know if it is worth waiting several weeks at a minimum to find out. Is there anyone out there willing to either work with me or independently collaborate on this Phaser + CocoonJS debugging?I'm making progress in fits and starts. And I know other people are waiting for the go-ahead to start using Phaser in CocoonJS without problems. I figure there has to be at least one other developer willing to just check over that "Yes, this works for me too" or "Nope, I don't see that here" on these various changes. While I was thrilled @rich was willing to adopt my earlier changes, it has made me more skittish the deeper I go and the more little bits of code I change to get Phaser working in CocoonJS as smoothy as possible.
  24. Gamma

    Font Problems

    I recently launched a game called Robo Dash, and I few people have sent me some comments saying that the game has font issues where when the player loses the match and replay the font gets bolder and bolder. It doesn't seem to register the font I placed in the code. I decided to go with a bold font I found on Google fonts named 'Chango', but when the game starts it's very thin, and then becomes bold once the game restarts. Can someone help me with this issue. Code is down below: HTML Header: <link href='http://fonts.googleapis.com/css?family=Chango' rel='stylesheet' type='text/css'> Create Function: scoreText = this.game.add.text(290, 210, "SCORE: " + score, { font: "30px Chango", fill: "#ecf0f1" }); highScoreText = this.game.add.text(290, 240, "HIGHSCORE: " + highscore, { font: "30px Chango", fill: "#ecf0f1" }); intensityText = this.game.add.text(290, 270, "INTENSITY: " + counter, { font: "30px Chango", fill: "#ecf0f1" });Robo Dash Game
  25. I've been testing Phaser on Windows Phone 7/8, and I've run into couple of problems. 1) Phaser doesn't recognize Windows Phone as mobile device on game.device Phaser 1.1.5 recognizes Windows Phone as a desktop device at game.device.desktop. I checked the phaser's online docs for game.device, and there doesn't appear to be any user agent checks for windows phone. There is a check for the existence of 'windows' string that subsequently sets the game.device.desktop value true. According to a stack overflow answer, the safest thing would be to check user agent for the 'windows phone' string. In addition to the normal mobile mode, there's also a desktop mode in some windows phone models, that is missing the 'phone' part on user agent. The desktop mode is trying to mask itself as desktop version, it appears to be pretty hard to distinguish it from real windows 8 machine. 2) Game resizes incorrectly on Windows Phone I'm having problems getting my game to scale properly on windows phone 8, when using 480x320 resolution for the game. I have tried using the full screen mobile template under resources folder, with minor changes, but that doesn't seem to work. I'm testing on Nokia Lumia 920 in mobile mode with screen resolution 1280×768. I thought setting game.stage.scalemode to Phaser.StageScaleMode.SHOW_ALL would have resized the app to fit inside the browser, but as it is, it doesn't do that. SHOW_ALL only sets the width of the app to match the width of the screen when in landscape mode. Due to this the height of the game is almost twice the screen's height. EXACT_FIT and NO_SCALE don't work any better. Is this is the intended functionality, or am I just missing something? I have been testing the game on android tablets as well, but windows phone is the only one where I'm running into this problem. My settings: var game = new Phaser.Game(480, 320, Phaser.AUTO, 'game');game.stage.scaleMode = Phaser.StageScaleMode.SHOW_ALL;game.stage.scale.minWidth = 320;game.stage.scale.minHeight = 240;game.stage.scale.maxWidth = 960;game.stage.scale.maxHeight = 640;game.stage.scale.pageAlignVertically = true;game.stage.scale.pageAlignHorizontally = true;game.stage.scale.forceOrientation(true, false);game.stage.scale.enterIncorrectOrientation.add(this.enterIncorrectOrientation, this)game.stage.scale.leaveIncorrectOrientation.add(this.leaveIncorrectOrientation, this)game.stage.scale.setScreenSize(true); 3) Some Windows Phone models don't trigger game.stage.scale.leaveIncorrectOrientation on orientation switch I'm also having problems with Nokia Lumia 620 (another windows phone) when switching from portrait to landscape. As mentioned above I'm using the full screen mobile template, and i haven't touched the code on this part. The game correctly shows the turn your phone to landscape mode image (from the template) in the portrait mode. When the device is turned to landscape mode, the same image is still visible, only zoomed in to the top left corner of the image. Problem seems to be that game.stage.scale.leaveIncorrectOrientation isn't triggering correctly on the device. The device is able to change from landscape to portrait, so it's no a question of a missing sensor. This problem doesn't appear on Lumia 920, although I've managed to have it happen couple of times with chrome on my laptop when switching browser window size while developer tools are open. Any ideas what could be causing this, or how should I handle this? 4) Using console.log on Windows Phone is a bad idea This last one isn't related to Phaser, just something I realized after trying to debug my app on windows phone, and thought of sharing. Apparently, from time to time, even though Windows Phone's browser doesn't have visible console available. the console in it can crash/close. When it does, it sets the console global undefined. So, if you are getting mysterious crashes when trying to run development code on windows phone, it might be due to your console.log statements. In order to get rid of the problem, you need to create a new console object somewhere in your code, if one doesn't already exist. The code below is from garry-lachman.com. if (typeof console == 'undefined') { var console = new Object(); console.log = function(){} console.error = function(){} console.debug = function(){} console.warn = function(){}}